home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / BDSC / BDSC-4 / BDSLIB.ARK / STDIO.H < prev    next >
Text File  |  1983-07-15  |  2KB  |  69 lines

  1. /* stdio.h 7/4/83 */
  2.  
  3. #define    BUFSIZ    1024
  4. #define    _NFILE    20
  5. #ifndef FILE
  6. struct    _iobuf {
  7.     int    _fd;        /* File descriptor        */
  8.     int    _nleft;        /* Bytes remaining in buffer    */
  9.     char    *_nextp;    /* Pointer to next byte        */
  10.     char    _flag;        /* Flag denoting I/O status    */
  11.     char    *_base;        /* Pointer to the I/O buffer    */
  12. } filebuf[_NFILE];
  13. #endif
  14.  
  15. #define    FILE struct _iobuf
  16. #define    SECSIZ    128
  17. #define    NSECTS    (BUFSIZ/SECSIZ)
  18.  
  19. #define NULL    0    /* Value of an empty pointer        */
  20. #define EOF    (-1)    /* Physical end of file    on stream    */
  21. #define ERROR    (-1)    /* General "on error" return value    */
  22. #define CPMEOF 0x1a    /* CP/M LOGICAL End-of-file marker    */
  23. #define MAXLINE 135    /* Longest line expected from console    */
  24. #define TRUE 1        /* General purpose true truth value    */
  25. #define FALSE 0        /* General purpose false truth value     */
  26.  
  27. #define    _IOREAD    01    /* Flag denoting stream open for read    */
  28. #define    _IOWRT    02    /* Flag denoting stream open for write    */
  29. #define    _IONBF    04    /* Flag denoting stream is unbuffered    */
  30. #define    _IOEOF    020    /* End of file has occurred on stream    */
  31. #define    _IOERR    040    /* Error status during io on stream    */
  32.  
  33. #define    stdin        0    /* Standard input channel    */
  34. #define    stdout        1    /* Standard output channel    */
  35. #define    stderr        2    /* Standard error channel    */
  36. #define    DEV_LST        3    /* List Device/Line Printer    */
  37. #define    DEV_PUN        4    /* Punch Device/Tape output    */
  38. #define    DEV_RDR        5    /* Reader Device/Tape input    */
  39.  
  40. #define    getc(f)        fgetc(f)
  41. #define    putc(c,f)    fputc(c,f)
  42. #define    feof(f)        (((f)->_flag&_IOEOF)!=0)
  43. #define ferror(f)    (((f)->_flag&_IOERR)!=0)
  44. #define    fileno(f)    ((f)->_fd)
  45. #define    isatty(f)    ((f) >= stdin && (f) <= DEV_PUN)
  46. #define    rewind(f)    (fseek((f), 0, 0))
  47. #define    clrerr(f)    (((f)->_flag&_IOERR)?((f)->_flag &=_IOERR):(0))
  48. #define    clreof(f)    (((f)->_flag&_IOEOF)?((f)->_flag &=_IOEOF):(0))
  49. #define getchar()    fgetc(stdin)
  50. #define    putchar(c)    fputc(c,stdout)
  51.  
  52. #define    void    int
  53. #define    long    int
  54.  
  55. void    fputc();
  56. FILE    *fopen();
  57. void    fflush();
  58. char    *fgets();
  59. char    *gets();
  60. void    puts();
  61. void    fputs();
  62. char    *malloc();
  63. char    *calloc();
  64. char    *realloc();
  65. void    setbuf();
  66.  
  67. #include "fcb.h"
  68. #include "malloc.h"
  69.