]>
git.saurik.com Git - apple/libc.git/blob - stdtime/private.h
90329d3fa70b0b5049bc7ad93e448b9d89bb9f2e
1 /* $FreeBSD: src/lib/libc/stdtime/private.h,v 1.6.8.1 2000/08/23 00:19:15 jhb Exp $ */
7 ** This file is in the public domain, so clarified as of
8 ** June 5, 1996 by Arthur David Olson (arthur_david_olson@nih.gov).
11 /* Stuff moved from Makefile.inc to reduce clutter */
13 #define TM_GMTOFF tm_gmtoff
14 #define TM_ZONE tm_zone
15 #define STD_INSPIRED 1
17 #define HAVE_LONG_DOUBLE 1
18 #define HAVE_STRERROR 1
19 #define HAVE_UNISTD_H 1
20 #define LOCALE_HOME _PATH_LOCALE
21 #define TZDIR "/usr/share/zoneinfo"
22 #endif /* ndef TM_GMTOFF */
25 ** This header is for use ONLY with the time conversion code.
26 ** There is no guarantee that it will remain unchanged,
27 ** or that it will remain at all.
28 ** Do NOT copy it to any system include directory.
39 static char privatehid[] = "@(#)private.h 7.43";
41 #endif /* !defined NOID */
42 #endif /* !defined lint */
45 ** Defaults for preprocessor symbols.
46 ** You can override these in your C compiler options, e.g. `-DHAVE_ADJTIME=0'.
50 #define HAVE_ADJTIME 1
51 #endif /* !defined HAVE_ADJTIME */
54 #define HAVE_GETTEXT 0
55 #endif /* !defined HAVE_GETTEXT */
57 #ifndef HAVE_SETTIMEOFDAY
58 #define HAVE_SETTIMEOFDAY 3
59 #endif /* !defined HAVE_SETTIMEOFDAY */
62 #define HAVE_STRERROR 0
63 #endif /* !defined HAVE_STRERROR */
66 #define HAVE_UNISTD_H 1
67 #endif /* !defined HAVE_UNISTD_H */
70 #define HAVE_UTMPX_H 0
71 #endif /* !defined HAVE_UTMPX_H */
74 #define LOCALE_HOME "/usr/lib/locale"
75 #endif /* !defined LOCALE_HOME */
81 #include "sys/types.h" /* for time_t */
85 #include "limits.h" /* for CHAR_BIT */
91 #endif /* HAVE_GETTEXT - 0 */
94 #include "unistd.h" /* for F_OK and R_OK */
95 #endif /* HAVE_UNISTD_H - 0 */
97 #if !(HAVE_UNISTD_H - 0)
100 #endif /* !defined F_OK */
103 #endif /* !defined R_OK */
104 #endif /* !(HAVE_UNISTD_H - 0) */
106 /* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX. */
107 #define is_digit(c) ((unsigned)(c) - '0' <= 9)
110 ** Workarounds for compilers/systems.
116 #endif /* defined __STDC__ */
119 #endif /* !defined __STDC__ */
120 #endif /* !defined P */
123 ** SunOS 4.1.1 headers lack FILENAME_MAX.
130 #include "sys/param.h"
131 #endif /* defined unix */
132 #endif /* !defined MAXPATHLEN */
135 #define FILENAME_MAX MAXPATHLEN
136 #endif /* defined MAXPATHLEN */
138 #define FILENAME_MAX 1024 /* Pure guesswork */
139 #endif /* !defined MAXPATHLEN */
141 #endif /* !defined FILENAME_MAX */
144 ** Finally, some convenience items.
149 #endif /* !defined TRUE */
153 #endif /* !defined FALSE */
156 #define TYPE_BIT(type) (sizeof (type) * CHAR_BIT)
157 #endif /* !defined TYPE_BIT */
160 #define TYPE_SIGNED(type) (((type) -1) < 0)
161 #endif /* !defined TYPE_SIGNED */
163 #ifndef INT_STRLEN_MAXIMUM
165 ** 302 / 1000 is log10(2.0) rounded up.
166 ** Subtract one for the sign bit if the type is signed;
167 ** add one for integer division truncation;
168 ** add one more for a minus sign if the type is signed.
170 #define INT_STRLEN_MAXIMUM(type) \
171 ((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 1000 + 1 + TYPE_SIGNED(type))
172 #endif /* !defined INT_STRLEN_MAXIMUM */
181 #endif /* defined lint */
185 #endif /* defined __GNUC__ */
186 #endif /* !defined lint */
187 #endif /* !defined GNUC_or_lint */
191 #define INITIALIZE(x) ((x) = 0)
192 #endif /* defined GNUC_or_lint */
194 #define INITIALIZE(x)
195 #endif /* !defined GNUC_or_lint */
196 #endif /* !defined INITIALIZE */
199 ** For the benefit of GNU folk...
200 ** `_(MSGID)' uses the current locale's message library string for MSGID.
201 ** The default is to use gettext if available, and use MSGID otherwise.
206 #define _(msgid) gettext(msgid)
207 #else /* !(HAVE_GETTEXT - 0) */
208 #define _(msgid) msgid
209 #endif /* !(HAVE_GETTEXT - 0) */
210 #endif /* !defined _ */
213 #define TZ_DOMAIN "tz"
214 #endif /* !defined TZ_DOMAIN */
217 ** UNIX was a registered trademark of UNIX System Laboratories in 1993.
220 #endif /* !defined PRIVATE_H */