home *** CD-ROM | disk | FTP | other *** search
/ Hall of Fame / HallofFameCDROM.cdr / proglc / tnylib.lzh / D2IO.H < prev    next >
Encoding:
C/C++ Source or Header  |  1986-08-30  |  1.0 KB  |  47 lines

  1. /* D2IO.H - chip rabinowitz & jim kyle - 08/30/86
  2.  *    dos2 library header include file
  3.  */
  4.  
  5. typedef struct ftb {
  6.     int ugc;
  7.     char mode;
  8.     char hndl;
  9.     char ercd;
  10. } FILE;
  11. extern    FILE    _ftb[20];
  12.  
  13. #define    RDBIT    1        /* bits of MODE byte */
  14. #define    WRBIT    2
  15. #define    RAWBIT    4
  16. #define    EFBIT    8
  17. #define    ERBIT    16
  18. #define CRBIT    32
  19. #define    DIRTY    128
  20.  
  21. #define    UGC    stream->ugc
  22. #define    MODE    stream->mode
  23. #define    HNDL    stream->hndl
  24. #define    ERCD    stream->ercd
  25.  
  26. #define    stdin    (&_ftb[0])
  27. #define    stdout    (&_ftb[1])
  28. #define    stderr    (&_ftb[2])
  29. #define    stdaux    (&_ftb[3])
  30. #define    stdlst    (&_ftb[4])
  31. #define    getchar()    fgetc(stdin)
  32. #define    putchar(x)    fputc(x,stdout)
  33. #define feof(stream)    ((stream->mode&EFBIT)!=0)
  34. #define ferror(stream)    ((stream->mode&ERBIT)!=0)
  35. #define clearerr(stream) (stream->mode &= ~(EFBIT | ERBIT))
  36.  
  37. #define hdl(x) ((unsigned)(x) - (unsigned)stdin)/sizeof(FILE)
  38.  
  39. #define NULL (void *)0
  40. #define NULLP (char *)0
  41. #define NIL 0
  42. #define EOF -1
  43.  
  44. FILE *fopen(), *freopen();
  45. FILE *fdopen();
  46. long ftell();
  47.