1 /* $FreeBSD: src/lib/libc/stdtime/private.h,v 1.6.8.1 2000/08/23 00:19:15 jhb Exp $ */
2 /* $DragonFly: src/lib/libc/stdtime/private.h,v 1.2 2003/06/17 04:26:46 dillon Exp $ */
8 ** This file is in the public domain, so clarified as of
9 ** June 5, 1996 by Arthur David Olson (arthur_david_olson@nih.gov).
12 /* Stuff moved from Makefile.inc to reduce clutter */
14 #define TM_GMTOFF tm_gmtoff
15 #define TM_ZONE tm_zone
16 #define STD_INSPIRED 1
18 #define HAVE_LONG_DOUBLE 1
19 #define HAVE_STRERROR 1
20 #define HAVE_UNISTD_H 1
21 #define LOCALE_HOME _PATH_LOCALE
22 #define TZDIR "/usr/share/zoneinfo"
23 #endif /* ndef TM_GMTOFF */
26 ** This header is for use ONLY with the time conversion code.
27 ** There is no guarantee that it will remain unchanged,
28 ** or that it will remain at all.
29 ** Do NOT copy it to any system include directory.
41 ** Defaults for preprocessor symbols.
42 ** You can override these in your C compiler options, e.g. `-DHAVE_ADJTIME=0'.
46 #define HAVE_ADJTIME 1
47 #endif /* !defined HAVE_ADJTIME */
50 #define HAVE_GETTEXT 0
51 #endif /* !defined HAVE_GETTEXT */
53 #ifndef HAVE_SETTIMEOFDAY
54 #define HAVE_SETTIMEOFDAY 3
55 #endif /* !defined HAVE_SETTIMEOFDAY */
58 #define HAVE_STRERROR 0
59 #endif /* !defined HAVE_STRERROR */
62 #define HAVE_UNISTD_H 1
63 #endif /* !defined HAVE_UNISTD_H */
66 #define HAVE_UTMPX_H 0
67 #endif /* !defined HAVE_UTMPX_H */
70 #define LOCALE_HOME "/usr/lib/locale"
71 #endif /* !defined LOCALE_HOME */
77 #include "sys/types.h" /* for time_t */
81 #include "limits.h" /* for CHAR_BIT */
87 #endif /* HAVE_GETTEXT - 0 */
90 #include "unistd.h" /* for F_OK and R_OK */
91 #endif /* HAVE_UNISTD_H - 0 */
93 #if !(HAVE_UNISTD_H - 0)
96 #endif /* !defined F_OK */
99 #endif /* !defined R_OK */
100 #endif /* !(HAVE_UNISTD_H - 0) */
102 /* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX. */
103 #define is_digit(c) ((unsigned)(c) - '0' <= 9)
106 ** Workarounds for compilers/systems.
112 #endif /* defined __STDC__ */
115 #endif /* !defined __STDC__ */
116 #endif /* !defined P */
119 ** SunOS 4.1.1 headers lack FILENAME_MAX.
126 #include "sys/param.h"
127 #endif /* defined unix */
128 #endif /* !defined MAXPATHLEN */
131 #define FILENAME_MAX MAXPATHLEN
132 #endif /* defined MAXPATHLEN */
134 #define FILENAME_MAX 1024 /* Pure guesswork */
135 #endif /* !defined MAXPATHLEN */
137 #endif /* !defined FILENAME_MAX */
140 ** Finally, some convenience items.
145 #endif /* !defined TRUE */
149 #endif /* !defined FALSE */
152 #define TYPE_BIT(type) (sizeof (type) * CHAR_BIT)
153 #endif /* !defined TYPE_BIT */
156 #define TYPE_SIGNED(type) (((type) -1) < 0)
157 #endif /* !defined TYPE_SIGNED */
159 #ifndef INT_STRLEN_MAXIMUM
161 ** 302 / 1000 is log10(2.0) rounded up.
162 ** Subtract one for the sign bit if the type is signed;
163 ** add one for integer division truncation;
164 ** add one more for a minus sign if the type is signed.
166 #define INT_STRLEN_MAXIMUM(type) \
167 ((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 1000 + 1 + TYPE_SIGNED(type))
168 #endif /* !defined INT_STRLEN_MAXIMUM */
177 #endif /* defined lint */
181 #endif /* defined __GNUC__ */
182 #endif /* !defined lint */
183 #endif /* !defined GNUC_or_lint */
187 #define INITIALIZE(x) ((x) = 0)
188 #endif /* defined GNUC_or_lint */
190 #define INITIALIZE(x)
191 #endif /* !defined GNUC_or_lint */
192 #endif /* !defined INITIALIZE */
195 ** For the benefit of GNU folk...
196 ** `_(MSGID)' uses the current locale's message library string for MSGID.
197 ** The default is to use gettext if available, and use MSGID otherwise.
202 #define _(msgid) gettext(msgid)
203 #else /* !(HAVE_GETTEXT - 0) */
204 #define _(msgid) msgid
205 #endif /* !(HAVE_GETTEXT - 0) */
206 #endif /* !defined _ */
209 #define TZ_DOMAIN "tz"
210 #endif /* !defined TZ_DOMAIN */
213 ** UNIX was a registered trademark of UNIX System Laboratories in 1993.
216 #endif /* !defined PRIVATE_H */