6 ** This header is for use ONLY with the time conversion code.
7 ** There is no guarantee that it will remain unchanged,
8 ** or that it will remain at all.
9 ** Do NOT copy it to any system include directory.
19 static char privatehid
[] = "@(#)private.h 7.42";
20 #endif /* !defined NOID */
21 #endif /* !defined lint */
24 ** Defaults for preprocessor symbols.
25 ** You can override these in your C compiler options, e.g. `-DHAVE_ADJTIME=0'.
29 #define HAVE_ADJTIME 1
30 #endif /* !defined HAVE_ADJTIME */
33 #define HAVE_GETTEXT 0
34 #endif /* !defined HAVE_GETTEXT */
36 #ifndef HAVE_SETTIMEOFDAY
37 #define HAVE_SETTIMEOFDAY 3
38 #endif /* !defined HAVE_SETTIMEOFDAY */
41 #define HAVE_STRERROR 0
42 #endif /* !defined HAVE_STRERROR */
45 #define HAVE_UNISTD_H 1
46 #endif /* !defined HAVE_UNISTD_H */
49 #define HAVE_UTMPX_H 0
50 #endif /* !defined HAVE_UTMPX_H */
53 #define LOCALE_HOME "/usr/lib/locale"
54 #endif /* !defined LOCALE_HOME */
60 #include "sys/types.h" /* for time_t */
64 #include "limits.h" /* for CHAR_BIT */
70 #endif /* HAVE_GETTEXT - 0 */
73 #include "unistd.h" /* for F_OK and R_OK */
74 #endif /* HAVE_UNISTD_H - 0 */
76 #if !(HAVE_UNISTD_H - 0)
79 #endif /* !defined F_OK */
82 #endif /* !defined R_OK */
83 #endif /* !(HAVE_UNISTD_H - 0) */
85 /* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX. */
86 #define is_digit(c) ((unsigned)(c) - '0' <= 9)
89 ** Workarounds for compilers/systems.
93 ** SunOS 4.1.1 cc lacks const.
99 #endif /* !defined __STDC__ */
100 #endif /* !defined const */
103 ** SunOS 4.1.1 cc lacks prototypes.
109 #endif /* defined __STDC__ */
112 #endif /* !defined __STDC__ */
113 #endif /* !defined P */
116 ** SunOS 4.1.1 headers lack EXIT_SUCCESS.
120 #define EXIT_SUCCESS 0
121 #endif /* !defined EXIT_SUCCESS */
124 ** SunOS 4.1.1 headers lack EXIT_FAILURE.
128 #define EXIT_FAILURE 1
129 #endif /* !defined EXIT_FAILURE */
132 ** SunOS 4.1.1 headers lack FILENAME_MAX.
139 #include "sys/param.h"
140 #endif /* defined unix */
141 #endif /* !defined MAXPATHLEN */
144 #define FILENAME_MAX MAXPATHLEN
145 #endif /* defined MAXPATHLEN */
147 #define FILENAME_MAX 1024 /* Pure guesswork */
148 #endif /* !defined MAXPATHLEN */
150 #endif /* !defined FILENAME_MAX */
153 ** SunOS 4.1.1 libraries lack remove.
157 extern int unlink
P((const char * filename
));
158 #define remove unlink
159 #endif /* !defined remove */
162 ** Some ancient errno.h implementations don't declare errno.
163 ** But some newer errno.h implementations define it as a macro.
164 ** Fix the former without affecting the latter.
168 #endif /* !defined errno */
171 ** Finally, some convenience items.
176 #endif /* !defined TRUE */
180 #endif /* !defined FALSE */
183 #define TYPE_BIT(type) (sizeof (type) * CHAR_BIT)
184 #endif /* !defined TYPE_BIT */
187 #define TYPE_SIGNED(type) (((type) -1) < 0)
188 #endif /* !defined TYPE_SIGNED */
190 #ifndef INT_STRLEN_MAXIMUM
192 ** 302 / 1000 is log10(2.0) rounded up.
193 ** Subtract one for the sign bit if the type is signed;
194 ** add one for integer division truncation;
195 ** add one more for a minus sign if the type is signed.
197 #define INT_STRLEN_MAXIMUM(type) \
198 ((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 100 + 1 + TYPE_SIGNED(type))
199 #endif /* !defined INT_STRLEN_MAXIMUM */
208 #endif /* defined lint */
212 #endif /* defined __GNUC__ */
213 #endif /* !defined lint */
214 #endif /* !defined GNUC_or_lint */
218 #define INITIALIZE(x) ((x) = 0)
219 #endif /* defined GNUC_or_lint */
221 #define INITIALIZE(x)
222 #endif /* !defined GNUC_or_lint */
223 #endif /* !defined INITIALIZE */
226 ** For the benefit of GNU folk...
227 ** `_(MSGID)' uses the current locale's message library string for MSGID.
228 ** The default is to use gettext if available, and use MSGID otherwise.
233 #define _(msgid) gettext(msgid)
234 #else /* !(HAVE_GETTEXT - 0) */
235 #define _(msgid) msgid
236 #endif /* !(HAVE_GETTEXT - 0) */
237 #endif /* !defined _ */
240 #define TZ_DOMAIN "tz"
241 #endif /* !defined TZ_DOMAIN */
244 ** UNIX was a registered trademark of UNIX System Laboratories in 1993.
247 #endif /* !defined PRIVATE_H */