home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / INC.PAK / STDIO.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  20.1 KB  |  506 lines

  1. /*  stdio.h
  2.  
  3.     Definitions for stream input/output.
  4.  
  5. */
  6.  
  7. /*
  8.  *      C/C++ Run Time Library - Version 8.0
  9.  *
  10.  *      Copyright (c) 1987, 1997 by Borland International
  11.  *      All Rights Reserved.
  12.  *
  13.  */
  14. /* $Revision:   8.21  $ */
  15.  
  16. #ifndef __STDIO_H
  17. #define __STDIO_H
  18.  
  19. #if !defined(___DEFS_H)
  20. #include <_defs.h>
  21. #endif
  22.  
  23. #if !defined(___NFILE_H)
  24. #include <_nfile.h>
  25. #endif
  26.  
  27. #ifndef NULL
  28. #include <_null.h>
  29. #endif
  30.  
  31.  
  32. #if !defined(RC_INVOKED)
  33.  
  34. #if defined(__STDC__)
  35. #pragma warn -nak
  36. #endif
  37.  
  38. #pragma pack(push, 1)
  39.  
  40. #endif  /* !RC_INVOKED */
  41.  
  42.  
  43. #ifndef _SIZE_T
  44. #define _SIZE_T
  45. typedef unsigned size_t;
  46. #endif
  47.  
  48. #ifndef __cplusplus
  49. #if !defined(_WCHAR_T) && !defined(_WCHAR_T_DEFINED)
  50. #define _WCHAR_T
  51. #define _WCHAR_T_DEFINED  /* For WINDOWS.H */
  52. typedef unsigned short wchar_t;
  53. #endif
  54. #endif
  55.  
  56. #if !defined(_WINT_T)
  57. typedef wchar_t wint_t;
  58. #define _WINT_T
  59. #endif
  60.  
  61. /* Definition of the file position type
  62. */
  63. typedef long    fpos_t;
  64.  
  65. /* An external reference to _floatconvert (using #pragma extref _floatconvert)
  66.  * forces floating point format conversions to be linked.
  67.  */
  68. extern int _floatconvert;
  69.  
  70. /* Bufferisation type to be used as 3rd argument for "setvbuf" function
  71. */
  72. #define _IOFBF  0
  73. #define _IOLBF  1
  74. #define _IONBF  2
  75.  
  76. /*  "flags" bits definitions
  77. */
  78. #define _F_RDWR 0x0003                  /* Read/write flag       */
  79. #define _F_READ 0x0001                  /* Read only file        */
  80. #define _F_WRIT 0x0002                  /* Write only file       */
  81. #define _F_BUF  0x0004                  /* Malloc'ed Buffer data */
  82. #define _F_LBUF 0x0008                  /* line-buffered file    */
  83. #define _F_ERR  0x0010                  /* Error indicator       */
  84. #define _F_EOF  0x0020                  /* EOF indicator         */
  85. #define _F_BIN  0x0040                  /* Binary file indicator */
  86. #define _F_IN   0x0080                  /* Data is incoming      */
  87. #define _F_OUT  0x0100                  /* Data is outgoing      */
  88. #define _F_TERM 0x0200                  /* File is a terminal    */
  89.  
  90. /* End-of-file constant definition
  91. */
  92. #define EOF (-1)                /* End of file indicator */
  93. #define WEOF (wint_t)(0xFFFF)   /* wide-character end of file indicator */
  94.  
  95. /* Default buffer size use by "setbuf" function
  96. */
  97. #define BUFSIZ  512         /* Buffer size for stdio */
  98.  
  99. /* Size of an arry large enough to hold a temporary file name string
  100. */
  101. #define L_ctermid   5       /* CON: plus null byte */
  102. #define P_tmpdir    ""      /* temporary directory */
  103. #define L_tmpnam    13      /* tmpnam buffer size */
  104.  
  105. /* Constants to be used as 3rd argument for "fseek" function
  106. */
  107. #define SEEK_CUR    1
  108. #define SEEK_END    2
  109. #define SEEK_SET    0
  110.  
  111. /* Number of unique file names that shall be generated by "tmpnam" function
  112. */
  113. #define TMP_MAX     0xFFFF
  114.  
  115.  
  116. #if !defined(__FLAT__)
  117.  
  118. /* Definition of the control structure for streams
  119. */
  120. typedef struct  {
  121.         int             level;          /* fill/empty level of buffer */
  122.         unsigned        flags;          /* File status flags          */
  123.         char            fd;             /* File descriptor            */
  124.         unsigned char   hold;           /* Ungetc char if no buffer   */
  125.         int             bsize;          /* Buffer size                */
  126.         unsigned char   _FAR *buffer;   /* Data transfer buffer       */
  127.         unsigned char   _FAR *curp;     /* Current active pointer     */
  128.         unsigned        istemp;         /* Temporary file indicator   */
  129.         short           token;          /* Used for validity checking */
  130. }       FILE;                           /* This is the FILE object    */
  131.  
  132. /* Number of files that can be open simultaneously
  133. */
  134. #if defined(__STDC__)
  135. #define FOPEN_MAX (_NFILE_ - 2) /* (_NFILE_ - stdaux & stdprn) */
  136. #else
  137. #define FOPEN_MAX (_NFILE_)     /* Able to have 20 files */
  138. #define SYS_OPEN  (_NFILE_)
  139. #endif
  140.  
  141. #define FILENAME_MAX 80
  142.  
  143. /* Standard I/O predefined streams
  144. */
  145.  
  146. #if !defined( _RTLDLL )
  147. extern  FILE    _RTLENTRY _streams[];
  148. extern  unsigned    _RTLENTRY _nfile;
  149.  
  150. #define stdin   (&_streams[0])
  151. #define stdout  (&_streams[1])
  152. #define stderr  (&_streams[2])
  153. #define stdaux  (&_streams[3])
  154. #define stdprn  (&_streams[4])
  155.  
  156. #else
  157.  
  158. #ifdef __cplusplus
  159. extern "C" {
  160. #endif
  161. FILE far * far _RTLENTRY __getStream(int);
  162. #ifdef __cplusplus
  163. }
  164. #endif
  165.  
  166. #define stdin   __getStream(0)
  167. #define stdout  __getStream(1)
  168. #define stderr  __getStream(2)
  169.  
  170. #endif  /* _RTLDLL  */
  171.  
  172. #ifdef __cplusplus
  173. extern "C" {
  174. #endif
  175. void    _RTLENTRY          clearerr(FILE _FAR *__stream);
  176. int     _RTLENTRY _EXPFUNC fclose(FILE _FAR *__stream);
  177. int     _RTLENTRY _EXPFUNC fflush(FILE _FAR *__stream);
  178. int     _RTLENTRY _EXPFUNC fgetc(FILE _FAR *__stream);
  179. int     _RTLENTRY          fgetpos(FILE _FAR *__stream, fpos_t _FAR *__pos);
  180. char   _FAR *_RTLENTRY _EXPFUNC fgets(char _FAR *__s, int __n, FILE _FAR *__stream);
  181. FILE   _FAR *_RTLENTRY _EXPFUNC fopen(const char _FAR *__path, const char _FAR *__mode);
  182. int     _RTLENTRY _EXPFUNC fprintf(FILE _FAR *__stream, const char _FAR *__format, ...);
  183. int     _RTLENTRY _EXPFUNC fputc(int __c, FILE _FAR *__stream);
  184. int     _RTLENTRY _EXPFUNC fputs(const char _FAR *__s, FILE _FAR *__stream);
  185. size_t  _RTLENTRY _EXPFUNC fread(void _FAR *__ptr, size_t __size, size_t __n,
  186.                      FILE _FAR *__stream);
  187. FILE   _FAR *_RTLENTRY _EXPFUNC freopen(const char _FAR *__path, const char _FAR *__mode,
  188.                             FILE _FAR *__stream);
  189. int     _RTLENTRY _EXPFUNC fscanf(FILE _FAR *__stream, const char _FAR *__format, ...);
  190. int     _RTLENTRY _EXPFUNC fseek(FILE _FAR *__stream, long __offset, int __whence);
  191. int     _RTLENTRY          fsetpos(FILE _FAR *__stream, const fpos_t _FAR *__pos);
  192. long    _RTLENTRY _EXPFUNC ftell(FILE _FAR *__stream);
  193. size_t  _RTLENTRY _EXPFUNC fwrite(const void _FAR *__ptr, size_t __size, size_t __n,
  194.                       FILE _FAR *__stream);
  195. char   _FAR *_RTLENTRY     gets(char _FAR *__s);
  196. void    _RTLENTRY          perror(const char _FAR *__s);
  197. int     _RTLENTRY          printf(const char _FAR *__format, ...);
  198. int     _RTLENTRY          puts(const char _FAR *__s);
  199. int     _RTLENTRYF         remove(const char _FAR *__path);
  200. int     _RTLENTRYF _EXPFUNC rename(const char _FAR *__oldname,const char _FAR *__newname);
  201. void    _RTLENTRY _EXPFUNC rewind(FILE _FAR *__stream);
  202. int     _RTLENTRY          scanf(const char _FAR *__format, ...);
  203. void    _RTLENTRY          setbuf(FILE _FAR *__stream, char _FAR *__buf);
  204. int     _RTLENTRY _EXPFUNC setvbuf(FILE _FAR *__stream, char _FAR *__buf,
  205.                                    int __type, size_t __size);
  206. int     _RTLENTRY _EXPFUNC sprintf(char _FAR *__buffer, const char _FAR *__format, ...);
  207. int     _RTLENTRY _EXPFUNC sscanf(const char _FAR *__buffer,
  208.                                   const char _FAR *__format, ...);
  209. char   _FAR *_RTLENTRY _EXPFUNC strerror(int __errnum);
  210. FILE   _FAR *_RTLENTRY _EXPFUNC tmpfile(void);
  211. char   _FAR *_RTLENTRY _EXPFUNC tmpnam(char _FAR *__s);
  212. int     _RTLENTRY _EXPFUNC ungetc(int __c, FILE _FAR *__stream);
  213. int     _RTLENTRY _EXPFUNC vfprintf(FILE _FAR *__stream, const char _FAR *__format,
  214.                                     void _FAR *__arglist);
  215. int     _RTLENTRY _EXPFUNC vfscanf(FILE _FAR *__stream, const char _FAR *__format,
  216.                                    void _FAR *__arglist);
  217. int     _RTLENTRYF         vprintf(const char _FAR *__format, void _FAR *__arglist);
  218. int     _RTLENTRY          vscanf(const char _FAR *__format, void _FAR *__arglist);
  219. int     _RTLENTRY _EXPFUNC vsprintf(char _FAR *__buffer, const char _FAR *__format,
  220.                                     void _FAR *__arglist);
  221. int     _RTLENTRY _EXPFUNC vsscanf(const char _FAR *__buffer, const char _FAR *__format,
  222.                                    void _FAR *__arglist);
  223. int     _RTLENTRYF         unlink(const char _FAR *__path);
  224. int     _RTLENTRY          getc(FILE _FAR *__fp);
  225.  
  226. int     _RTLENTRY          getchar(void);
  227. int     _RTLENTRY          putchar(const int __c);
  228.  
  229. int     _RTLENTRY          putc(const int __c, FILE _FAR *__fp);
  230. int     _RTLENTRY          feof(FILE _FAR *__fp);
  231. int     _RTLENTRY          ferror(FILE _FAR *__fp);
  232. int     _RTLENTRY          fileno(FILE _FAR *__fp);
  233.  
  234. FILE    _FAR *_RTLENTRY _EXPFUNC fdopen(int __handle, char _FAR *__type);
  235. int     _RTLENTRY _EXPFUNC fgetchar(void);
  236. int     _RTLENTRY _EXPFUNC flushall(void);
  237. int     _RTLENTRY _EXPFUNC fcloseall(void);
  238. int     _RTLENTRY _EXPFUNC fputchar(int __c);
  239. FILE    _FAR * _RTLENTRY   _fsopen (const char _FAR *__path, const char _FAR *__mode,
  240.                   int __shflag);
  241. int     _RTLENTRY          getw(FILE _FAR *__stream);
  242. int     _RTLENTRY          putw(int __w, FILE _FAR *__stream);
  243. int     _RTLENTRY          rmtmp(void);
  244. char    _FAR * _RTLENTRY _EXPFUNC _strerror(const char _FAR *__s);
  245. char    _FAR * _RTLENTRY _EXPFUNC tempnam(char _FAR *__dir, char _FAR *__pfx);
  246.  
  247. int      _RTLENTRY _EXPFUNC _fgetc(FILE _FAR *__stream);           /* used by getc() macro */
  248. int      _RTLENTRY _EXPFUNC _fputc(char __c, FILE _FAR *__stream); /* used by putc() macro */
  249. void     _RTLENTRY _InitEasyWin(void);  /* Initialization call for Easy Windows */
  250.  
  251. #ifdef  __cplusplus
  252. }
  253. #endif   /* __cplusplus */
  254.  
  255. #else    /* defined __FLAT__ */
  256.  
  257. /* Definition of the control structure for streams
  258. */
  259. typedef struct  {
  260.         unsigned char  *curp;       /* Current active pointer     */
  261.         unsigned char  *buffer;     /* Data transfer buffer       */
  262.         int             level;      /* fill/empty level of buffer */
  263.         int             bsize;      /* Buffer size                */
  264.         unsigned short  istemp;     /* Temporary file indicator   */
  265.         unsigned short  flags;      /* File status flags          */
  266.         wchar_t         hold;       /* Ungetc char if no buffer   */
  267.         char            fd;         /* File descriptor            */
  268.         unsigned char   token;      /* Used for validity checking */
  269. }       FILE;                       /* This is the FILE object    */
  270.  
  271. /* Number of files that can be open simultaneously
  272. */
  273. #if defined(__STDC__)
  274. #define FOPEN_MAX (_NFILE_)
  275. #else
  276. #define FOPEN_MAX (_NFILE_)
  277. #define SYS_OPEN  (_NFILE_)
  278. #endif
  279.  
  280. #define FILENAME_MAX 260
  281.  
  282. /* Standard I/O predefined streams
  283. */
  284. extern  FILE        _RTLENTRY _EXPDATA _streams[];
  285. extern  unsigned    _RTLENTRY _EXPDATA _nfile;
  286.  
  287. #define stdin   (&_streams[0])
  288. #define stdout  (&_streams[1])
  289. #define stderr  (&_streams[2])
  290.  
  291. #ifdef __cplusplus
  292. extern "C" {
  293. #endif
  294. /* __getStream() is used internally with CG only, but prototyped here for
  295.   consistancy with the 16-bit version.
  296. */
  297. FILE * _RTLENTRY _EXPFUNC __getStream( int );
  298. #ifdef __cplusplus
  299. }
  300. #endif
  301.  
  302.  
  303. #ifdef __cplusplus
  304. extern "C" {
  305. #endif
  306. void    _RTLENTRY _EXPFUNC clearerr(FILE * __stream);
  307. int     _RTLENTRY _EXPFUNC fclose(FILE * __stream);
  308. int     _RTLENTRY _EXPFUNC fflush(FILE * __stream);
  309. int     _RTLENTRY _EXPFUNC fgetc(FILE * __stream);
  310. wint_t  _RTLENTRY _EXPFUNC fgetwc(FILE * __stream);
  311. int     _RTLENTRY _EXPFUNC fgetpos(FILE * __stream, fpos_t*__pos);
  312. char  * _RTLENTRY _EXPFUNC fgets(char * __s, int __n, FILE * __stream);
  313. wchar_t* _RTLENTRY _EXPFUNC fgetws(wchar_t * __s, int __n, FILE * __stream);
  314. FILE  * _RTLENTRY _EXPFUNC fopen(const char * __path, const char * __mode);
  315. FILE  * _RTLENTRY _EXPFUNC _wfopen(const wchar_t * __path, const wchar_t * __mode);
  316. int     _RTLENTRY _EXPFUNC fprintf(FILE * __stream, const char * __format, ...);
  317. int     _RTLENTRY _EXPFUNC fwprintf(FILE * __stream, const wchar_t *__format, ...);
  318. int     _RTLENTRY _EXPFUNC fputc(int __c, FILE * __stream);
  319. wint_t  _RTLENTRY _EXPFUNC fputwc(wint_t __c, FILE * __stream);
  320. int     _RTLENTRY _EXPFUNC fputs(const char * __s, FILE * __stream);
  321. int     _RTLENTRY _EXPFUNC fputws(const wchar_t * __s, FILE * __stream);
  322. size_t  _RTLENTRY _EXPFUNC fread(void * __ptr, size_t __size, size_t __n,
  323.                                  FILE * __stream);
  324. FILE  * _RTLENTRY _EXPFUNC freopen(const char * __path, const char * __mode,
  325.                                    FILE * __stream);
  326. FILE  * _RTLENTRY _EXPFUNC _wfreopen(const wchar_t * __path, const wchar_t * __mode,
  327.                                    FILE * __stream);
  328. int     _RTLENTRY _EXPFUNC fscanf(FILE * __stream, const char * __format, ...);
  329. int     _RTLENTRY _EXPFUNC fwscanf(FILE *__stream, const wchar_t *__format, ...);
  330. int     _RTLENTRY _EXPFUNC fseek(FILE * __stream, long __offset, int __whence);
  331. int     _RTLENTRY _EXPFUNC fsetpos(FILE * __stream, const fpos_t*__pos);
  332. long    _RTLENTRY _EXPFUNC ftell(FILE * __stream);
  333. size_t  _RTLENTRY _EXPFUNC fwrite(const void * __ptr, size_t __size, size_t __n,
  334.                             FILE * __stream);
  335. char  * _RTLENTRY _EXPFUNC gets(char * __s);
  336. wchar_t* _RTLENTRY _EXPFUNC _getws(wchar_t * __s);
  337.  
  338. #if defined(__OS2__) || defined(__WIN32__)
  339. int     _RTLENTRY _EXPFUNC _pclose(FILE *__stream);
  340. #endif
  341.  
  342. void    _RTLENTRY _EXPFUNC perror(const char * __s);
  343. void    _RTLENTRY _EXPFUNC _wperror(const wchar_t * __s);
  344.  
  345. #if defined(__OS2__) || defined(__WIN32__)
  346. FILE *  _RTLENTRY _EXPFUNC _popen(const char * __command, const char * __mode);
  347. #endif
  348. #if defined(__WIN32__)
  349. FILE *  _RTLENTRY _EXPFUNC _wpopen(const wchar_t * __command,
  350.                                    const wchar_t * __mode);
  351. #endif
  352.  
  353. int     _RTLENTRY _EXPFUNC printf(const char * __format, ...);
  354. int     _RTLENTRY _EXPFUNC wprintf(const wchar_t * __format, ...);
  355. int     _RTLENTRY _EXPFUNC puts(const char * __s);
  356. int     _RTLENTRY _EXPFUNC _putws(const wchar_t * __s);
  357.  
  358. int     _RTLENTRYF _EXPFUNC remove(const char * __path);
  359. int     _RTLENTRYF _EXPFUNC _wremove(const wchar_t * __path);
  360. int     _RTLENTRYF _EXPFUNC rename(const char * __oldname,const char * __newname);
  361. int     _RTLENTRYF _EXPFUNC _wrename(const wchar_t * __oldname,const wchar_t * __newname);
  362. void    _RTLENTRY  _EXPFUNC rewind(FILE * __stream);
  363. int     _RTLENTRY  _EXPFUNC scanf(const char * __format, ...);
  364. int     _RTLENTRY  _EXPFUNC wscanf(const wchar_t * __format, ...);
  365. void    _RTLENTRY  _EXPFUNC setbuf(FILE * __stream, char * __buf);
  366. int     _RTLENTRY  _EXPFUNC setvbuf(FILE * __stream, char * __buf,
  367.                                     int __type, size_t __size);
  368. int     _RTLENTRY  _EXPFUNC sprintf(char * __buffer, const char * __format, ...);
  369. int     _RTLENTRY  _EXPFUNC swprintf(wchar_t * __buffer, const wchar_t * __format, ...);
  370.  
  371. int     _RTLENTRY  _EXPFUNC sscanf(const char * __buffer,
  372.                                    const char * __format, ...);
  373. int     _RTLENTRY  _EXPFUNC swscanf(const wchar_t * __buffer,
  374.                                    const wchar_t * __format, ...);
  375. char  * _RTLENTRY _EXPFUNC strerror(int __errnum);
  376. FILE  * _RTLENTRY _EXPFUNC tmpfile(void);
  377. char  * _RTLENTRY _EXPFUNC tmpnam(char * __s);
  378. wchar_t * _RTLENTRY _EXPFUNC _wtmpnam(wchar_t * __s);
  379. int     _RTLENTRY _EXPFUNC ungetc(int __c, FILE * __stream);
  380. wint_t  _RTLENTRY _EXPFUNC ungetwc(wint_t __c, FILE * __stream);
  381. int     _RTLENTRY _EXPFUNC vfprintf(FILE * __stream, const char * __format,
  382.                             void * __arglist);
  383. int     _RTLENTRY _EXPFUNC vfscanf(FILE * __stream, const char * __format,
  384.                             void * __arglist);
  385. int     _RTLENTRYF _EXPFUNC vprintf(const char * __format, void * __arglist);
  386. int     _RTLENTRY _EXPFUNC vscanf(const char * __format, void * __arglist);
  387. int     _RTLENTRY _EXPFUNC vsprintf(char * __buffer, const char * __format,
  388.                         void * __arglist);
  389. int     _RTLENTRY _EXPFUNC vsscanf(const char * __buffer, const char * __format,
  390.                         void * __arglist);
  391. int     _RTLENTRY _EXPFUNC vfwprintf(FILE * __stream, const wchar_t * __format,
  392.                             void * __arglist);
  393. int     _RTLENTRY _EXPFUNC vfwscanf(FILE * __stream, const wchar_t * __format,
  394.                             void * __arglist);
  395. int     _RTLENTRY _EXPFUNC vwprintf(const wchar_t * __format, void * __arglist);
  396. int     _RTLENTRY _EXPFUNC vwscanf(const wchar_t * __format, void * __arglist);
  397. int     _RTLENTRY _EXPFUNC vswprintf(wchar_t * __buffer, const wchar_t * __format,
  398.                         void * __arglist);
  399. int     _RTLENTRY _EXPFUNC vswscanf(const wchar_t * __buffer, const wchar_t * __format,
  400.                         void * __arglist);
  401. int     _RTLENTRY _EXPFUNC _unlink(const char * __path);
  402. int     _RTLENTRY _EXPFUNC _wunlink(const wchar_t * __path);
  403.  
  404. int     _RTLENTRY _EXPFUNC getc(FILE * __fp);
  405. wint_t  _RTLENTRY _EXPFUNC getwc(FILE * __fp);
  406. int     _RTLENTRY _EXPFUNC getchar(void);
  407. wint_t  _RTLENTRY _EXPFUNC getwchar(void);
  408. int     _RTLENTRY _EXPFUNC putchar(const int __c);
  409. wint_t  _RTLENTRY _EXPFUNC putwchar(const wint_t __c);
  410. int     _RTLENTRY _EXPFUNC putc(const int __c, FILE * __fp);
  411. wint_t  _RTLENTRY _EXPFUNC putwc(const wint_t __c, FILE * __fp);
  412. int     _RTLENTRY _EXPFUNC feof(FILE * __fp);
  413. int     _RTLENTRY _EXPFUNC ferror(FILE * __fp);
  414. int     _RTLENTRY _EXPFUNC _fileno(FILE _FAR *__fp);
  415. int     _RTLENTRY _EXPFUNC _flushall(void);
  416. int     _RTLENTRY _EXPFUNC _fcloseall(void);
  417. FILE  * _RTLENTRY _EXPFUNC _fdopen(int __handle, char * __type);
  418. FILE  * _RTLENTRY _EXPFUNC _wfdopen(int __handle, wchar_t * __type);
  419. int     _RTLENTRY _EXPFUNC _fgetchar(void);
  420. wint_t  _RTLENTRY _EXPFUNC _fgetwchar(void);
  421. int     _RTLENTRY _EXPFUNC _fputchar(int __c);
  422. wint_t  _RTLENTRY _EXPFUNC _fputwchar(wint_t __c);
  423. FILE  * _RTLENTRY _EXPFUNC _fsopen (const char * __path, const char * __mode, int __shflag);
  424. FILE  * _RTLENTRY _EXPFUNC _wfsopen (const wchar_t * __path,
  425.                               const wchar_t * __mode, int __shflag);
  426. #ifdef __IN_SOPEN
  427. int  _RTLENTRY  _EXPFUNC _sopen ();
  428. #else
  429. int  _RTLENTRY  _EXPFUNC _sopen (const char *__path, int __access, int __shflag,
  430.                       ... /* unsigned mode */);
  431. #endif
  432. int  _RTLENTRY  _EXPFUNC32 _wsopen (const wchar_t *__path, int __access, int __shflag,
  433.                       ... /* unsigned mode */);
  434. int     _RTLENTRY _EXPFUNC _getw(FILE * __stream);
  435. int     _RTLENTRY _EXPFUNC _putw(int __w, FILE * __stream);
  436. int     _RTLENTRY _EXPFUNC _rmtmp(void);
  437. char  * _RTLENTRY _EXPFUNC _strerror(const char * __s);
  438. char  * _RTLENTRY _EXPFUNC _tempnam(char * __dir, char * __pfx);
  439. wchar_t * _RTLENTRY _EXPFUNC _wtempnam(wchar_t * __dir, wchar_t * __pfx);
  440.  
  441. int      _RTLENTRY _EXPFUNC _fgetc(FILE * __stream);           /* used by getc() macro */
  442. wint_t   _RTLENTRY _EXPFUNC _fgetwc(FILE * __stream);
  443. int      _RTLENTRY _EXPFUNC _fputc(char __c, FILE * __stream); /* used by putc() macro */
  444. wint_t   _RTLENTRY _EXPFUNC _fputwc(wchar_t __c, FILE * __stream);
  445.  
  446. #if !defined(__STDC__)
  447. int     _RTLENTRY _EXPFUNC flushall(void);
  448. FILE  * _RTLENTRY _EXPFUNC fdopen(int __handle, char * __type);
  449. int     _RTLENTRY _EXPFUNC fputchar(int __c);
  450. int     _RTLENTRY _EXPFUNC fgetchar(void);
  451. int     _RTLENTRY _EXPFUNC fileno(FILE * __fp);
  452. int     _RTLENTRY _EXPFUNC fcloseall(void);
  453. char  * _RTLENTRY _EXPFUNC tempnam(char * __dir, char * __pfx);
  454. int     _RTLENTRY _EXPFUNC rmtmp(void);
  455. int     _RTLENTRY _EXPFUNC unlink(const char * __path);
  456. int     _RTLENTRY _EXPFUNC getw(FILE * __stream);
  457. int     _RTLENTRY _EXPFUNC putw(int __w, FILE * __stream);
  458. int     _RTLENTRY _EXPFUNC sopen (const char *__path, int __access, int __shflag,
  459.                       ... /* unsigned mode */);
  460. #endif
  461.  
  462. #ifdef  __cplusplus
  463. }
  464. #endif
  465. #endif  /* __FLAT__ */
  466.  
  467. /*  The following macros provide for common functions */
  468.  
  469. #if !defined(__CODEGUARD__)
  470.  
  471. #define ferror(f)   ((f)->flags & _F_ERR)
  472. #define feof(f)     ((f)->flags & _F_EOF)
  473. #define fileno(f)   ((f)->fd)
  474. #define _fileno(f)   ((f)->fd)
  475.  
  476. #define getc(f) \
  477.   ((--((f)->level) >= 0) ? (unsigned char)(*(f)->curp++) : \
  478.     _fgetc (f))
  479.  
  480. #define putc(c,f) \
  481.   ((++((f)->level) < 0) ? (unsigned char)(*(f)->curp++=(c)) : \
  482.     _fputc ((c),f))
  483.  
  484. #define getchar()   getc(stdin)
  485. #define getwchar()  getwc(stdin)
  486. #define putchar(c)  putc((c), stdout)
  487. #define putwchar(c) putwc((c), stdout)
  488.  
  489. #endif
  490.  
  491. #define ungetc(c,f) ungetc((c),f)   /* traditionally a macro */
  492.  
  493. #if !defined(RC_INVOKED)
  494.  
  495. /* restore default packing */
  496. #pragma pack(pop)
  497.  
  498. #if defined(__STDC__)
  499. #pragma warn .nak
  500. #endif
  501.  
  502. #endif  /* !RC_INVOKED */
  503.  
  504.  
  505. #endif  /* __STDIO_H */
  506.