home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / compress / zoosrc20.zoo / portable.h < prev    next >
C/C++ Source or Header  |  1989-07-25  |  3KB  |  110 lines

  1. /* @(#) portable.h 2.3 87/12/26 12:25:49 */
  2. /* @(#) portable.h 2.4 88/08/24 00:56:43 */
  3.  
  4. /* Definitions for portable I/O
  5.  
  6. The contents of this file are hereby released to the public domain.
  7.  
  8.                            -- Rahul Dhesi 1986/11/14
  9.  
  10.  
  11.  
  12.                        DEFINITIONS IN THIS FILE
  13.  
  14. Symbols:
  15.  
  16. Z_WRITE, Z_READ, and Z_RDWR are the parameters to supply to zooopen()
  17. and to open an existing file for write, read, and read-write 
  18. respectively.  Z_NEW is the parameter to supply to zoocreate() to
  19. open an existing file or create a new file for write and read.  The
  20. file must be opened in binary format, with no newline translation of
  21. any kind.
  22.  
  23. Macros or functions:
  24.  
  25. zgetc(x) reads a character from ZOOFILE x.
  26. zputchar(c) writes a character c to standard output.
  27. MKDIR(x) creates a directory x.
  28. */
  29.  
  30. /* Borland's Turbo C. */
  31. #ifdef   TURBOC
  32. /* options for zooopen(), zoocreate() */
  33. #define  Z_WRITE        "r+b"
  34. #define  Z_READ         "rb"
  35. #define  Z_RDWR         "r+b"
  36. #define    Z_NEW                "w+b"
  37. #define    zgetc(x)            getc(x)
  38. #define    zputchar(c)        putchar(c)
  39. #define  MKDIR(x)       mkdir(x)
  40. int mkdir (char *);
  41. #endif
  42.  
  43. /* Microsoft C 3.0 */
  44. #ifdef   MSC
  45. /* options for zooopen(), zoocreate() */
  46. #define  Z_WRITE        "r+b"
  47. #define  Z_READ         "rb"
  48. #define  Z_RDWR         "r+b"
  49. #define    Z_NEW                "w+b"
  50. #define    zgetc(x)            getc(x)
  51. #define    zputchar(c)        putchar(c)
  52. #define  MKDIR(x)       mkdir(x)
  53. int mkdir (char *);
  54. #endif
  55.  
  56. #ifdef VMS
  57. #define Z_WRITE        "r+"
  58. #define Z_READ            "r"
  59. #define Z_RDWR            "r+"
  60. #define    Z_NEW            "w+b"
  61. #define zgetc(x)    getc(x)
  62. #define zputchar(c)    putchar(c)
  63. #define MKDIR(x)    vmsmkdir (x, 0)
  64. #endif
  65.  
  66. /* Datalight C. */
  67. #ifdef     DLC
  68. #endif
  69.  
  70.  
  71. #ifdef GENERIC
  72. /* **IX I/O, but MKDIR() is a no-operation */
  73. #define  NIX_IO      /* standard **IX I/O */
  74. #define  MKDIR(x)
  75. #endif
  76.  
  77. /* **IX System V release 2.1 */
  78. #ifdef   SYS_V
  79. #define  NIX_IO      /* standard **IX I/O */
  80. #define  MKDIR(x)       mkdir(x) /* define this in sysv.c */
  81. #endif
  82.  
  83. /* Xenix */
  84. #ifdef   XENIX
  85. #define  NIX_IO      /* standard **IX I/O */
  86. #endif
  87.  
  88. /* 4.3BSD */
  89. #ifdef BSD4_3
  90. #define NIX_IO       /* standard **IX I/O */
  91. #define  MKDIR(x)       mkdir(x, 0777)
  92. #endif
  93.  
  94. /* Amiga */
  95. #ifdef MCH_AMIGA
  96. #define MKDIR(x)        /* something is needed here */
  97. #define NIX_IO
  98. #endif
  99.  
  100. /* Standard **IX I/O definitions */
  101. #ifdef   NIX_IO
  102. /* options for zooopen(), zoocreate() */
  103. #define  Z_WRITE        "r+"
  104. #define  Z_READ         "r"
  105. #define  Z_RDWR         "r+"
  106. #define    Z_NEW                "w+"
  107. #define    zgetc(x)            getc(x)
  108. #define    zputchar(c)        putchar(c)
  109. #endif   /* NIX_IO */
  110.