|
|
1.1.1.7 ! root 1: /* tailor.h -- Not copyrighted 1991 Mark Adler */ ! 2: ! 3: /* Use prototypes and ANSI libraries if __STDC__ */ ! 4: #ifdef __STDC__ ! 5: # ifndef PROTO ! 6: # define PROTO ! 7: # endif /* !PROTO */ ! 8: # define MODERN ! 9: #endif /* __STDC__ */ ! 10: ! 11: ! 12: /* Use prototypes and ANSI libraries */ ! 13: #if defined(sgi) || defined(mips) ! 14: # ifndef PROTO ! 15: # define PROTO ! 16: # endif /* !PROTO */ ! 17: # define MODERN ! 18: #endif /* sgi */ ! 19: ! 20: ! 21: /* Define MSDOS for Turbo C as well as Microsoft C */ ! 22: #ifdef __POWERC /* For Power C too */ ! 23: # define __TURBOC__ ! 24: #endif /* __POWERC */ ! 25: ! 26: ! 27: /* Use prototypes and ANSI libraries if Microsoft or Borland C */ ! 28: #ifdef MSDOS ! 29: # ifndef PROTO ! 30: # define PROTO ! 31: # endif /* !PROTO */ ! 32: # define MODERN ! 33: #endif /* MSDOS */ ! 34: ! 35: ! 36: /* Turn off prototypes if requested */ ! 37: #ifdef NOPROTO ! 38: # ifdef PROTO ! 39: # undef PROTO ! 40: # endif /* PROTO */ ! 41: #endif /* NOPROT */ ! 42: ! 43: ! 44: /* Used to remove arguments in function prototypes for non-ANSI C */ ! 45: #ifdef PROTO ! 46: # define OF(a) a ! 47: #else /* !PROTO */ ! 48: # define OF(a) () ! 49: #endif /* ?PROTO */ ! 50: ! 51: ! 52: /* Allow far and huge allocation for small model (Microsoft C or Turbo C) */ ! 53: /* unless NOFAR defined (needed for ANSI mode compilations) */ ! 54: /* But if we're using DJGPP, and want to use the optimized 386 assembler */ ! 55: /* zmatch routines, we can't use DYN_ALLOC. But gcc has virtual memory... */ ! 56: #ifdef MSDOS ! 57: # ifndef __GNUC__ ! 58: # ifndef DYN_ALLOC ! 59: # define DYN_ALLOC ! 60: # endif ! 61: # endif ! 62: # ifdef __TURBOC__ ! 63: # include <alloc.h> ! 64: # define fcalloc calloc /* Assumes that all arrays are < 64K for MSDOS */ ! 65: # define fcfree free ! 66: # else /* !__TURBOC__ */ ! 67: # ifndef __GNUC__ ! 68: # include <malloc.h> ! 69: # define farmalloc _fmalloc ! 70: # define farfree _ffree ! 71: # define fcalloc(nitems,itemsize) halloc((long)(nitems),(itemsize)) ! 72: # define fcfree hfree ! 73: # endif /* __GNUC__ */ ! 74: # endif /* ?__TURBOC__ */ ! 75: # ifdef NOFAR ! 76: # define huge ! 77: # define far ! 78: # define near ! 79: # endif ! 80: #else /* !MSDOS */ ! 81: # ifdef __QNX__ ! 82: # undef huge ! 83: # undef far ! 84: # undef near ! 85: # undef farmalloc ! 86: # undef farfree ! 87: # undef fcalloc ! 88: # endif /* __QNX__ */ ! 89: # define huge ! 90: # define far ! 91: # define near ! 92: # define farmalloc malloc ! 93: # define farfree free ! 94: # define fcalloc calloc ! 95: # define fcfree free ! 96: #endif /* ?MSDOS */ ! 97: #ifdef __GNUC__ ! 98: # ifdef MSDOS /* MSDOS GNU C == DJGPP */ ! 99: # define huge ! 100: # define far ! 101: # define near ! 102: # define farmalloc malloc ! 103: # define farfree free ! 104: # define fcalloc calloc ! 105: # define fcfree free ! 106: # endif /* MSDOS */ ! 107: #endif /* __GNUC__ */ ! 108: ! 109: /* Define MSVMS if either MSDOS or VMS defined */ ! 110: #ifdef MSDOS ! 111: # define MSVMS ! 112: #else /* !MSDOS */ ! 113: # ifdef VMS ! 114: # define MSVMS ! 115: # endif /* VMS */ ! 116: #endif /* ?MSDOS */ ! 117: ! 118: ! 119: #include <stdio.h> ! 120: #include <stdlib.h> ! 121: typedef unsigned int extent; ! 122: ! 123: /* Get types and stat */ ! 124: #ifdef VMS ! 125: # include <types.h> ! 126: # include <stat.h> ! 127: #else /* !VMS */ ! 128: #ifndef __PUREC__ ! 129: # ifndef C370 ! 130: # ifndef MACTC5 ! 131: # include <sys/types.h> ! 132: # include <sys/stat.h> ! 133: # endif /* MACTC5 */ ! 134: # endif /* C370 */ ! 135: #endif ! 136: #endif /* ?VMS */ ! 137: ! 138: ! 139: /* Cheap fix for unlink on VMS */ ! 140: #ifdef VMS ! 141: # define unlink delete ! 142: #endif /* VMS */ ! 143: ! 144: ! 145: /* For Pyramid */ ! 146: #ifdef pyr ! 147: # define strrchr rindex ! 148: #endif /* pyr */ ! 149: ! 150: ! 151: /* File operations--use "b" for binary if allowed */ ! 152: #ifdef MODERN ! 153: # define FOPR "rb" ! 154: # define FOPM "r+b" ! 155: # define FOPW "w+b" ! 156: #else /* !MODERN */ ! 157: # define FOPR "r" ! 158: # define FOPM "r+" ! 159: # define FOPW "w+" ! 160: #endif /* ?MODERN */ ! 161: ! 162: ! 163: /* Define this symbol if your target allows access to unaligned data. ! 164: * This is not mandatory, just a speed optimization. The compressed ! 165: * output is strictly identical. ! 166: */ ! 167: #if defined(MSDOS) || defined(M_XENIX) || defined(i386) || \ ! 168: defined(mc68020) || defined(vax) ! 169: # define UNALIGNED_OK ! 170: #endif ! 171: ! 172: ! 173: /* Under MSDOS we may run out of memory when processing a large number ! 174: * of files. Compile with MEDIUM_MEM to reduce the memory requirements or ! 175: * with MIN_MEM to use as little memory as possible. ! 176: */ ! 177: #ifdef SMALL_MEM ! 178: # define BSZ 2048 /* Buffer size for files */ ! 179: #else ! 180: #ifdef MEDIUM_MEM ! 181: # define BSZ 8192 ! 182: #else ! 183: # define BSZ 16384 ! 184: #endif ! 185: #endif ! 186: ! 187: /* end of tailor.h */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.