home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 May / VPR9705A.ISO / VPR_DATA / PROGRAM / CBTRIAL / SETUP / DATA.Z / STDIO.H < prev    next >
C/C++ Source or Header  |  1997-02-14  |  21KB  |  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.20  $ */
  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 fputchar(int __c);
  238. FILE    _FAR * _RTLENTRY   _fsopen (const char _FAR *__path, const char _FAR *__mode,
  239.                   int __shflag);
  240. int     _RTLENTRY          getw(FILE _FAR *__stream);
  241. int     _RTLENTRY          putw(int __w, FILE _FAR *__stream);
  242. int     _RTLENTRY          rmtmp(void);
  243. char    _FAR * _RTLENTRY _EXPFUNC _strerror(const char _FAR *__s);
  244. char    _FAR * _RTLENTRY _EXPFUNC tempnam(char _FAR *__dir, char _FAR *__pfx);
  245.  
  246. int      _RTLENTRY _EXPFUNC _fgetc(FILE _FAR *__stream);           /* used by getc() macro */
  247. int      _RTLENTRY _EXPFUNC _fputc(char __c, FILE _FAR *__stream); /* used by putc() macro */
  248. void     _RTLENTRY _InitEasyWin(void);  /* Initialization call for Easy Windows */
  249.  
  250. #ifdef  __cplusplus
  251. }
  252. #endif   /* __cplusplus */
  253.  
  254. #else    /* defined __FLAT__ */
  255.  
  256. /* Definition of the control structure for streams
  257. */
  258. typedef struct  {
  259.         unsigned char  *curp;       /* Current active pointer     */
  260.         unsigned char  *buffer;     /* Data transfer buffer       */
  261.         int             level;      /* fill/empty level of buffer */
  262.         int             bsize;      /* Buffer size                */
  263.         unsigned short  istemp;     /* Temporary file indicator   */
  264.         unsigned short  flags;      /* File status flags          */
  265.         wchar_t         hold;       /* Ungetc char if no buffer   */
  266.         char            fd;         /* File descriptor            */
  267.         unsigned char   token;      /* Used for validity checking */
  268. }       FILE;                       /* This is the FILE object    */
  269.  
  270. /* Number of files that can be open simultaneously
  271. */
  272. #if defined(__STDC__)
  273. #define FOPEN_MAX (_NFILE_)
  274. #else
  275. #define FOPEN_MAX (_NFILE_)
  276. #define SYS_OPEN  (_NFILE_)
  277. #endif
  278.  
  279. #define FILENAME_MAX 260
  280.  
  281. /* Standard I/O predefined streams
  282. */
  283. extern  FILE        _RTLENTRY _EXPDATA _streams[];
  284. extern  unsigned    _RTLENTRY _EXPDATA _nfile;
  285.  
  286. #define stdin   (&_streams[0])
  287. #define stdout  (&_streams[1])
  288. #define stderr  (&_streams[2])
  289.  
  290. #ifdef __cplusplus
  291. extern "C" {
  292. #endif
  293. /* __getStream() is used internally with CG only, but prototyped here for
  294.   consistancy with the 16-bit version.
  295. */
  296. FILE * _RTLENTRY _EXPFUNC __getStream( int );
  297. #ifdef __cplusplus
  298. }
  299. #endif
  300.  
  301.  
  302. #ifdef __cplusplus
  303. extern "C" {
  304. #endif
  305. void    _RTLENTRY _EXPFUNC clearerr(FILE * __stream);
  306. int     _RTLENTRY _EXPFUNC fclose(FILE * __stream);
  307. int     _RTLENTRY _EXPFUNC fflush(FILE * __stream);
  308. int     _RTLENTRY _EXPFUNC fgetc(FILE * __stream);
  309. wint_t  _RTLENTRY _EXPFUNC fgetwc(FILE * __stream);
  310. int     _RTLENTRY _EXPFUNC fgetpos(FILE * __stream, fpos_t*__pos);
  311. char  * _RTLENTRY _EXPFUNC fgets(char * __s, int __n, FILE * __stream);
  312. wchar_t* _RTLENTRY _EXPFUNC fgetws(wchar_t * __s, int __n, FILE * __stream);
  313. FILE  * _RTLENTRY _EXPFUNC fopen(const char * __path, const char * __mode);
  314. FILE  * _RTLENTRY _EXPFUNC _wfopen(const wchar_t * __path, const wchar_t * __mode);
  315. int     _RTLENTRY _EXPFUNC fprintf(FILE * __stream, const char * __format, ...);
  316. int     _RTLENTRY _EXPFUNC fwprintf(FILE * __stream, const wchar_t *__format, ...);
  317. int     _RTLENTRY _EXPFUNC fputc(int __c, FILE * __stream);
  318. wint_t  _RTLENTRY _EXPFUNC fputwc(wint_t __c, FILE * __stream);
  319. int     _RTLENTRY _EXPFUNC fputs(const char * __s, FILE * __stream);
  320. int     _RTLENTRY _EXPFUNC fputws(const wchar_t * __s, FILE * __stream);
  321. size_t  _RTLENTRY _EXPFUNC fread(void * __ptr, size_t __size, size_t __n,
  322.                                  FILE * __stream);
  323. FILE  * _RTLENTRY _EXPFUNC freopen(const char * __path, const char * __mode,
  324.                                    FILE * __stream);
  325. FILE  * _RTLENTRY _EXPFUNC _wfreopen(const wchar_t * __path, const wchar_t * __mode,
  326.                                    FILE * __stream);
  327. int     _RTLENTRY _EXPFUNC fscanf(FILE * __stream, const char * __format, ...);
  328. int     _RTLENTRY _EXPFUNC fwscanf(FILE *__stream, const wchar_t *__format, ...);
  329. int     _RTLENTRY _EXPFUNC fseek(FILE * __stream, long __offset, int __whence);
  330. int     _RTLENTRY _EXPFUNC fsetpos(FILE * __stream, const fpos_t*__pos);
  331. long    _RTLENTRY _EXPFUNC ftell(FILE * __stream);
  332. size_t  _RTLENTRY _EXPFUNC fwrite(const void * __ptr, size_t __size, size_t __n,
  333.                             FILE * __stream);
  334. char  * _RTLENTRY _EXPFUNC gets(char * __s);
  335. wchar_t* _RTLENTRY _EXPFUNC _getws(wchar_t * __s);
  336.  
  337. #if defined(__OS2__) || defined(__WIN32__)
  338. int     _RTLENTRY _EXPFUNC _pclose(FILE *__stream);
  339. #endif
  340.  
  341. void    _RTLENTRY _EXPFUNC perror(const char * __s);
  342. void    _RTLENTRY _EXPFUNC _wperror(const wchar_t * __s);
  343.  
  344. #if defined(__OS2__) || defined(__WIN32__)
  345. FILE *  _RTLENTRY _EXPFUNC _popen(const char * __command, const char * __mode);
  346. #endif
  347. #if defined(__WIN32__)
  348. FILE *  _RTLENTRY _EXPFUNC _wpopen(const wchar_t * __command,
  349.                                    const wchar_t * __mode);
  350. #endif
  351.  
  352. int     _RTLENTRY _EXPFUNC printf(const char * __format, ...);
  353. int     _RTLENTRY _EXPFUNC wprintf(const wchar_t * __format, ...);
  354. int     _RTLENTRY _EXPFUNC puts(const char * __s);
  355. int     _RTLENTRY _EXPFUNC _putws(const wchar_t * __s);
  356.  
  357. int     _RTLENTRYF _EXPFUNC remove(const char * __path);
  358. int     _RTLENTRYF _EXPFUNC _wremove(const wchar_t * __path);
  359. int     _RTLENTRYF _EXPFUNC rename(const char * __oldname,const char * __newname);
  360. int     _RTLENTRYF _EXPFUNC _wrename(const wchar_t * __oldname,const wchar_t * __newname);
  361. void    _RTLENTRY  _EXPFUNC rewind(FILE * __stream);
  362. int     _RTLENTRY  _EXPFUNC scanf(const char * __format, ...);
  363. int     _RTLENTRY  _EXPFUNC wscanf(const wchar_t * __format, ...);
  364. void    _RTLENTRY  _EXPFUNC setbuf(FILE * __stream, char * __buf);
  365. int     _RTLENTRY  _EXPFUNC setvbuf(FILE * __stream, char * __buf,
  366.                                     int __type, size_t __size);
  367. int     _RTLENTRY  _EXPFUNC sprintf(char * __buffer, const char * __format, ...);
  368. int     _RTLENTRY  _EXPFUNC swprintf(wchar_t * __buffer, const wchar_t * __format, ...);
  369.  
  370. int     _RTLENTRY  _EXPFUNC sscanf(const char * __buffer,
  371.                                    const char * __format, ...);
  372. int     _RTLENTRY  _EXPFUNC swscanf(const wchar_t * __buffer,
  373.                                    const wchar_t * __format, ...);
  374. char  * _RTLENTRY _EXPFUNC strerror(int __errnum);
  375. FILE  * _RTLENTRY _EXPFUNC tmpfile(void);
  376. char  * _RTLENTRY _EXPFUNC tmpnam(char * __s);
  377. wchar_t * _RTLENTRY _EXPFUNC _wtmpnam(wchar_t * __s);
  378. int     _RTLENTRY _EXPFUNC ungetc(int __c, FILE * __stream);
  379. wint_t  _RTLENTRY _EXPFUNC ungetwc(wint_t __c, FILE * __stream);
  380. int     _RTLENTRY _EXPFUNC vfprintf(FILE * __stream, const char * __format,
  381.                             void * __arglist);
  382. int     _RTLENTRY _EXPFUNC vfscanf(FILE * __stream, const char * __format,
  383.                             void * __arglist);
  384. int     _RTLENTRYF _EXPFUNC vprintf(const char * __format, void * __arglist);
  385. int     _RTLENTRY _EXPFUNC vscanf(const char * __format, void * __arglist);
  386. int     _RTLENTRY _EXPFUNC vsprintf(char * __buffer, const char * __format,
  387.                         void * __arglist);
  388. int     _RTLENTRY _EXPFUNC vsscanf(const char * __buffer, const char * __format,
  389.                         void * __arglist);
  390. int     _RTLENTRY _EXPFUNC vfwprintf(FILE * __stream, const wchar_t * __format,
  391.                             void * __arglist);
  392. int     _RTLENTRY _EXPFUNC vfwscanf(FILE * __stream, const wchar_t * __format,
  393.                             void * __arglist);
  394. int     _RTLENTRY _EXPFUNC vwprintf(const wchar_t * __format, void * __arglist);
  395. int     _RTLENTRY _EXPFUNC vwscanf(const wchar_t * __format, void * __arglist);
  396. int     _RTLENTRY _EXPFUNC vswprintf(wchar_t * __buffer, const wchar_t * __format,
  397.                         void * __arglist);
  398. int     _RTLENTRY _EXPFUNC vswscanf(const wchar_t * __buffer, const wchar_t * __format,
  399.                         void * __arglist);
  400. int     _RTLENTRY _EXPFUNC _unlink(const char * __path);
  401. int     _RTLENTRY _EXPFUNC _wunlink(const wchar_t * __path);
  402.  
  403. int     _RTLENTRY _EXPFUNC getc(FILE * __fp);
  404. wint_t  _RTLENTRY _EXPFUNC getwc(FILE * __fp);
  405. int     _RTLENTRY _EXPFUNC getchar(void);
  406. wint_t  _RTLENTRY _EXPFUNC getwchar(void);
  407. int     _RTLENTRY _EXPFUNC putchar(const int __c);
  408. wint_t  _RTLENTRY _EXPFUNC putwchar(const wint_t __c);
  409. int     _RTLENTRY _EXPFUNC putc(const int __c, FILE * __fp);
  410. wint_t  _RTLENTRY _EXPFUNC putwc(const wint_t __c, FILE * __fp);
  411. int     _RTLENTRY _EXPFUNC feof(FILE * __fp);
  412. int     _RTLENTRY _EXPFUNC ferror(FILE * __fp);
  413. int     _RTLENTRY _EXPFUNC _fileno(FILE _FAR *__fp);
  414. int     _RTLENTRY _EXPFUNC _flushall(void);
  415. int     _RTLENTRY _EXPFUNC _fcloseall(void);
  416. FILE  * _RTLENTRY _EXPFUNC _fdopen(int __handle, char * __type);
  417. FILE  * _RTLENTRY _EXPFUNC _wfdopen(int __handle, wchar_t * __type);
  418. int     _RTLENTRY _EXPFUNC _fgetchar(void);
  419. wint_t  _RTLENTRY _EXPFUNC _fgetwchar(void);
  420. int     _RTLENTRY _EXPFUNC _fputchar(int __c);
  421. wint_t  _RTLENTRY _EXPFUNC _fputwchar(wint_t __c);
  422. FILE  * _RTLENTRY _EXPFUNC _fsopen (const char * __path, const char * __mode, int __shflag);
  423. FILE  * _RTLENTRY _EXPFUNC _wfsopen (const wchar_t * __path,
  424.                               const wchar_t * __mode, int __shflag);
  425. #ifdef __IN_SOPEN
  426. int  _RTLENTRY  _EXPFUNC _sopen ();
  427. #else
  428. int  _RTLENTRY  _EXPFUNC _sopen (const char *__path, int __access, int __shflag,
  429.                       ... /* unsigned mode */);
  430. #endif
  431. int  _RTLENTRY  _EXPFUNC32 _wsopen (const wchar_t *__path, int __access, int __shflag,
  432.                       ... /* unsigned mode */);
  433. int     _RTLENTRY _EXPFUNC _getw(FILE * __stream);
  434. int     _RTLENTRY _EXPFUNC _putw(int __w, FILE * __stream);
  435. int     _RTLENTRY _EXPFUNC _rmtmp(void);
  436. char  * _RTLENTRY _EXPFUNC _strerror(const char * __s);
  437. char  * _RTLENTRY _EXPFUNC _tempnam(char * __dir, char * __pfx);
  438. wchar_t * _RTLENTRY _EXPFUNC _wtempnam(wchar_t * __dir, wchar_t * __pfx);
  439.  
  440. int      _RTLENTRY _EXPFUNC _fgetc(FILE * __stream);           /* used by getc() macro */
  441. wint_t   _RTLENTRY _EXPFUNC _fgetwc(FILE * __stream);
  442. int      _RTLENTRY _EXPFUNC _fputc(char __c, FILE * __stream); /* used by putc() macro */
  443. wint_t   _RTLENTRY _EXPFUNC _fputwc(wchar_t __c, FILE * __stream);
  444.  
  445. #if !defined(__STDC__)
  446. int     _RTLENTRY _EXPFUNC flushall(void);
  447. FILE  * _RTLENTRY _EXPFUNC fdopen(int __handle, char * __type);
  448. int     _RTLENTRY _EXPFUNC fputchar(int __c);
  449. int     _RTLENTRY _EXPFUNC fgetchar(void);
  450. int     _RTLENTRY _EXPFUNC fileno(FILE * __fp);
  451. int     _RTLENTRY _EXPFUNC fcloseall(void);
  452. char  * _RTLENTRY _EXPFUNC tempnam(char * __dir, char * __pfx);
  453. int     _RTLENTRY _EXPFUNC rmtmp(void);
  454. int     _RTLENTRY _EXPFUNC unlink(const char * __path);
  455. int     _RTLENTRY _EXPFUNC getw(FILE * __stream);
  456. int     _RTLENTRY _EXPFUNC putw(int __w, FILE * __stream);
  457. int     _RTLENTRY _EXPFUNC sopen (const char *__path, int __access, int __shflag,
  458.                       ... /* unsigned mode */);
  459. #endif
  460.  
  461. #ifdef  __cplusplus
  462. }
  463. #endif
  464.  
  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.