home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / zoo21-2.zip / source / portable.h < prev    next >
C/C++ Source or Header  |  1993-10-06  |  3KB  |  112 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. zputc(c, f) writes a character to a ZOOFILE x.
  27. zputchar(c) writes a character c to standard output.
  28. MKDIR(x) creates a directory x.
  29. */
  30.  
  31. /* Borland's Turbo C. */
  32. #ifdef   TURBOC
  33. /* options for zooopen(), zoocreate() */
  34. #define  Z_WRITE        "r+b"
  35. #define  Z_READ         "rb"
  36. #define  Z_RDWR         "r+b"
  37. #define    Z_NEW                "w+b"
  38. #define    zgetc(x)            getc(x)
  39. #define  zputc(c, f)        putc(c, f)
  40. #define    zputchar(c)        putchar(c)
  41. #define  MKDIR(x)       mkdir(x)
  42. int mkdir PARMS((char *));
  43. #endif
  44.  
  45. /* Microsoft C, emx, other PC compilers? */
  46. #if defined(MSC) || defined(__EMX__)
  47. /* options for zooopen(), zoocreate() */
  48. #define  Z_WRITE        "r+b"
  49. #define  Z_READ         "rb"
  50. #define  Z_RDWR         "r+b"
  51. #define    Z_NEW                "w+b"
  52. #define    zgetc(x)            getc(x)
  53. #define  zputc(c, f)        putc(c, f)
  54. #define    zputchar(c)        putchar(c)
  55. #ifdef __EMX__
  56. #define  MKDIR(x)       mkdir(x, 0777)
  57. #else
  58. #define  MKDIR(x)       mkdir(x)
  59. #endif
  60. #endif
  61.  
  62. #ifdef VMS
  63. #define Z_WRITE        "r+"
  64. #define Z_READ            "r"
  65. #define Z_RDWR            "r+"
  66. #define    Z_NEW            "w+b"
  67. #define zgetc(x)    getc(x)
  68. #define  zputc(c, f)        putc(c, f)
  69. #define zputchar(c)    putchar(c)
  70. #define MKDIR(x)    vmsmkdir (x, 0)
  71. #endif
  72.  
  73. #ifdef GENERIC
  74. /* **IX I/O, but MKDIR() is a no-operation */
  75. #define  NIX_IO      /* standard **IX I/O */
  76. #define  MKDIR(x)
  77. #endif
  78.  
  79. /* **IX System V release 2.1 */
  80. #ifdef   SYS_V
  81. #define  NIX_IO      /* standard **IX I/O */
  82. #define  MKDIR(x)       mkdir(x) /* define this in sysv.c */
  83. #endif
  84.  
  85. /* Xenix */
  86. #ifdef   XENIX
  87. #define  NIX_IO      /* standard **IX I/O */
  88. #endif
  89.  
  90. /* 4.3BSD */
  91. #ifdef BSD4_3
  92. #define NIX_IO       /* standard **IX I/O */
  93. #define  MKDIR(x)       mkdir(x, 0777)
  94. #endif
  95.  
  96. /* Amiga */
  97. #ifdef MCH_AMIGA
  98. # include "MCH_AMIGA NEEDS REVISION"
  99. #endif
  100.  
  101. /* Standard **IX I/O definitions */
  102. #ifdef   NIX_IO
  103. /* options for zooopen(), zoocreate() */
  104. #define  Z_WRITE        "r+"
  105. #define  Z_READ         "r"
  106. #define  Z_RDWR         "r+"
  107. #define    Z_NEW                "w+"
  108. #define    zgetc(x)            getc(x)
  109. #define  zputc(c, f)        putc(c, f)
  110. #define    zputchar(c)        putchar(c)
  111. #endif   /* NIX_IO */
  112.