Wed Nov 15 19:22:07 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
[glibc.git] / time / private.h
blob651a6f1b56809f77a93ec2eaca7cc58b5d7ef7b7
1 #ifndef PRIVATE_H
3 #define PRIVATE_H
5 /*
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.
10 ** Thank you!
14 ** ID
17 #ifndef lint
18 #ifndef NOID
19 static char privatehid[] = "@(#)private.h 7.33";
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'.
28 #ifndef HAVE_ADJTIME
29 #define HAVE_ADJTIME 1
30 #endif /* !defined HAVE_ADJTIME */
32 #ifndef HAVE_SETTIMEOFDAY
33 #define HAVE_SETTIMEOFDAY 3
34 #endif /* !defined HAVE_SETTIMEOFDAY */
36 #ifndef HAVE_UNISTD_H
37 #define HAVE_UNISTD_H 1
38 #endif /* !defined HAVE_UNISTD_H */
40 #ifndef LOCALE_HOME
41 #define LOCALE_HOME "/usr/lib/locale"
42 #endif /* !defined LOCALE_HOME */
45 ** Nested includes
48 #include "sys/types.h" /* for time_t */
49 #include "stdio.h"
50 #include "ctype.h"
51 #include "errno.h"
52 #include "string.h"
53 #include "limits.h" /* for CHAR_BIT */
54 #include "time.h"
55 #include "stdlib.h"
57 #if HAVE_UNISTD_H - 0
58 #include "unistd.h" /* for F_OK and R_OK */
59 #endif /* HAVE_UNISTD_H - 0 */
61 #if !(HAVE_UNISTD_H - 0)
62 #ifndef F_OK
63 #define F_OK 0
64 #endif /* !defined F_OK */
65 #ifndef R_OK
66 #define R_OK 4
67 #endif /* !defined R_OK */
68 #endif /* !(HAVE_UNISTD_H - 0) */
71 ** Workarounds for compilers/systems.
75 ** SunOS 4.1.1 cc lacks const.
78 #ifndef const
79 #ifndef __STDC__
80 #define const
81 #endif /* !defined __STDC__ */
82 #endif /* !defined const */
85 ** SunOS 4.1.1 cc lacks prototypes.
88 #ifndef P
89 #ifdef __STDC__
90 #define P(x) x
91 #endif /* defined __STDC__ */
92 #ifndef __STDC__
93 #define P(x) ()
94 #endif /* !defined __STDC__ */
95 #endif /* !defined P */
98 ** SunOS 4.1.1 headers lack EXIT_SUCCESS.
101 #ifndef EXIT_SUCCESS
102 #define EXIT_SUCCESS 0
103 #endif /* !defined EXIT_SUCCESS */
106 ** SunOS 4.1.1 headers lack EXIT_FAILURE.
109 #ifndef EXIT_FAILURE
110 #define EXIT_FAILURE 1
111 #endif /* !defined EXIT_FAILURE */
114 ** SunOS 4.1.1 headers lack FILENAME_MAX.
117 #ifndef FILENAME_MAX
119 #ifndef MAXPATHLEN
120 #ifdef unix
121 #include "sys/param.h"
122 #endif /* defined unix */
123 #endif /* !defined MAXPATHLEN */
125 #ifdef MAXPATHLEN
126 #define FILENAME_MAX MAXPATHLEN
127 #endif /* defined MAXPATHLEN */
128 #ifndef MAXPATHLEN
129 #define FILENAME_MAX 1024 /* Pure guesswork */
130 #endif /* !defined MAXPATHLEN */
132 #endif /* !defined FILENAME_MAX */
135 ** SunOS 4.1.1 libraries lack remove.
138 #ifndef remove
139 extern int unlink P((const char * filename));
140 #define remove unlink
141 #endif /* !defined remove */
144 ** Finally, some convenience items.
147 #ifndef TRUE
148 #define TRUE 1
149 #endif /* !defined TRUE */
151 #ifndef FALSE
152 #define FALSE 0
153 #endif /* !defined FALSE */
155 #ifndef INT_STRLEN_MAXIMUM
157 ** 302 / 1000 is log10(2.0) rounded up.
158 ** Subtract one for the sign bit;
159 ** add one for integer division truncation;
160 ** add one more for a minus sign.
162 #define INT_STRLEN_MAXIMUM(type) \
163 ((sizeof(type) * CHAR_BIT - 1) * 302 / 1000 + 2)
164 #endif /* !defined INT_STRLEN_MAXIMUM */
167 ** INITIALIZE(x)
170 #ifndef GNUC_or_lint
171 #ifdef lint
172 #define GNUC_or_lint
173 #endif /* defined lint */
174 #ifndef lint
175 #ifdef __GNUC__
176 #define GNUC_or_lint
177 #endif /* defined __GNUC__ */
178 #endif /* !defined lint */
179 #endif /* !defined GNUC_or_lint */
181 #ifndef INITIALIZE
182 #ifdef GNUC_or_lint
183 #define INITIALIZE(x) ((x) = 0)
184 #endif /* defined GNUC_or_lint */
185 #ifndef GNUC_or_lint
186 #define INITIALIZE(x)
187 #endif /* !defined GNUC_or_lint */
188 #endif /* !defined INITIALIZE */
191 ** UNIX was a registered trademark of UNIX System Laboratories in 1993.
194 #endif /* !defined PRIVATE_H */