PAUSE
ENCORE5
ENCORE
BOX
ILLUSTRATION
GO
On the UNIX file system tree:
[ / ]
|
/```````/``````|```````\````````\
/ / | \ \
bin usr lib etc tmp
The standard C library has pathname /lib/libc.a or /lib/Llibc.a :
\
\
\
libc.a
The standard C library contains object modules for the functions
belonging to the library!
__start.o
cuserid.o
fdopen.o
fgetc.o
fseek.o
getchar.o
:
:
printf.o
setbuf.o
:
ssignal.o
/lib/libc.a
[ / ]
|
/```````/``````|```````\````````\
/ / | \ \
bin usr lib etc tmp
\
\
\
libc.a
The Standard I/O Library has pathname /usr/include/stdio.h
/
/
/
include
|
|
stdio.h
The contents of stdio.h on your system is similar to the following:
DOSJMP
/* Copyright 1984 XYZ Corporation - Unixtown, USA */
/* Delta Date: 10:11:43 2/7/88" */
/* @(#)stdio.h 2.9 */
#ifndef _NFILE
#define _NFILE 64
#if u370
#define BUFSIZ 4096
#endif
#if vax || u3b || u3b5 || tower
#define BUFSIZ 1024
#endif
#if pdp11
#define BUFSIZ 512
#endif
/* buffer size for multi-character output to unbuffered files */
#define _SBFSIZ 8
typedef struct {
#if vax || u3b || u3b5 || tower
int _cnt;
unsigned char *_ptr;
#else
unsigned char *_ptr;
int _cnt;
#endif
unsigned char *_base;
char _flag;
char _file;
} FILE;
/*
* _IOLBF means that a file's output will be buffered line by line
* In addition to being flags, _IONBF, _IOLBF and _IOFBF are possible
* values for "type" in setvbuf.
*/
#define _IOFBF 0000
#define _IOREAD 0001
#define _IOWRT 0002
#define _IONBF 0004
#define _IOMYBUF 0010
#define _IOEOF 0020
#define _IOERR 0040
#define _IOLBF 0100
#define _IORW 0200
#ifndef NULL
#define NULL 0
#endif
#ifndef EOF
#define EOF (-1)
#endif
#define stdin (&_iob[0])
#define stdout (&_iob[1])
#define stderr (&_iob[2])
#define _bufend(p) _bufendtab[(p)->_file]
#define _bufsiz(p) (_bufend(p) - (p)->_base)
#ifndef lint
#define getc(p) (--(p)->_cnt < 0 ? _filbuf(p) : (int) *(p)->_ptr++)
#define putc(x, p) (--(p)->_cnt < 0 ? \
_flsbuf((unsigned char) (x), (p)) : \
(int) (*(p)->_ptr++ = (unsigned char) (x)))
#define getchar() getc(stdin)
#define putchar(x) putc((x), stdout)
#define clearerr(p) ((void) ((p)->_flag &= ~(_IOERR | _IOEOF)))
#define feof(p) ((p)->_flag & _IOEOF)
#define ferror(p) ((p)->_flag & _IOERR)
#define fileno(p) (p)->_file
#endif
extern FILE _iob[_NFILE];
extern FILE *fopen(), *fdopen(), *freopen(), *popen(), *tmpfile();
extern long ftell();
extern void rewind(), setbuf();
extern char *ctermid(), *cuserid(), *fgets(), *gets(), *tempnam(), *tmpnam();
extern unsigned char *_bufendtab[];
#define L_ctermid 9
#define L_cuserid 9
#define P_tmpdir "/usr/tmp/"
#define L_tmpnam (sizeof(P_tmpdir) + 15)
#endif