]>
git.saurik.com Git - apple/system_cmds.git/blob - zic.tproj/private.h
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * "Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7 * Reserved. This file contains Original Code and/or Modifications of
8 * Original Code as defined in and that are subject to the Apple Public
9 * Source License Version 1.0 (the 'License'). You may not use this file
10 * except in compliance with the License. Please obtain a copy of the
11 * License at http://www.apple.com/publicsource and read it before using
14 * The Original Code and all software distributed under the License are
15 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
22 * @APPLE_LICENSE_HEADER_END@
24 /* $OpenBSD: private.h,v 1.6 1997/01/14 03:16:48 millert Exp $ */
31 ** This file is in the public domain, so clarified as of
32 ** 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
35 /* OpenBSD defaults */
36 #define TM_GMTOFF tm_gmtoff
37 #define TM_ZONE tm_zone
39 #define STD_INSPIRED 1
40 #define HAVE_LONG_DOUBLE 1
41 #define HAVE_STRERROR 1
44 ** This header is for use ONLY with the time conversion code.
45 ** There is no guarantee that it will remain unchanged,
46 ** or that it will remain at all.
47 ** Do NOT copy it to any system include directory.
58 static char privatehid
[] = "@(#)private.h 7.44";
59 #endif /* !defined NOID */
60 #endif /* !defined lint */
64 ** Defaults for preprocessor symbols.
65 ** You can override these in your C compiler options, e.g. `-DHAVE_ADJTIME=0'.
69 #define HAVE_ADJTIME 1
70 #endif /* !defined HAVE_ADJTIME */
73 #define HAVE_GETTEXT 0
74 #endif /* !defined HAVE_GETTEXT */
76 #ifndef HAVE_SETTIMEOFDAY
77 #define HAVE_SETTIMEOFDAY 3
78 #endif /* !defined HAVE_SETTIMEOFDAY */
81 #define HAVE_STRERROR 0
82 #endif /* !defined HAVE_STRERROR */
85 #define HAVE_UNISTD_H 1
86 #endif /* !defined HAVE_UNISTD_H */
89 #define HAVE_UTMPX_H 0
90 #endif /* !defined HAVE_UTMPX_H */
93 #define LOCALE_HOME "/usr/lib/locale"
94 #endif /* !defined LOCALE_HOME */
100 #include "sys/types.h" /* for time_t */
104 #include "limits.h" /* for CHAR_BIT */
110 #endif /* HAVE_GETTEXT - 0 */
112 #if HAVE_UNISTD_H - 0
113 #include "unistd.h" /* for F_OK and R_OK */
114 #endif /* HAVE_UNISTD_H - 0 */
116 #if !(HAVE_UNISTD_H - 0)
119 #endif /* !defined F_OK */
122 #endif /* !defined R_OK */
123 #endif /* !(HAVE_UNISTD_H - 0) */
125 /* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX. */
126 #define is_digit(c) ((unsigned)(c) - '0' <= 9)
129 ** Workarounds for compilers/systems.
133 ** SunOS 4.1.1 cc lacks const.
139 #endif /* !defined __STDC__ */
140 #endif /* !defined const */
143 ** SunOS 4.1.1 cc lacks prototypes.
149 #endif /* defined __STDC__ */
152 #endif /* !defined __STDC__ */
153 #endif /* !defined P */
156 ** SunOS 4.1.1 headers lack EXIT_SUCCESS.
160 #define EXIT_SUCCESS 0
161 #endif /* !defined EXIT_SUCCESS */
164 ** SunOS 4.1.1 headers lack EXIT_FAILURE.
168 #define EXIT_FAILURE 1
169 #endif /* !defined EXIT_FAILURE */
172 ** SunOS 4.1.1 headers lack FILENAME_MAX.
179 #include "sys/param.h"
180 #endif /* defined unix */
181 #endif /* !defined MAXPATHLEN */
184 #define FILENAME_MAX MAXPATHLEN
185 #endif /* defined MAXPATHLEN */
187 #define FILENAME_MAX 1024 /* Pure guesswork */
188 #endif /* !defined MAXPATHLEN */
190 #endif /* !defined FILENAME_MAX */
193 ** SunOS 4.1.1 libraries lack remove.
197 extern int unlink
P((const char * filename
));
198 #define remove unlink
199 #endif /* !defined remove */
203 ** Some ancient errno.h implementations don't declare errno.
204 ** But some newer errno.h implementations define it as a macro.
205 ** Fix the former without affecting the latter.
209 #endif /* !defined errno */
213 ** Finally, some convenience items.
218 #endif /* !defined TRUE */
222 #endif /* !defined FALSE */
225 #define TYPE_BIT(type) (sizeof (type) * CHAR_BIT)
226 #endif /* !defined TYPE_BIT */
229 #define TYPE_SIGNED(type) (((type) -1) < 0)
230 #endif /* !defined TYPE_SIGNED */
232 #ifndef INT_STRLEN_MAXIMUM
234 ** 302 / 1000 is log10(2.0) rounded up.
235 ** Subtract one for the sign bit if the type is signed;
236 ** add one for integer division truncation;
237 ** add one more for a minus sign if the type is signed.
239 #define INT_STRLEN_MAXIMUM(type) \
240 ((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 100 + 1 + TYPE_SIGNED(type))
241 #endif /* !defined INT_STRLEN_MAXIMUM */
250 #endif /* defined lint */
254 #endif /* defined __GNUC__ */
255 #endif /* !defined lint */
256 #endif /* !defined GNUC_or_lint */
260 #define INITIALIZE(x) ((x) = 0)
261 #endif /* defined GNUC_or_lint */
263 #define INITIALIZE(x)
264 #endif /* !defined GNUC_or_lint */
265 #endif /* !defined INITIALIZE */
268 ** For the benefit of GNU folk...
269 ** `_(MSGID)' uses the current locale's message library string for MSGID.
270 ** The default is to use gettext if available, and use MSGID otherwise.
275 #define _(msgid) gettext(msgid)
276 #else /* !(HAVE_GETTEXT - 0) */
277 #define _(msgid) msgid
278 #endif /* !(HAVE_GETTEXT - 0) */
279 #endif /* !defined _ */
282 #define TZ_DOMAIN "tz"
283 #endif /* !defined TZ_DOMAIN */
286 ** UNIX was a registered trademark of UNIX System Laboratories in 1993.
289 #endif /* !defined PRIVATE_H */