home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / source / boozshar / oozio.h < prev    next >
C/C++ Source or Header  |  1989-05-29  |  1KB  |  53 lines

  1. /* oozio.h */
  2. /* Definitions for portable I/O.
  3.  
  4. Definitions are:
  5.  
  6. OPEN(x)     open file x for read
  7. CREATE(x)   create file x for read/write
  8.  
  9. Note that files opened by OPEN() and CREATE() must be opened in
  10. binary mode (not involving any LF <-> CR/LF translation).
  11.  
  12. The contents of this file are hereby released to the public domain.
  13.                                    -- Rahul Dhesi 1987/02/08
  14. */
  15.  
  16. /* MIX C compiler for CP/M. */
  17. #ifdef   MIXC
  18. #define  CREATE(x)      (iofilter(0,0), creat (x, 0))
  19. #define  OPEN(x)        (iofilter (0,0), open (x, 0))
  20. #endif
  21.  
  22. /* Microsoft C 3.0 under MS-DOS */
  23. #ifdef   MSC
  24. #include <fcntl.h>
  25. #include <sys/types.h>
  26. #include <sys/stat.h>
  27. #include <io.h>
  28. #define  CREATE(x) \
  29.    open (x, O_CREAT|O_WRONLY|O_TRUNC|O_BINARY, S_IREAD|S_IWRITE)
  30. #define  OPEN(x)     open (x, O_RDONLY|O_BINARY)
  31. #endif
  32.  
  33. /* Turbo C 1.0 under MS-DOS */
  34. #ifdef   TURBOC
  35. #include <fcntl.h>
  36. #include <sys/types.h>
  37. #include <sys/stat.h>
  38. #include <io.h>
  39. #define  CREATE(x) \
  40.    open (x, O_CREAT|O_WRONLY|O_TRUNC|O_BINARY, S_IREAD|S_IWRITE)
  41. #define  OPEN(x)     open (x, O_RDONLY|O_BINARY)
  42. #endif
  43.  
  44. /* **IX family I/O */
  45. #ifdef   NIX_IO
  46. #include <fcntl.h>
  47. #include <sys/types.h>
  48. #include <sys/stat.h>
  49. #define  CREATE(x) \
  50.    open (x, O_CREAT|O_WRONLY|O_TRUNC, S_IREAD|S_IWRITE)
  51. #define  OPEN(x)     open (x, O_RDONLY)
  52. #endif
  53.