|
|
1.1.1.5 ! 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: # define huge ! 82: # define far ! 83: # define near ! 84: # define farmalloc malloc ! 85: # define farfree free ! 86: # define fcalloc calloc ! 87: # define fcfree free ! 88: #endif /* ?MSDOS */ ! 89: #ifdef __GNUC__ ! 90: # ifdef MSDOS /* MSDOS GNU C == DJGPP */ ! 91: # define huge ! 92: # define far ! 93: # define near ! 94: # define farmalloc malloc ! 95: # define farfree free ! 96: # define fcalloc calloc ! 97: # define fcfree free ! 98: # endif /* MSDOS */ ! 99: #endif /* __GNUC__ */ ! 100: ! 101: /* Define MSVMS if either MSDOS or VMS defined */ ! 102: #ifdef MSDOS ! 103: # define MSVMS ! 104: #else /* !MSDOS */ ! 105: # ifdef VMS ! 106: # define MSVMS ! 107: # endif /* VMS */ ! 108: #endif /* ?MSDOS */ ! 109: ! 110: ! 111: #include <stdio.h> ! 112: #include <stdlib.h> ! 113: typedef unsigned int extent; ! 114: ! 115: /* Get types and stat */ ! 116: #ifdef VMS ! 117: # include <types.h> ! 118: # include <stat.h> ! 119: #else /* !VMS */ ! 120: # include <sys/types.h> ! 121: # include <sys/stat.h> ! 122: #endif /* ?VMS */ ! 123: ! 124: ! 125: /* Cheap fix for unlink on VMS */ ! 126: #ifdef VMS ! 127: # define unlink delete ! 128: #endif /* VMS */ ! 129: ! 130: ! 131: /* For Pyramid */ ! 132: #ifdef pyr ! 133: # define strrchr rindex ! 134: #endif /* pyr */ ! 135: ! 136: ! 137: /* File operations--use "b" for binary if allowed */ ! 138: #ifdef MODERN ! 139: # define FOPR "rb" ! 140: # define FOPM "r+b" ! 141: # define FOPW "w+b" ! 142: #else /* !MODERN */ ! 143: # define FOPR "r" ! 144: # define FOPM "r+" ! 145: # define FOPW "w+" ! 146: #endif /* ?MODERN */ ! 147: ! 148: ! 149: /* Define this symbol if your target allows access to unaligned data. ! 150: * This is not mandatory, just a speed optimization. The compressed ! 151: * output is strictly identical. ! 152: */ ! 153: #if defined(MSDOS) || defined(M_XENIX) || defined(i386) || defined(mc68020) || defined(vax) ! 154: # define UNALIGNED_OK ! 155: #endif ! 156: ! 157: ! 158: /* Under MSDOS we may run out of memory when processing a large number ! 159: * of files. Compile with MEDIUM_MEM to reduce the memory requirements or ! 160: * with MIN_MEM to use as little memory as possible. ! 161: */ ! 162: #ifdef SMALL_MEM ! 163: # define BSZ 2048 /* Buffer size for files */ ! 164: #else ! 165: #ifdef MEDIUM_MEM ! 166: # define BSZ 8192 ! 167: #else ! 168: # define BSZ 16384 ! 169: #endif ! 170: #endif ! 171: ! 172: /* end of tailor.h */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.