home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / lan / soss.arj / INCLUDE / STDIO.H < prev    next >
C/C++ Source or Header  |  1991-04-11  |  3KB  |  109 lines

  1. /*
  2.  * stdio.h
  3.  *
  4.  * defines the structure used by the level 2 I/O ("standard I/O") routines
  5.  * and some of the associated values and macros.
  6.  *
  7.  * (C)Copyright Microsoft Corporation 1984, 1985
  8.  */
  9.  
  10. #ifndef STDIO_H                /* DDP */
  11. #define STDIO_H    1            /* DDP */
  12.  
  13. #define  BUFSIZ  512
  14. #define  _NFILE  20
  15. #define  FILE    struct _iobuf
  16. #define  EOF     (-1)
  17.  
  18. #ifdef M_I86LM
  19. #define  NULL    0L
  20. #else
  21. #define  NULL    0
  22. #endif
  23.  
  24. extern FILE {
  25.     char *_ptr;
  26.     int   _cnt;
  27.     char *_base;
  28.     char  _flag;
  29.     char  _file;
  30.     } _iob[_NFILE];
  31.  
  32. #define  stdin   (&_iob[0])
  33. #define  stdout  (&_iob[1])
  34. #define  stderr  (&_iob[2])
  35. #define  stdaux  (&_iob[3])
  36. #define  stdprn  (&_iob[4])
  37.  
  38. #define  _IOREAD    0x01
  39. #define  _IOWRT     0x02
  40. #define  _IONBF     0x04
  41. #define  _IOMYBUF   0x08
  42. #define  _IOEOF     0x10
  43. #define  _IOERR     0x20
  44. #define  _IOSTRG    0x40
  45. #define  _IORW      0x80
  46.  
  47. #define  getc(f)    (--(f)->_cnt >= 0 ? 0xff & *(f)->_ptr++ : _filbuf(f))
  48. /* #define  putc(c,f)  (--(f)->_cnt >= 0 ? 0xff & (*(f)->_ptr++ = (c)) : \
  49.              _flsbuf((c),(f)))        DDP */
  50.  
  51. #define  getchar()   getc(stdin)
  52. #define  putchar(c)  putc((c),stdout)
  53.  
  54. #define  feof(f)     ((f)->_flag & _IOEOF)
  55. #define  ferror(f)   ((f)->_flag & _IOERR)
  56. #define  fileno(f)   ((f)->_file)
  57.  
  58. /* function declarations for those who want strong type checking
  59.  * on arguments to library function calls
  60.  */
  61.  
  62. #ifdef LINT_ARGS        /* arg. checking enabled */
  63.  
  64. void clearerr(FILE *);
  65. int fclose(FILE *);
  66. int fcloseall(void);
  67. FILE *fdopen(int, char *);
  68. int fflush(FILE *);
  69. int fgetc(FILE *);
  70. int fgetchar(void);
  71. char *fgets(char *, int, FILE *);
  72. int flushall(void);
  73. FILE *fopen(char *, char *);
  74. int fprintf(FILE *, char *, );
  75. int fputc(int, FILE *);
  76. int fputchar(int);
  77. int fputs(char *, FILE *);
  78. int fread(char *, int, int, FILE *);
  79. FILE *freopen(char *, char *, FILE *);
  80. int fscanf(FILE *, char *, );
  81. int fseek(FILE *, long, int);
  82. long ftell(FILE *);
  83. int fwrite(char *, int, int, FILE *);
  84. char *gets(char *);
  85. int getw(FILE *);
  86. int printf(char *, );
  87. int puts(char *);
  88. int putw(int, FILE *);
  89. int rewind(FILE *);
  90. int scanf(char *, );
  91. void setbuf(FILE *, char *);
  92. int sprintf(char *, char *, );
  93. int sscanf(char *, char *, );
  94. int ungetc(int, FILE *);
  95.  
  96. #else            /* arg. checking disabled - declare return type */
  97.  
  98. extern FILE *fopen(), *freopen(), *fdopen();
  99. extern long ftell();
  100. extern char *gets(), *fgets();
  101.  
  102. #endif    /* LINT_ARGS */
  103.  
  104. /* DDP - Added for PCIP code */
  105. #define    TRUE        1
  106. #define    FALSE        0
  107. #define cfree(x)    free(x)
  108. #endif                    /* DDP */
  109.