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 3.0 */ 46 #ifdef MSC 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 #define MKDIR(x) mkdir(x) 56 int mkdir (char *); 57 #endif 58 59 #ifdef VMS 60 #define Z_WRITE "r+" 61 #define Z_READ "r" 62 #define Z_RDWR "r+" 63 #define Z_NEW "w+b" 64 #define zgetc(x) getc(x) 65 #define zputc(c, f) putc(c, f) 66 #define zputchar(c) putchar(c) 67 #define MKDIR(x) vmsmkdir (x, 0) 68 #endif 69 70 #ifdef GENERIC 71 /* **IX I/O, but MKDIR() is a no-operation */ 72 #define NIX_IO /* standard **IX I/O */ 73 #define MKDIR(x) 74 #endif 75 76 /* **IX System V release 2.1 */ 77 #ifdef SYS_V 78 #define NIX_IO /* standard **IX I/O */ 79 #define MKDIR(x) mkdir(x) /* define this in sysv.c */ 80 #endif 81 82 /* Xenix */ 83 #ifdef XENIX 84 #define NIX_IO /* standard **IX I/O */ 85 #endif 86 87 /* 4.3BSD */ 88 #ifdef BSD4_3 89 #define NIX_IO /* standard **IX I/O */ 90 #define MKDIR(x) mkdir(x, 0777) 91 #endif 92 93 /* Amiga */ 94 #ifdef MCH_AMIGA 95 # include "MCH_AMIGA NEEDS REVISION" 96 #endif 97 98 /* Standard **IX I/O definitions */ 99 #ifdef NIX_IO 100 /* options for zooopen(), zoocreate() */ 101 #define Z_WRITE "r+" 102 #define Z_READ "r" 103 #define Z_RDWR "r+" 104 #define Z_NEW "w+" 105 #define zgetc(x) getc(x) 106 #define zputc(c, f) putc(c, f) 107 #define zputchar(c) putchar(c) 108 #endif /* NIX_IO */ 109