|
|
1.1 ! root 1: /*** ! 2: *stdio.h - definitions/declarations for standard I/O routines ! 3: * ! 4: * Copyright (c) 1985-1987, Microsoft Corporation. All rights reserved. ! 5: * ! 6: *Purpose: ! 7: * This file defines the structures, values, macros, and functions ! 8: * used by the level 2 I/O ("standard I/O") routines. ! 9: * [ANSI/System V] ! 10: * ! 11: *******************************************************************************/ ! 12: ! 13: ! 14: #ifndef _SIZE_T_DEFINED ! 15: typedef unsigned int size_t; ! 16: #define _SIZE_T_DEFINED ! 17: #endif ! 18: ! 19: #ifndef _VA_LIST_DEFINED ! 20: typedef char *va_list; ! 21: #define _VA_LIST_DEFINED ! 22: #endif ! 23: ! 24: #ifndef NO_EXT_KEYS /* extensions enabled */ ! 25: #define _CDECL cdecl ! 26: #define _NEAR near ! 27: #else /* extensions not enabled */ ! 28: #define _CDECL ! 29: #define _NEAR ! 30: #endif /* NO_EXT_KEYS */ ! 31: ! 32: ! 33: /* buffered I/O macros */ ! 34: ! 35: #define BUFSIZ 512 ! 36: #define _NFILE 20 ! 37: #define EOF (-1) ! 38: ! 39: #ifndef _FILE_DEFINED ! 40: #define FILE struct _iobuf ! 41: #define _FILE_DEFINED ! 42: #endif ! 43: ! 44: /* P_tmpnam: Directory where temporary files may be created. ! 45: * L_tmpnam size = size of P_tmpdir ! 46: * + 1 (in case P_tmpdir does not end in "\\") ! 47: * + 6 (for the temp number string) ! 48: * + 1 (for the null terminator) ! 49: */ ! 50: ! 51: #define P_tmpdir "\\" ! 52: #define L_tmpnam sizeof(P_tmpdir)+8 ! 53: ! 54: #define SEEK_CUR 1 ! 55: #define SEEK_END 2 ! 56: #define SEEK_SET 0 ! 57: ! 58: #define SYS_OPEN 20 ! 59: #define TMP_MAX 32767 ! 60: ! 61: ! 62: /* define NULL pointer value */ ! 63: ! 64: #if (defined(M_I86SM) || defined(M_I86MM)) ! 65: #define NULL 0 ! 66: #elif (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM)) ! 67: #define NULL 0L ! 68: #endif ! 69: ! 70: ! 71: /* define file control block */ ! 72: ! 73: #ifndef _IOB_DEFINED ! 74: extern FILE { ! 75: char *_ptr; ! 76: int _cnt; ! 77: char *_base; ! 78: char _flag; ! 79: char _file; ! 80: } _NEAR _CDECL _iob[]; ! 81: #define _IOB_DEFINED ! 82: #endif ! 83: ! 84: #define fpos_t long /* file position variable */ ! 85: ! 86: #define stdin (&_iob[0]) ! 87: #define stdout (&_iob[1]) ! 88: #define stderr (&_iob[2]) ! 89: #define stdaux (&_iob[3]) ! 90: #define stdprn (&_iob[4]) ! 91: ! 92: #define _IOREAD 0x01 ! 93: #define _IOWRT 0x02 ! 94: ! 95: #define _IOFBF 0x0 ! 96: #define _IOLBF 0x40 ! 97: #define _IONBF 0x04 ! 98: ! 99: #define _IOMYBUF 0x08 ! 100: #define _IOEOF 0x10 ! 101: #define _IOERR 0x20 ! 102: #define _IOSTRG 0x40 ! 103: #define _IORW 0x80 ! 104: ! 105: #define getc(f) (--(f)->_cnt >= 0 ? 0xff & *(f)->_ptr++ : _filbuf(f)) ! 106: #define putc(c,f) (--(f)->_cnt >= 0 ? 0xff & (*(f)->_ptr++ = (char)(c)) : \ ! 107: _flsbuf((c),(f))) ! 108: ! 109: #define getchar() getc(stdin) ! 110: #define putchar(c) putc((c),stdout) ! 111: ! 112: #define feof(f) ((f)->_flag & _IOEOF) ! 113: #define ferror(f) ((f)->_flag & _IOERR) ! 114: #define fileno(f) ((f)->_file) ! 115: ! 116: ! 117: /* function prototypes */ ! 118: ! 119: int _CDECL _filbuf(FILE *); ! 120: int _CDECL _flsbuf(int, FILE *); ! 121: void _CDECL clearerr(FILE *); ! 122: int _CDECL fclose(FILE *); ! 123: int _CDECL fcloseall(void); ! 124: FILE * _CDECL fdopen(int, char *); ! 125: int _CDECL fflush(FILE *); ! 126: int _CDECL fgetc(FILE *); ! 127: int _CDECL fgetchar(void); ! 128: int _CDECL fgetpos(FILE *, fpos_t *); ! 129: char * _CDECL fgets(char *, int, FILE *); ! 130: int _CDECL flushall(void); ! 131: FILE * _CDECL fopen(const char *, const char *); ! 132: int _CDECL fprintf(FILE *, const char *, ...); ! 133: int _CDECL fputc(int, FILE *); ! 134: int _CDECL fputchar(int); ! 135: int _CDECL fputs(const char *, FILE *); ! 136: size_t _CDECL fread(void *, size_t, size_t, FILE *); ! 137: FILE * _CDECL freopen(const char *, const char *, FILE *); ! 138: int _CDECL fscanf(FILE *, const char *, ...); ! 139: int _CDECL fsetpos(FILE *, const fpos_t *); ! 140: int _CDECL fseek(FILE *, long, int); ! 141: long _CDECL ftell(FILE *); ! 142: size_t _CDECL fwrite(const void *, size_t, size_t, FILE *); ! 143: char * _CDECL gets(char *); ! 144: int _CDECL getw(FILE *); ! 145: void _CDECL perror(const char *); ! 146: int _CDECL printf(const char *, ...); ! 147: int _CDECL puts(const char *); ! 148: int _CDECL putw(int, FILE *); ! 149: int _CDECL remove(const char *); ! 150: int _CDECL rename(const char *, const char *); ! 151: void _CDECL rewind(FILE *); ! 152: int _CDECL rmtmp(void); ! 153: int _CDECL scanf(const char *, ...); ! 154: void _CDECL setbuf(FILE *, char *); ! 155: int _CDECL setvbuf(FILE *, char *, int, size_t); ! 156: int _CDECL sprintf(char *, const char *, ...); ! 157: int _CDECL sscanf(const char *, const char *, ...); ! 158: char * _CDECL tempnam(char *, char *); ! 159: FILE * _CDECL tmpfile(void); ! 160: char * _CDECL tmpnam(char *); ! 161: int _CDECL ungetc(int, FILE *); ! 162: int _CDECL unlink(const char *); ! 163: int _CDECL vfprintf(FILE *, const char *, va_list); ! 164: int _CDECL vprintf(const char *, va_list); ! 165: int _CDECL vsprintf(char *, const char *, va_list);
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.