|
|
1.1 ! root 1: /* (-lgl ! 2: * COHERENT Version 4.0.2 ! 3: * Copyright (c) 1982, 1992 by Mark Williams Company. ! 4: * All rights reserved. May not be copied without permission. ! 5: -lgl) */ ! 6: /* ! 7: * stdio.h ! 8: * COHERENT Standard Input/Output library header. ! 9: * ANSI C Standard, Section 4.9. ! 10: */ ! 11: ! 12: #ifndef _STDIO_H ! 13: #define _STDIO_H ! 14: ! 15: #ifndef NULL ! 16: #define NULL ((char *)0) ! 17: #endif ! 18: ! 19: /* Macros. */ ! 20: #define BUFSIZ 512 /* default buffer size */ ! 21: #define EOF (-1) /* end of file */ ! 22: #define _EOFCHAR 26 /* ASCII EOF character */ ! 23: #define FILENAME_MAX 64 /* max filename length */ ! 24: #define FOPEN_MAX _NFILE /* max # of open files */ ! 25: #define _NFILE 60 /* number of FILEs */ ! 26: #define _NSTDFILE 3 /* number of predefined FILEs */ ! 27: #define L_tmpnam 64 /* tmpnam length */ ! 28: #define SEEK_CUR 1 /* from current position */ ! 29: #define SEEK_END 2 /* from end */ ! 30: #define SEEK_SET 0 /* from beginning */ ! 31: #define TMP_MAX 91 /* number of tmpnams */ ! 32: ! 33: /* Types. */ ! 34: typedef long fpos_t; /* file position type */ ! 35: #ifndef _SIZE_T ! 36: #define _SIZE_T ! 37: typedef unsigned int size_t; /* sizeof result type */ ! 38: #endif ! 39: /* ! 40: * The order the first 5 FILE members corresponds to the order in iBCS2, ! 41: * to allow a degree of binary compatability. ! 42: */ ! 43: typedef struct FILE { ! 44: int _cc; /* character count */ ! 45: unsigned char *_cp; /* current character */ ! 46: struct _FILE2 *_f2p; /* more info */ ! 47: char _ff1; /* flags */ ! 48: char _fd; /* file descriptor */ ! 49: char _ff2; /* more flags; see below */ ! 50: char _mode; /* mode */ ! 51: } FILE; ! 52: /* These additional members are not in struct FILE for compatability reasons. */ ! 53: typedef struct _FILE2 { ! 54: int (*_gt)(); /* getc function */ ! 55: int (*_pt)(); /* putc function */ ! 56: unsigned char *_bp; /* start of buffer */ ! 57: unsigned char *_dp; /* start of data */ ! 58: unsigned char *_ep; /* end of buffer */ ! 59: char *_nm; /* temp file name */ ! 60: int _uc; /* ungot char */ ! 61: } _FILE2; ! 62: ! 63: /* iBCS2 compatability. */ ! 64: #define _cnt _cc ! 65: #define _ptr _cp ! 66: #define _base _f2p ! 67: #define _flag _ff1 ! 68: #define _file _fd ! 69: ! 70: /* Standard FILEs. */ ! 71: extern FILE _iob[_NSTDFILE]; ! 72: extern FILE *_fp[_NFILE]; ! 73: #define stdin (&_iob[0]) ! 74: #define stdout (&_iob[1]) ! 75: #define stderr (&_iob[2]) ! 76: ! 77: /* _IO[FLN]BF are used for setvbuf() type args. */ ! 78: #define _IOFBF 0x00 /* fully buffered */ ! 79: #define _IONBF 0x04 /* unbuffered */ ! 80: #define _IOLBF 0x40 /* line buffered */ ! 81: /* Flags in _ff1, cf. iBCS2. */ ! 82: #define _FEOF 0x10 /* end of file */ ! 83: #define _FERR 0x20 /* error */ ! 84: /* Non-iBCS2 flags in _ff1. */ ! 85: #define _FRONLY 0x01 /* read only */ ! 86: #define _FWONLY 0x02 /* write only */ ! 87: #define _FRW 0x80 /* read and write */ ! 88: ! 89: /* Flags in _ff2, not in iBCS2. */ ! 90: #define _FINUSE 0x01 /* in use */ ! 91: #define _FAPPND 0x02 /* append */ ! 92: #define _FASCII 0x04 /* ASCII */ ! 93: #define _FDONTC 0x08 /* do not close */ ! 94: #define _FFREEB 0x10 /* free buffer when closed */ ! 95: #define _FUNGOT 0x80 /* ungotten char present */ ! 96: ! 97: /* Mode field values. */ ! 98: #define _MODE_FBUF 0x01 /* fully buffered */ ! 99: #define _MODE_LBUF 0x02 /* line buffered */ ! 100: #define _MODE_NBUF 0x04 /* unbuffered */ ! 101: #define _MODE_STR 0x08 /* string */ ! 102: #define _MODE_UNINIT 0x10 /* uninitialized */ ! 103: ! 104: /* External declarations for non-conforming implementations. */ ! 105: /* Standard functions. */ ! 106: extern void clearerr(); /* 4.9.10.1 */ ! 107: extern int fclose (); /* 4.9.5.1 */ ! 108: extern int feof (); /* 4.9.10.2 */ ! 109: extern int ferror (); /* 4.9.10.3 */ ! 110: extern int fflush (); /* 4.9.5.2 */ ! 111: extern int fgetc (); /* 4.9.7.1 */ ! 112: extern int fgetpos (); /* 4.9.9.1 */ ! 113: extern char * fgets (); /* 4.9.7.2 */ ! 114: extern FILE * fopen (); /* 4.9.5.3 */ ! 115: extern int fprintf (); /* 4.9.6.1 */ ! 116: extern int fputc (); /* 4.9.7.3 */ ! 117: extern int fputs (); /* 4.9.7.4 */ ! 118: extern size_t fread (); /* 4.9.8.1 */ ! 119: extern FILE * freopen (); /* 4.9.5.4 */ ! 120: extern int fscanf (); /* 4.9.6.2 */ ! 121: extern int fseek (); /* 4.9.9.2 */ ! 122: extern int fsetpos (); /* 4.9.9.3 */ ! 123: extern long int ftell (); /* 4.9.9.4 */ ! 124: extern size_t fwrite (); /* 4.9.8.2 */ ! 125: extern int getc (); /* 4.9.7.5 */ ! 126: extern int getchar (); /* 4.9.7.6 */ ! 127: extern char * gets (); /* 4.9.7.7 */ ! 128: extern void perror (); /* 4.9.10.4 */ ! 129: extern int printf (); /* 4.9.6.3 */ ! 130: extern int putc (); /* 4.9.7.8 */ ! 131: extern int putchar (); /* 4.9.7.9 */ ! 132: extern int puts (); /* 4.9.7.10 */ ! 133: extern int remove (); /* 4.9.4.1 */ ! 134: extern int rename (); /* 4.9.4.2 */ ! 135: extern void rewind (); /* 4.9.9.5 */ ! 136: extern int scanf (); /* 4.9.6.4 */ ! 137: extern void setbuf (); /* 4.9.5.5 */ ! 138: extern int setvbuf (); /* 4.9.5.6 */ ! 139: extern int sprintf (); /* 4.9.6.5 */ ! 140: extern int sscanf (); /* 4.9.6.6 */ ! 141: extern FILE * tmpfile (); /* 4.9.4.3 */ ! 142: extern char * tmpnam (); /* 4.9.4.4 */ ! 143: extern int ungetc (); /* 4.9.7.11 */ ! 144: extern int vfprintf(); /* 4.9.6.7 */ ! 145: extern int vprintf (); /* 4.9.6.8 */ ! 146: extern int vsprintf(); /* 4.9.6.9 */ ! 147: ! 148: /* Internal functions. */ ! 149: extern void _dassign(); ! 150: extern int _dscan (); ! 151: extern char * _dtefg (); ! 152: extern void _dtoa (); ! 153: extern int _fgetb (); ! 154: extern int _fgetc (); ! 155: extern int _fgete (); ! 156: extern int _fgetstr(); ! 157: extern int _fginit (); ! 158: extern int _filbuf (); ! 159: extern void _finish (); ! 160: extern int _flsbuf (); ! 161: extern FILE * _fopen (); ! 162: extern int _fpinit (); ! 163: extern int _fpseek (); ! 164: extern int _fputa (); ! 165: extern int _fputb (); ! 166: extern int _fputc (); ! 167: extern int _fpute (); ! 168: extern int _fputt (); ! 169: extern int _scanf (); ! 170: extern FILE * _stropen(); ! 171: ! 172: /* Macros covering standard functions. */ ! 173: #define clearerr(fp) ((fp)->_ff1 &= ~(_FERR|_FEOF)) ! 174: #define feof(fp) ((fp)->_ff1 & _FEOF) ! 175: #define ferror(fp) ((fp)->_ff1 & _FERR) ! 176: #define getc(fp) (--(fp)->_cc<0 ? ++(fp)->_cc,(*(fp)->_f2p->_gt)((fp)) \ ! 177: : *(fp)->_cp++) ! 178: #define getchar() getc(stdin) ! 179: #define putc(c,fp) (--(fp)->_cc<0 ? ++(fp)->_cc,(*(fp)->_f2p->_pt)((c),(fp)) \ ! 180: : (*(fp)->_cp++=(c))) ! 181: #define putchar(c) putc((c), stdout) ! 182: ! 183: /* Other macros, non-ANSI. */ ! 184: #define fileno(fp) ((fp)->_fd) ! 185: #endif ! 186: ! 187: /* end of stdio.h */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.