6 ** This file is in the public domain, so clarified as of
7 ** June 5, 1996 by Arthur David Olson (arthur_david_olson@nih.gov).
11 ** This header is for use ONLY with the time conversion code.
12 ** There is no guarantee that it will remain unchanged,
13 ** or that it will remain at all.
14 ** Do NOT copy it to any system include directory.
24 static char privatehid[] = "@(#)private.h 7.43";
25 #endif /* !defined NOID */
26 #endif /* !defined lint */
29 ** Defaults for preprocessor symbols.
30 ** You can override these in your C compiler options, e.g. `-DHAVE_ADJTIME=0'.
34 #define HAVE_ADJTIME 1
35 #endif /* !defined HAVE_ADJTIME */
38 #define HAVE_GETTEXT 0
39 #endif /* !defined HAVE_GETTEXT */
41 #ifndef HAVE_SETTIMEOFDAY
42 #define HAVE_SETTIMEOFDAY 3
43 #endif /* !defined HAVE_SETTIMEOFDAY */
46 #define HAVE_STRERROR 0
47 #endif /* !defined HAVE_STRERROR */
50 #define HAVE_UNISTD_H 1
51 #endif /* !defined HAVE_UNISTD_H */
54 #define HAVE_UTMPX_H 0
55 #endif /* !defined HAVE_UTMPX_H */
58 #define LOCALE_HOME "/usr/lib/locale"
59 #endif /* !defined LOCALE_HOME */
65 #include "sys/types.h" /* for time_t */
69 #include "limits.h" /* for CHAR_BIT */
75 #endif /* HAVE_GETTEXT - 0 */
78 #include "unistd.h" /* for F_OK and R_OK */
79 #endif /* HAVE_UNISTD_H - 0 */
81 #if !(HAVE_UNISTD_H - 0)
84 #endif /* !defined F_OK */
87 #endif /* !defined R_OK */
88 #endif /* !(HAVE_UNISTD_H - 0) */
90 /* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX. */
91 #define is_digit(c) ((unsigned)(c) - '0' <= 9)
94 ** Workarounds for compilers/systems.
98 ** SunOS 4.1.1 cc lacks const.
104 #endif /* !defined __STDC__ */
105 #endif /* !defined const */
108 ** SunOS 4.1.1 cc lacks prototypes.
114 #endif /* defined __STDC__ */
117 #endif /* !defined __STDC__ */
118 #endif /* !defined P */
121 ** SunOS 4.1.1 headers lack EXIT_SUCCESS.
125 #define EXIT_SUCCESS 0
126 #endif /* !defined EXIT_SUCCESS */
129 ** SunOS 4.1.1 headers lack EXIT_FAILURE.
133 #define EXIT_FAILURE 1
134 #endif /* !defined EXIT_FAILURE */
137 ** SunOS 4.1.1 headers lack FILENAME_MAX.
144 #include "sys/param.h"
145 #endif /* defined unix */
146 #endif /* !defined MAXPATHLEN */
149 #define FILENAME_MAX MAXPATHLEN
150 #endif /* defined MAXPATHLEN */
152 #define FILENAME_MAX 1024 /* Pure guesswork */
153 #endif /* !defined MAXPATHLEN */
155 #endif /* !defined FILENAME_MAX */
158 ** SunOS 4.1.1 libraries lack remove.
162 extern int unlink P((const char * filename));
163 #define remove unlink
164 #endif /* !defined remove */
167 ** Some ancient errno.h implementations don't declare errno.
168 ** But some newer errno.h implementations define it as a macro.
169 ** Fix the former without affecting the latter.
173 #endif /* !defined errno */
176 ** Finally, some convenience items.
181 #endif /* !defined TRUE */
185 #endif /* !defined FALSE */
188 #define TYPE_BIT(type) (sizeof (type) * CHAR_BIT)
189 #endif /* !defined TYPE_BIT */
192 #define TYPE_SIGNED(type) (((type) -1) < 0)
193 #endif /* !defined TYPE_SIGNED */
195 #ifndef INT_STRLEN_MAXIMUM
197 ** 302 / 1000 is log10(2.0) rounded up.
198 ** Subtract one for the sign bit if the type is signed;
199 ** add one for integer division truncation;
200 ** add one more for a minus sign if the type is signed.
202 #define INT_STRLEN_MAXIMUM(type) \
203 ((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 100 + 1 + TYPE_SIGNED(type))
204 #endif /* !defined INT_STRLEN_MAXIMUM */
213 #endif /* defined lint */
217 #endif /* defined __GNUC__ */
218 #endif /* !defined lint */
219 #endif /* !defined GNUC_or_lint */
223 #define INITIALIZE(x) ((x) = 0)
224 #endif /* defined GNUC_or_lint */
226 #define INITIALIZE(x)
227 #endif /* !defined GNUC_or_lint */
228 #endif /* !defined INITIALIZE */
231 ** For the benefit of GNU folk...
232 ** `_(MSGID)' uses the current locale's message library string for MSGID.
233 ** The default is to use gettext if available, and use MSGID otherwise.
238 #define _(msgid) gettext(msgid)
239 #else /* !(HAVE_GETTEXT - 0) */
240 #define _(msgid) msgid
241 #endif /* !(HAVE_GETTEXT - 0) */
242 #endif /* !defined _ */
245 #define TZ_DOMAIN "tz"
246 #endif /* !defined TZ_DOMAIN */
249 ** UNIX was a registered trademark of UNIX System Laboratories in 1993.
252 #endif /* !defined PRIVATE_H */