]>
git.saurik.com Git - apple/libc.git/blob - stdtime/FreeBSD/private.h
5 ** This file is in the public domain, so clarified as of
6 ** June 5, 1996 by Arthur David Olson (arthur_david_olson@nih.gov).
8 ** $FreeBSD: src/lib/libc/stdtime/private.h,v 1.9 2002/05/28 16:59:40 alfred Exp $
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 ** SunOS 4.1.1 headers lack FILENAME_MAX.
117 #include "sys/param.h"
118 #endif /* defined unix */
119 #endif /* !defined MAXPATHLEN */
122 #define FILENAME_MAX MAXPATHLEN
123 #endif /* defined MAXPATHLEN */
125 #define FILENAME_MAX 1024 /* Pure guesswork */
126 #endif /* !defined MAXPATHLEN */
128 #endif /* !defined FILENAME_MAX */
131 ** Finally, some convenience items.
136 #endif /* !defined TRUE */
140 #endif /* !defined FALSE */
143 #define TYPE_BIT(type) (sizeof (type) * CHAR_BIT)
144 #endif /* !defined TYPE_BIT */
147 #define TYPE_SIGNED(type) (((type) -1) < 0)
148 #endif /* !defined TYPE_SIGNED */
150 #ifndef INT_STRLEN_MAXIMUM
152 ** 302 / 1000 is log10(2.0) rounded up.
153 ** Subtract one for the sign bit if the type is signed;
154 ** add one for integer division truncation;
155 ** add one more for a minus sign if the type is signed.
157 #define INT_STRLEN_MAXIMUM(type) \
158 ((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 1000 + 1 + TYPE_SIGNED(type))
159 #endif /* !defined INT_STRLEN_MAXIMUM */
168 #endif /* defined lint */
172 #endif /* defined __GNUC__ */
173 #endif /* !defined lint */
174 #endif /* !defined GNUC_or_lint */
178 #define INITIALIZE(x) ((x) = 0)
179 #endif /* defined GNUC_or_lint */
181 #define INITIALIZE(x)
182 #endif /* !defined GNUC_or_lint */
183 #endif /* !defined INITIALIZE */
186 ** For the benefit of GNU folk...
187 ** `_(MSGID)' uses the current locale's message library string for MSGID.
188 ** The default is to use gettext if available, and use MSGID otherwise.
193 #define _(msgid) gettext(msgid)
194 #else /* !(HAVE_GETTEXT - 0) */
195 #define _(msgid) msgid
196 #endif /* !(HAVE_GETTEXT - 0) */
197 #endif /* !defined _ */
200 #define TZ_DOMAIN "tz"
201 #endif /* !defined TZ_DOMAIN */
204 ** UNIX was a registered trademark of UNIX System Laboratories in 1993.
207 #endif /* !defined PRIVATE_H */