|
|
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 */
1.1.1.6 ! root 81: # ifdef __QNX__
! 82: # undef huge
! 83: # undef far
! 84: # undef near
! 85: # undef farmalloc
! 86: # undef farfree
! 87: # undef fcalloc
! 88: # endif /* __QNX__ */
1.1.1.5 root 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: # include <sys/types.h>
129: # include <sys/stat.h>
130: #endif /* ?VMS */
131:
132:
133: /* Cheap fix for unlink on VMS */
134: #ifdef VMS
135: # define unlink delete
136: #endif /* VMS */
137:
138:
139: /* For Pyramid */
140: #ifdef pyr
141: # define strrchr rindex
142: #endif /* pyr */
143:
144:
145: /* File operations--use "b" for binary if allowed */
146: #ifdef MODERN
147: # define FOPR "rb"
148: # define FOPM "r+b"
149: # define FOPW "w+b"
150: #else /* !MODERN */
151: # define FOPR "r"
152: # define FOPM "r+"
153: # define FOPW "w+"
154: #endif /* ?MODERN */
155:
156:
157: /* Define this symbol if your target allows access to unaligned data.
158: * This is not mandatory, just a speed optimization. The compressed
159: * output is strictly identical.
160: */
1.1.1.6 ! root 161: #if defined(MSDOS) || defined(M_XENIX) || defined(i386) || \
! 162: defined(mc68020) || defined(vax)
1.1.1.5 root 163: # define UNALIGNED_OK
164: #endif
165:
166:
167: /* Under MSDOS we may run out of memory when processing a large number
168: * of files. Compile with MEDIUM_MEM to reduce the memory requirements or
169: * with MIN_MEM to use as little memory as possible.
170: */
171: #ifdef SMALL_MEM
172: # define BSZ 2048 /* Buffer size for files */
173: #else
174: #ifdef MEDIUM_MEM
175: # define BSZ 8192
176: #else
177: # define BSZ 16384
178: #endif
179: #endif
180:
181: /* end of tailor.h */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.