|
|
1.1 root 1: /***
2: *stdio.h - definitions/declarations for standard I/O routines
3: *
4: * Copyright (c) 1985-1991, 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: #ifndef _INC_STDIO
14:
15: #ifdef __cplusplus
16: extern "C" {
17: #endif
18:
19:
20: #if (_MSC_VER <= 600)
21: #define __cdecl _cdecl
22: #endif
23:
24: #ifndef _SIZE_T_DEFINED
25: typedef unsigned int size_t;
26: #define _SIZE_T_DEFINED
27: #endif
28:
29: #ifndef _VA_LIST_DEFINED
30: typedef char * va_list;
31: #define _VA_LIST_DEFINED
32: #endif
33:
34:
35: /* buffered I/O macros */
36:
37: #define BUFSIZ 512
38: #ifdef _MT
39: #define _NFILE 40
40: #else
41: #define _NFILE 20
42: #endif
43: #define EOF (-1)
44:
45: #ifndef _FILE_DEFINED
46: struct _iobuf {
47: char *_ptr;
48: int _cnt;
49: char *_base;
50: int _flag;
51: int _file;
52: int _charbuf;
53: int _bufsiz;
54: int __tmpnum;
55: };
56: typedef struct _iobuf FILE;
57: #define _FILE_DEFINED
58: #endif
59:
60: /* P_tmpnam: Directory where temporary files may be created.
61: * L_tmpnam size = size of P_tmpdir
62: * + 1 (in case P_tmpdir does not end in "\\")
63: * + 6 (for the temp number string)
64: * + 1 (for the null terminator)
65: */
66:
67: #define _P_tmpdir "\\"
68: #define L_tmpnam sizeof(_P_tmpdir)+8
69:
70: #define SEEK_CUR 1
71: #define SEEK_END 2
72: #define SEEK_SET 0
73:
74: #define FILENAME_MAX 63
75: #define FOPEN_MAX 20
76: #define _SYS_OPEN 20
77: #define TMP_MAX 32767
78:
79:
80: /* define NULL pointer value */
81:
82: #ifndef NULL
83: #ifdef __cplusplus
84: #define NULL 0
85: #else
86: #define NULL ((void *)0)
87: #endif
88: #endif
89:
90:
91: /* declare _iob[] array */
92:
93: #ifndef _STDIO_DEFINED
94: extern FILE _iob[];
95: #endif
96:
97:
98: /* define file position type */
99:
100: #ifndef _FPOS_T_DEFINED
101: typedef long fpos_t;
102: #define _FPOS_T_DEFINED
103: #endif
104:
105:
106: #define stdin (&_iob[0])
107: #define stdout (&_iob[1])
108: #define stderr (&_iob[2])
109:
110:
111: #define _IOREAD 0x0001
112: #define _IOWRT 0x0002
113:
114: #define _IOFBF 0x0000
115: #define _IOLBF 0x0040
116: #define _IONBF 0x0004
117:
118: #define _IOMYBUF 0x0008
119: #define _IOEOF 0x0010
120: #define _IOERR 0x0020
121: #define _IOSTRG 0x0040
122: #define _IORW 0x0080
123:
124:
125: /* function prototypes */
126:
127: #ifndef _STDIO_DEFINED
128: int _filbuf(FILE *);
129: int _flsbuf(int, FILE *);
130: FILE * _fsopen(const char *, const char *, int);
131: void clearerr(FILE *);
132: int fclose(FILE *);
133: int _fcloseall(void);
134: FILE * _fdopen(int, const char *);
135: int feof(FILE *);
136: int ferror(FILE *);
137: int fflush(FILE *);
138: int fgetc(FILE *);
139: int _fgetchar(void);
140: int fgetpos(FILE *, fpos_t *);
141: char * fgets(char *, int, FILE *);
142: int _fileno(FILE *);
143: int _flushall(void);
144: FILE * fopen(const char *, const char *);
145: int fprintf(FILE *, const char *, ...);
146: int fputc(int, FILE *);
147: int _fputchar(int);
148: int fputs(const char *, FILE *);
149: size_t fread(void *, size_t, size_t, FILE *);
150: FILE * freopen(const char *, const char *, FILE *);
151: int fscanf(FILE *, const char *, ...);
152: int fsetpos(FILE *, const fpos_t *);
153: int fseek(FILE *, long, int);
154: long ftell(FILE *);
155: size_t fwrite(const void *, size_t, size_t, FILE *);
156: int getc(FILE *);
157: int getchar(void);
158: char * gets(char *);
159: int _getw(FILE *);
160: void perror(const char *);
161: int _pclose(FILE *);
162: FILE * _popen(const char *, const char *);
163: int printf(const char *, ...);
164: int putc(int, FILE *);
165: int putchar(int);
166: int puts(const char *);
167: int _putw(int, FILE *);
168: int remove(const char *);
169: int rename(const char *, const char *);
170: void rewind(FILE *);
171: int _rmtmp(void);
172: int scanf(const char *, ...);
173: void setbuf(FILE *, char *);
174: int setvbuf(FILE *, char *, int, size_t);
175: int _snprintf(char *, size_t, const char *, ...);
176: int sprintf(char *, const char *, ...);
177: int sscanf(const char *, const char *, ...);
178: char * _tempnam(char *, char *);
179: FILE * tmpfile(void);
180: char * tmpnam(char *);
181: int ungetc(int, FILE *);
182: int _unlink(const char *);
183: int vfprintf(FILE *, const char *, va_list);
184: int vprintf(const char *, va_list);
185: int _vsnprintf(char *, size_t, const char *, va_list);
186: int vsprintf(char *, const char *, va_list);
187: #define _STDIO_DEFINED
188: #endif
189:
190:
191: /* macro definitions */
192:
193: #define feof(_stream) ((_stream)->_flag & _IOEOF)
194: #define ferror(_stream) ((_stream)->_flag & _IOERR)
195: #define _fileno(_stream) ((_stream)->_file)
196: #define getc(_stream) (--(_stream)->_cnt >= 0 ? 0xff & *(_stream)->_ptr++ \
197: : _filbuf(_stream))
198: #define putc(_c,_stream) (--(_stream)->_cnt >= 0 \
199: ? 0xff & (*(_stream)->_ptr++ = (char)(_c)) : _flsbuf((_c),(_stream)))
200: #define getchar() getc(stdin)
201: #define putchar(_c) putc((_c),stdout)
202:
203: #ifdef _MT
204: #undef getc
205: #undef putc
206: #undef getchar
207: #undef putchar
208: #endif
209:
210: #if !__STDC__
211: /* Non-ANSI names for compatibility */
212:
213: #define P_tmpdir _P_tmpdir
214: #define SYS_OPEN _SYS_OPEN
215:
216: #define fcloseall _fcloseall
217: #define fdopen _fdopen
218: #define fgetchar _fgetchar
219: #define fileno _fileno
220: #define flushall _flushall
221: #define fputchar _fputchar
222: #define getw _getw
223: #define putw _putw
224: #define rmtmp _rmtmp
225: #define tempnam _tempnam
226: #define unlink _unlink
227:
228: #endif /* __STDC__ */
229:
230: #ifdef __cplusplus
231: }
232: #endif
233:
234: #define _INC_STDIO
235: #endif /* _INC_STDIO */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.