home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_01 / TURBOC_1.LZH / INCLUDE / STDIO.H < prev    next >
Text File  |  1990-03-02  |  5KB  |  154 lines

  1. /*      STDIO.H
  2.  
  3.         Standard I/O Definition Includes
  4.  
  5.         Copyright (c) Borland International 1988
  6.         All Rights Reserved.
  7. */
  8.  
  9.  
  10. #if !defined( __STDIO )
  11. #define __STDIO
  12.  
  13.  
  14. #include <stdarg.h>
  15.  
  16.  
  17. typedef unsigned long   size_t;
  18. typedef unsigned long   fpos_t;
  19.  
  20. typedef struct
  21. {
  22.         void *BufPtr;           /* next byte write              */
  23.         void *BufLvl;           /* next byte read               */
  24.         void *BufStart;         /* first byte of buffer         */
  25.         void *BufEnd;           /* first byte after buffer      */
  26.         int  Handle;            /* gemdos handle                */
  27.         char Flags;             /* some Flags                   */
  28.         char resv;
  29.         char ChrBuf;            /* little buffer                */
  30.         char ungetFlag;
  31. } FILE;
  32.  
  33.  
  34.  
  35.  
  36. /****** FileIo constants ************************************************/
  37.  
  38. #define NULL        ( ( void * ) 0L )
  39. #define OPEN_MAX        32
  40. #define FOPEN_MAX       32
  41. #define FILENAME_MAX    119
  42. #define PATH_MAX        119
  43. #define BUFSIZ          1024
  44. #define EOF             (-1)
  45.  
  46. #define O_RDONLY    0x00
  47. #define O_WRONLY    0x01
  48. #define O_RDWR      0x02
  49. #define O_APPEND    0x08
  50. #define O_CREAT     0x20
  51. #define O_TRUNC     0x40
  52. #define O_EXCL      0x80
  53.  
  54. #define SEEK_SET    0
  55. #define SEEK_CUR    1
  56. #define SEEK_END    2
  57.  
  58. #define TMP_MAX        100
  59. #define L_tmpnam    13
  60.  
  61. #define _IOFBF      0
  62. #define _IOLBF      1
  63. #define _IONBF      2
  64.  
  65. #define stdout      (&_StdOutF)
  66. #define stdin       (&_StdInF)
  67. #define stderr      (&_StdErrF)
  68. #define stdaux      (&_StdAuxF)
  69. #define stdprn      (&_StdPrnF)
  70.  
  71. /****** External data **************************************************/
  72.  
  73. extern FILE         _StdOutF;
  74. extern FILE         _StdInF;
  75. extern FILE         _StdErrF;
  76. extern FILE         _StdAuxF;
  77. extern FILE         _StdPrnF;
  78.  
  79. extern int errno;
  80. extern char         *sys_errlist[];
  81.  
  82.  
  83. /****** FileIo routines *************************************************/
  84.  
  85. void    clearerr( FILE *stream );
  86. int     fclose( FILE *stream );
  87. int     feof( FILE *stream );
  88. int     ferror( FILE *stream );
  89. int     fflush( FILE *stream );
  90. int     fgetc( FILE *stream );
  91. int     getc( FILE *stream );
  92. int        getchar( void );
  93. int     fgetpos( FILE *stream, fpos_t *pos );
  94. char    *fgets( char *str, int n, FILE *stream );
  95. FILE    *fopen( const char *filename, const char *mode );
  96. int     fprintf( FILE *stream, const char *format, ... );
  97. int     fputc( int ch, FILE *stream );
  98. int     putc( int ch, FILE *stream );
  99. int     putchar( int c );
  100. int     fputs( const char *str, FILE *stream );
  101. size_t  fread( void *buf, size_t elem_Siz, size_t count, FILE *stream );
  102. FILE    *freopen( const char *filename, const char *mode, FILE *stream );
  103. int     fscanf( FILE *stream, const char *format, ... );
  104. int     fseek( FILE *stream, long offset, int mode );
  105. void    rewind( FILE *stream);
  106. int     fsetpos( FILE *stream, const fpos_t *pos );
  107. long    ftell( FILE *stream );
  108. size_t  fwrite( const void *buf, size_t elem_Siz, size_t count,
  109.                 FILE *stream );
  110. char    *gets( char *str );
  111. void    perror( char *s );
  112. int     printf( const char *format, ... );
  113. int     puts( const char *str );
  114. int     scanf( const char *format, ... );
  115. void    setbuf( FILE *stream, char *buf );
  116. int     setvbuf( FILE *stream, char *buf, int type, size_t size );
  117. int     sprintf( char *string, const char *format, ... );
  118. int     sscanf( char *string, const char *format, ... );
  119. char    *tmpnam( char *s );
  120. FILE    *tmpfile( void );
  121. int     ungetc( int ch, FILE *stream );
  122. int     vfprintf( FILE *stream, const char *format, va_list param );
  123. int     vprintf( const char *format, va_list param );
  124. int     vsprintf( char *string, const char *format, va_list param );
  125. int     vfscanf( FILE *stream, const char *format, va_list param );
  126. int     vscanf( const char *format, va_list param );
  127. int     vsscanf( char *string, const char *format, va_list param );
  128. int     fileno( FILE *stream );
  129.  
  130. /****** FileIo macros ***************************************************/
  131.  
  132. #define getc( c )     fgetc( c )
  133. #define getchar()     fgetc( &_StdInF )
  134. #define putc( c, s )  fputc( c, s )
  135. #define putchar( c )  fputc( c, &_StdOutF )
  136. #define fileno( s )   ( s )->Handle
  137.  
  138. /****** Handle level FileIo routines ***********************************/
  139.  
  140. int     open( const char *filename, int access, ... );
  141. int     close( int handle );
  142. int     creat( const char *filename, ... );
  143. size_t  read( int handle, void *buf, size_t nbyte );
  144. size_t  write( int handle, void *buf, size_t nbyte );
  145. size_t  lseek( int handle, size_t offset, int mode );
  146. int     remove( const char *filename );
  147. int     unlink( const char *filename );
  148. int     rename( const char *oldname, const char *newname );
  149.  
  150.  
  151. #endif
  152.  
  153. /***********************************************************************/
  154.