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