6 ** This file is in the public domain, so clarified as of
7 ** 1996-06-05 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.
40 static char privatehid[] = "@(#)private.h 7.53";
42 #endif /* !defined NOID */
43 #endif /* !defined lint */
46 ** Defaults for preprocessor symbols.
47 ** You can override these in your C compiler options, e.g. `-DHAVE_ADJTIME=0'.
51 #define HAVE_ADJTIME 1
52 #endif /* !defined HAVE_ADJTIME */
55 #define HAVE_GETTEXT 0
56 #endif /* !defined HAVE_GETTEXT */
58 #ifndef HAVE_INCOMPATIBLE_CTIME_R
59 #define HAVE_INCOMPATIBLE_CTIME_R 0
60 #endif /* !defined INCOMPATIBLE_CTIME_R */
62 #ifndef HAVE_SETTIMEOFDAY
63 #define HAVE_SETTIMEOFDAY 3
64 #endif /* !defined HAVE_SETTIMEOFDAY */
67 #define HAVE_STRERROR 1
68 #endif /* !defined HAVE_STRERROR */
71 #define HAVE_SYMLINK 1
72 #endif /* !defined HAVE_SYMLINK */
74 #ifndef HAVE_SYS_STAT_H
75 #define HAVE_SYS_STAT_H 1
76 #endif /* !defined HAVE_SYS_STAT_H */
78 #ifndef HAVE_SYS_WAIT_H
79 #define HAVE_SYS_WAIT_H 1
80 #endif /* !defined HAVE_SYS_WAIT_H */
83 #define HAVE_UNISTD_H 1
84 #endif /* !defined HAVE_UNISTD_H */
87 #define HAVE_UTMPX_H 0
88 #endif /* !defined HAVE_UTMPX_H */
91 #define LOCALE_HOME "/usr/lib/locale"
92 #endif /* !defined LOCALE_HOME */
94 #if HAVE_INCOMPATIBLE_CTIME_R
95 #define asctime_r _incompatible_asctime_r
96 #define ctime_r _incompatible_ctime_r
97 #endif /* HAVE_INCOMPATIBLE_CTIME_R */
103 #include "sys/types.h" /* for time_t */
107 #include "limits.h" /* for CHAR_BIT */
113 #endif /* HAVE_GETTEXT - 0 */
115 #if HAVE_SYS_WAIT_H - 0
116 #include <sys/wait.h> /* for WIFEXITED and WEXITSTATUS */
117 #endif /* HAVE_SYS_WAIT_H - 0 */
120 #define WIFEXITED(status) (((status) & 0xff) == 0)
121 #endif /* !defined WIFEXITED */
123 #define WEXITSTATUS(status) (((status) >> 8) & 0xff)
124 #endif /* !defined WEXITSTATUS */
126 #if HAVE_UNISTD_H - 0
127 #include "unistd.h" /* for F_OK and R_OK */
128 #endif /* HAVE_UNISTD_H - 0 */
130 #if !(HAVE_UNISTD_H - 0)
133 #endif /* !defined F_OK */
136 #endif /* !defined R_OK */
137 #endif /* !(HAVE_UNISTD_H - 0) */
139 /* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX. */
140 #define is_digit(c) ((unsigned)(c) - '0' <= 9)
143 ** SunOS 4.1.1 headers lack FILENAME_MAX.
150 #include "sys/param.h"
151 #endif /* defined unix */
152 #endif /* !defined MAXPATHLEN */
155 #define FILENAME_MAX MAXPATHLEN
156 #endif /* defined MAXPATHLEN */
158 #define FILENAME_MAX 1024 /* Pure guesswork */
159 #endif /* !defined MAXPATHLEN */
161 #endif /* !defined FILENAME_MAX */
164 ** Private function declarations.
166 char * icalloc(int nelem, int elsize);
167 char * icatalloc(char * old, const char * new);
168 char * icpyalloc(const char * string);
169 char * imalloc(int n);
170 void * irealloc(void * pointer, int size);
171 void icfree(char * pointer);
172 void ifree(char * pointer);
173 char * scheck(const char *string, const char *format);
177 ** Finally, some convenience items.
182 #endif /* !defined TRUE */
186 #endif /* !defined FALSE */
189 #define TYPE_BIT(type) (sizeof (type) * CHAR_BIT)
190 #endif /* !defined TYPE_BIT */
193 #define TYPE_SIGNED(type) (((type) -1) < 0)
194 #endif /* !defined TYPE_SIGNED */
196 #ifndef INT_STRLEN_MAXIMUM
198 ** 302 / 1000 is log10(2.0) rounded up.
199 ** Subtract one for the sign bit if the type is signed;
200 ** add one for integer division truncation;
201 ** add one more for a minus sign if the type is signed.
203 #define INT_STRLEN_MAXIMUM(type) \
204 ((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 1000 + 1 + TYPE_SIGNED(type))
205 #endif /* !defined INT_STRLEN_MAXIMUM */
214 #endif /* defined lint */
218 #endif /* defined __GNUC__ */
219 #endif /* !defined lint */
220 #endif /* !defined GNUC_or_lint */
224 #define INITIALIZE(x) ((x) = 0)
225 #endif /* defined GNUC_or_lint */
227 #define INITIALIZE(x)
228 #endif /* !defined GNUC_or_lint */
229 #endif /* !defined INITIALIZE */
232 ** For the benefit of GNU folk...
233 ** `_(MSGID)' uses the current locale's message library string for MSGID.
234 ** The default is to use gettext if available, and use MSGID otherwise.
239 #define _(msgid) gettext(msgid)
240 #else /* !(HAVE_GETTEXT - 0) */
241 #define _(msgid) msgid
242 #endif /* !(HAVE_GETTEXT - 0) */
243 #endif /* !defined _ */
246 #define TZ_DOMAIN "tz"
247 #endif /* !defined TZ_DOMAIN */
249 #if HAVE_INCOMPATIBLE_CTIME_R
252 char *asctime_r(struct tm const *, char *);
253 char *ctime_r(time_t const *, char *);
254 #endif /* HAVE_INCOMPATIBLE_CTIME_R */
257 ** UNIX was a registered trademark of The Open Group in 2003.
260 #endif /* !defined PRIVATE_H */