home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / alde_c / misc / lib / dlibssrc / io.h < prev    next >
Encoding:
C/C++ Source or Header  |  1987-10-03  |  1.8 KB  |  62 lines

  1. /*
  2.  *    IO.H        Defines for file processing and i/o functions
  3.  */
  4.  
  5. #define    remove        unlink
  6. #define    fexists(f)    access(f,_ACCe)
  7.  
  8. /* access() modes */
  9. #define    _ACCe        0x17        /* file/directory exists */
  10. #define    _ACCr        0x07        /* file can be read */
  11. #define    _ACCw        0x06        /* file can be written */
  12. #define    _ACCrw        0x06        /* file can be read and written */
  13.  
  14. /* creat() modes */
  15. #define    _CRErw        0x00        /* read/write */
  16. #define    _CREro        0x01        /* read only */
  17. #define    _CREh        0x02        /* hidden file */
  18. #define    _CREs        0x04        /* system file */
  19. #define    _CREv        0x08        /* volume label */
  20.  
  21. /* open() modes */
  22. #define _OPNr        0        /* read mode */
  23. #define _OPNw        1        /* write mode */
  24. #define _OPNrw        2        /* read/write mode */
  25.  
  26. /* lseek() origins */
  27. #define _LSKbeg        0        /* from beginning of file */
  28. #define _LSKcur        1        /* from current location */
  29. #define _LSKend        2        /* from end of file */
  30.  
  31. /* cfg_ch() flags */
  32. #define    _CIOb        0x01        /* Use BIOS level i/o calls */
  33. #define    _CIOch        0x02        /* 8-bit codes only (cf:getch) */
  34. #define    _CIOvt        0x04        /* VT-52 escape sequence processing */
  35.  
  36. /* setvbuf() modes */
  37. #define    _SVBn        0        /* no buffering */
  38. #define    _SVBf        1        /* full buffering */
  39. #define    _SVBl        1        /* line buffering (not available) */
  40.  
  41.  
  42. typedef struct {        /* STAT structure (coincidently == DTA) */
  43.     char    S_rsvd[21];        /* reserved field. DON'T TOUCH! */
  44.         char    S_mode;            /* mode flags (creat() compatable) */
  45.         int    S_time;            /* last modification time */
  46.     int    S_date;            /* last modification data */
  47.         long    S_size;            /* size of file in bytes */
  48.         char    S_name[14];        /* file name */
  49. } STAT;
  50.  
  51.  
  52. extern    char    *fullpath();
  53. extern    char    *findfile();
  54. extern    char    *pfindfile();
  55. extern    long    fsize();
  56. extern    FILE    *fopen();
  57. extern    FILE    *freopen();
  58. extern    FILE    *fdopen();
  59. extern    long    fseek();
  60. extern    char    *fgets();
  61. extern    char    *gets();
  62.