]>
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 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
25 /* $OpenBSD: private.h,v 1.6 1997/01/14 03:16:48 millert Exp $ */
32 ** This file is in the public domain, so clarified as of
33 ** 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
36 /* OpenBSD defaults */
37 #define TM_GMTOFF tm_gmtoff
38 #define TM_ZONE tm_zone
40 #define STD_INSPIRED 1
41 #define HAVE_LONG_DOUBLE 1
42 #define HAVE_STRERROR 1
45 ** This header is for use ONLY with the time conversion code.
46 ** There is no guarantee that it will remain unchanged,
47 ** or that it will remain at all.
48 ** Do NOT copy it to any system include directory.
59 static char privatehid
[] = "@(#)private.h 7.44";
60 #endif /* !defined NOID */
61 #endif /* !defined lint */
65 ** Defaults for preprocessor symbols.
66 ** You can override these in your C compiler options, e.g. `-DHAVE_ADJTIME=0'.
70 #define HAVE_ADJTIME 1
71 #endif /* !defined HAVE_ADJTIME */
74 #define HAVE_GETTEXT 0
75 #endif /* !defined HAVE_GETTEXT */
77 #ifndef HAVE_SETTIMEOFDAY
78 #define HAVE_SETTIMEOFDAY 3
79 #endif /* !defined HAVE_SETTIMEOFDAY */
82 #define HAVE_STRERROR 0
83 #endif /* !defined HAVE_STRERROR */
86 #define HAVE_UNISTD_H 1
87 #endif /* !defined HAVE_UNISTD_H */
90 #define HAVE_UTMPX_H 0
91 #endif /* !defined HAVE_UTMPX_H */
94 #define LOCALE_HOME "/usr/lib/locale"
95 #endif /* !defined LOCALE_HOME */
101 #include "sys/types.h" /* for time_t */
105 #include "limits.h" /* for CHAR_BIT */
111 #endif /* HAVE_GETTEXT - 0 */
113 #if HAVE_UNISTD_H - 0
114 #include "unistd.h" /* for F_OK and R_OK */
115 #endif /* HAVE_UNISTD_H - 0 */
117 #if !(HAVE_UNISTD_H - 0)
120 #endif /* !defined F_OK */
123 #endif /* !defined R_OK */
124 #endif /* !(HAVE_UNISTD_H - 0) */
126 /* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX. */
127 #define is_digit(c) ((unsigned)(c) - '0' <= 9)
130 ** Workarounds for compilers/systems.
134 ** SunOS 4.1.1 cc lacks const.
140 #endif /* !defined __STDC__ */
141 #endif /* !defined const */
144 ** SunOS 4.1.1 cc lacks prototypes.
150 #endif /* defined __STDC__ */
153 #endif /* !defined __STDC__ */
154 #endif /* !defined P */
157 ** SunOS 4.1.1 headers lack EXIT_SUCCESS.
161 #define EXIT_SUCCESS 0
162 #endif /* !defined EXIT_SUCCESS */
165 ** SunOS 4.1.1 headers lack EXIT_FAILURE.
169 #define EXIT_FAILURE 1
170 #endif /* !defined EXIT_FAILURE */
173 ** SunOS 4.1.1 headers lack FILENAME_MAX.
180 #include "sys/param.h"
181 #endif /* defined unix */
182 #endif /* !defined MAXPATHLEN */
185 #define FILENAME_MAX MAXPATHLEN
186 #endif /* defined MAXPATHLEN */
188 #define FILENAME_MAX 1024 /* Pure guesswork */
189 #endif /* !defined MAXPATHLEN */
191 #endif /* !defined FILENAME_MAX */
194 ** SunOS 4.1.1 libraries lack remove.
198 extern int unlink
P((const char * filename
));
199 #define remove unlink
200 #endif /* !defined remove */
204 ** Some ancient errno.h implementations don't declare errno.
205 ** But some newer errno.h implementations define it as a macro.
206 ** Fix the former without affecting the latter.
210 #endif /* !defined errno */
214 ** Finally, some convenience items.
219 #endif /* !defined TRUE */
223 #endif /* !defined FALSE */
226 #define TYPE_BIT(type) (sizeof (type) * CHAR_BIT)
227 #endif /* !defined TYPE_BIT */
230 #define TYPE_SIGNED(type) (((type) -1) < 0)
231 #endif /* !defined TYPE_SIGNED */
233 #ifndef INT_STRLEN_MAXIMUM
235 ** 302 / 1000 is log10(2.0) rounded up.
236 ** Subtract one for the sign bit if the type is signed;
237 ** add one for integer division truncation;
238 ** add one more for a minus sign if the type is signed.
240 #define INT_STRLEN_MAXIMUM(type) \
241 ((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 100 + 1 + TYPE_SIGNED(type))
242 #endif /* !defined INT_STRLEN_MAXIMUM */
251 #endif /* defined lint */
255 #endif /* defined __GNUC__ */
256 #endif /* !defined lint */
257 #endif /* !defined GNUC_or_lint */
261 #define INITIALIZE(x) ((x) = 0)
262 #endif /* defined GNUC_or_lint */
264 #define INITIALIZE(x)
265 #endif /* !defined GNUC_or_lint */
266 #endif /* !defined INITIALIZE */
269 ** For the benefit of GNU folk...
270 ** `_(MSGID)' uses the current locale's message library string for MSGID.
271 ** The default is to use gettext if available, and use MSGID otherwise.
276 #define _(msgid) gettext(msgid)
277 #else /* !(HAVE_GETTEXT - 0) */
278 #define _(msgid) msgid
279 #endif /* !(HAVE_GETTEXT - 0) */
280 #endif /* !defined _ */
283 #define TZ_DOMAIN "tz"
284 #endif /* !defined TZ_DOMAIN */
287 ** UNIX was a registered trademark of UNIX System Laboratories in 1993.
290 #endif /* !defined PRIVATE_H */