Debian Codegraph @

unix/unxcfg.h

raw ◀ ▶
Source reconstructed at patch state 1 of 2 — not the installed (fully patched) source.
2 Debian patches touch this file
1 /*
2 Copyright (c) 1990-2009 Info-ZIP. All rights reserved.
3
4 See the accompanying file LICENSE, version 2009-Jan-02 or later
5 (the contents of which are also included in unzip.h) for terms of use.
6 If, for some reason, all these files are missing, the Info-ZIP license
7 also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
8 */
9 /*---------------------------------------------------------------------------
10 Unix specific configuration section:
11 ---------------------------------------------------------------------------*/
12
13 #ifndef __unxcfg_h
14 #define __unxcfg_h
15
16
17 /* LARGE FILE SUPPORT - 10/6/04 EG */
18 /* This needs to be set before the includes so they set the right sizes */
19
20 #if (defined(NO_LARGE_FILE_SUPPORT) && defined(LARGE_FILE_SUPPORT))
21 # undef LARGE_FILE_SUPPORT
22 #endif
23
24 /* Automatically set ZIP64_SUPPORT if LFS */
25 #ifdef LARGE_FILE_SUPPORT
26 # if (!defined(NO_ZIP64_SUPPORT) && !defined(ZIP64_SUPPORT))
27 # define ZIP64_SUPPORT
28 # endif
29 #endif
30
31 /* NO_ZIP64_SUPPORT takes preceedence over ZIP64_SUPPORT */
32 #if defined(NO_ZIP64_SUPPORT) && defined(ZIP64_SUPPORT)
33 # undef ZIP64_SUPPORT
34 #endif
35
36 #ifdef LARGE_FILE_SUPPORT
37 /* 64-bit Large File Support */
38
39 /* The following Large File Summit (LFS) defines turn on large file support
40 on Linux (probably 2.4 or later kernel) and many other unixen */
41
42 /* These have to be before any include that sets types so the large file
43 versions of the types are set in the includes */
44
45 # define _LARGEFILE_SOURCE /* some OSes need this for fseeko */
46 # define _LARGEFILE64_SOURCE
47 # define _FILE_OFFSET_BITS 64 /* select default interface as 64 bit */
48 # define _LARGE_FILES /* some OSes need this for 64-bit off_t */
49 # define __USE_LARGEFILE64
50 #endif /* LARGE_FILE_SUPPORT */
51
52
53 #include <sys/types.h> /* off_t, time_t, dev_t, ... */
54 #include <sys/stat.h>
55 #include <unistd.h>
56
57 #ifdef NO_OFF_T
58 typedef long zoff_t;
59 #else
60 typedef off_t zoff_t;
61 #endif
62 #define ZOFF_T_DEFINED
63 typedef struct stat z_stat;
64 #define Z_STAT_DEFINED
65
66 #ifndef COHERENT
67 # include <fcntl.h> /* O_BINARY for open() w/o CR/LF translation */
68 #else /* COHERENT */
69 # ifdef _I386
70 # include <fcntl.h> /* Coherent 4.0.x, Mark Williams C */
71 # else
72 # include <sys/fcntl.h> /* Coherent 3.10, Mark Williams C */
73 # endif
74 # define SHORT_SYMS
75 # ifndef __COHERENT__ /* Coherent 4.2 has tzset() */
76 # define tzset settz
77 # endif
78 #endif /* ?COHERENT */
79
80 #ifndef NO_PARAM_H
81 # ifdef NGROUPS_MAX
82 # undef NGROUPS_MAX /* SCO bug: defined again in <sys/param.h> */
83 # endif
84 # ifdef BSD
85 # define TEMP_BSD /* may be defined again in <sys/param.h> */
86 # undef BSD
87 # endif
88 # include <sys/param.h> /* conflict with <sys/types.h>, some systems? */
89 # ifdef TEMP_BSD
90 # undef TEMP_BSD
91 # ifndef BSD
92 # define BSD
93 # endif
94 # endif
95 #endif /* !NO_PARAM_H */
96
97 #ifdef __osf__
98 # define DIRENT
99 # ifdef BSD
100 # undef BSD
101 # endif
102 #endif /* __osf__ */
103
104 #ifdef __CYGWIN__
105 # include <unistd.h>
106 # define DIRENT
107 # define HAVE_TERMIOS_H
108 # ifndef timezone
109 # define timezone _timezone
110 # endif
111 #endif
112
113 #ifdef BSD
114 # include <sys/time.h>
115 # include <sys/timeb.h>
116 # if (defined(_AIX) || defined(__GLIBC__) || defined(__GNU__))
117 # include <time.h>
118 # endif
119 #else
120 # include <time.h>
121 struct tm *gmtime(), *localtime();
122 #endif
123
124 #if (defined(BSD4_4) || (defined(SYSV) && defined(MODERN)))
125 # include <unistd.h> /* this includes utime.h on SGIs */
126 # if (defined(BSD4_4) || defined(linux) || defined(__GLIBC__))
127 # include <utime.h>
128 # define GOT_UTIMBUF
129 # endif
130 # if (!defined(GOT_UTIMBUF) && (defined(__hpux) || defined(__SUNPRO_C)))
131 # include <utime.h>
132 # define GOT_UTIMBUF
133 # endif
134 # if (!defined(GOT_UTIMBUF) && defined(__GNU__))
135 # include <utime.h>
136 # define GOT_UTIMBUF
137 # endif
138 #endif
139 #if (defined(__DGUX__) && !defined(GOT_UTIMBUF))
140 /* DG/UX requires this because of a non-standard struct utimebuf */
141 # include <utime.h>
142 # define GOT_UTIMBUF
143 #endif
144
145 #if (defined(V7) || defined(pyr_bsd))
146 # define strchr index
147 # define strrchr rindex
148 #endif
149 #ifdef V7
150 # define O_RDONLY 0
151 # define O_WRONLY 1
152 # define O_RDWR 2
153 #endif
154
155 #if defined(NO_UNICODE_SUPPORT) && defined(UNICODE_SUPPORT)
156 /* disable Unicode (UTF-8) support when requested */
157 # undef UNICODE_SUPPORT
158 #endif
159
160 #if (defined(_MBCS) && defined(NO_MBCS))
161 /* disable MBCS support when requested */
162 # undef _MBCS
163 #endif
164
165 #if (!defined(NO_SETLOCALE) && !defined(_MBCS))
166 # if (!defined(UNICODE_SUPPORT) || !defined(UTF8_MAYBE_NATIVE))
167 /* enable setlocale here, unless this happens later for UTF-8 and/or
168 * MBCS support */
169 # include <locale.h>
170 # ifndef SETLOCALE
171 # define SETLOCALE(category, locale) setlocale(category, locale)
172 # endif
173 # endif
174 #endif
175 #ifndef NO_SETLOCALE
176 # if (!defined(NO_WORKING_ISPRINT) && !defined(HAVE_WORKING_ISPRINT))
177 /* enable "enhanced" unprintable chars detection in fnfilter() */
178 # define HAVE_WORKING_ISPRINT
179 # endif
180 #endif
181
182 #ifdef MINIX
183 # include <stdio.h>
184 #endif
185 #if (!defined(HAVE_STRNICMP) & !defined(NO_STRNICMP))
186 # define NO_STRNICMP
187 #endif
188 #ifndef DATE_FORMAT
189 # define DATE_FORMAT DF_MDY /* GRR: customize with locale.h somehow? */
190 #endif
191 #define lenEOL 1
192 #ifdef EBCDIC
193 # define PutNativeEOL *q++ = '\n';
194 #else
195 # define PutNativeEOL *q++ = native(LF);
196 #endif
197 #define SCREENSIZE(ttrows, ttcols) screensize(ttrows, ttcols)
198 #define SCREENWIDTH 80
199 #define SCREENLWRAP 1
200 #define USE_EF_UT_TIME
201 #if (!defined(NO_LCHOWN) || !defined(NO_LCHMOD))
202 # define SET_SYMLINK_ATTRIBS
203 #endif
204 #ifdef MTS
205 # ifdef SET_DIR_ATTRIB
206 # undef SET_DIR_ATTRIB
207 # endif
208 #else /* !MTS */
209 # define SET_DIR_ATTRIB
210 # if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP)) /* GRR 970513 */
211 # define TIMESTAMP
212 # endif
213 # define RESTORE_UIDGID
214 #endif /* ?MTS */
215
216 /* Static variables that we have to add to Uz_Globs: */
217 #define SYSTEM_SPECIFIC_GLOBALS \
218 int created_dir, renamed_fullpath;\
219 char *rootpath, *buildpath, *end;\
220 ZCONST char *wildname;\
221 char *dirname, matchname[FILNAMSIZ];\
222 int rootlen, have_dirname, dirnamelen, notfirstcall;\
223 zvoid *wild_dir;
224
225 /* created_dir, and renamed_fullpath are used by both mapname() and */
226 /* checkdir(). */
227 /* rootlen, rootpath, buildpath and end are used by checkdir(). */
228 /* wild_dir, dirname, wildname, matchname[], dirnamelen, have_dirname, */
229 /* and notfirstcall are used by do_wild(). */
230
231 #endif /* !__unxcfg_h */