initial import
[glibc.git] / time / private.h
blob8852b8337b87d45a9eb481efe3b92543f38e3d57
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.10";
20 #endif /* !defined NOID */
21 #endif /* !defined lint */
24 ** const
27 #ifndef const
28 #ifndef __STDC__
29 #define const
30 #endif /* !defined __STDC__ */
31 #endif /* !defined const */
34 ** void
37 #ifndef void
38 #ifndef __STDC__
39 #ifndef vax
40 #ifndef sun
41 #define void char
42 #endif /* !defined sun */
43 #endif /* !defined vax */
44 #endif /* !defined __STDC__ */
45 #endif /* !defined void */
48 ** INITIALIZE
51 #ifndef GNUC_or_lint
52 #ifdef lint
53 #define GNUC_or_lint
54 #endif /* defined lint */
55 #ifdef __GNUC__
56 #define GNUC_or_lint
57 #endif /* defined __GNUC__ */
58 #endif /* !defined GNUC_or_lint */
60 #ifndef INITIALIZE
61 #ifdef GNUC_or_lint
62 #define INITIALIZE(x) ((x) = 0)
63 #endif /* defined GNUC_or_lint */
64 #ifndef GNUC_or_lint
65 #define INITIALIZE(x)
66 #endif /* !defined GNUC_or_lint */
67 #endif /* !defined INITIALIZE */
70 ** P((args))
73 #ifndef P
74 #ifdef __STDC__
75 #define P(x) x
76 #endif /* defined __STDC__ */
77 #ifndef __STDC__
78 #define P(x) ()
79 #endif /* !defined __STDC__ */
80 #endif /* !defined P */
83 ** genericptr_T
86 #ifdef __STDC__
87 typedef void * genericptr_T;
88 #endif /* defined __STDC__ */
89 #ifndef __STDC__
90 typedef char * genericptr_T;
91 #endif /* !defined __STDC__ */
93 #include "sys/types.h" /* for time_t */
94 #include "stdio.h"
95 #include "ctype.h"
96 #include "errno.h"
97 #include "string.h"
98 #include "limits.h" /* for CHAR_BIT */
99 #ifndef _TIME_
100 #include "time.h"
101 #endif /* !defined _TIME_ */
103 #ifndef remove
104 extern int unlink P((const char * filename));
105 #define remove unlink
106 #endif /* !defined remove */
108 #ifndef FILENAME_MAX
110 #ifndef MAXPATHLEN
111 #ifdef unix
112 #include "sys/param.h"
113 #endif /* defined unix */
114 #endif /* !defined MAXPATHLEN */
116 #ifdef MAXPATHLEN
117 #define FILENAME_MAX MAXPATHLEN
118 #endif /* defined MAXPATHLEN */
119 #ifndef MAXPATHLEN
120 #define FILENAME_MAX 1024 /* Pure guesswork */
121 #endif /* !defined MAXPATHLEN */
123 #endif /* !defined FILENAME_MAX */
125 #ifndef EXIT_SUCCESS
126 #define EXIT_SUCCESS 0
127 #endif /* !defined EXIT_SUCCESS */
129 #ifndef EXIT_FAILURE
130 #define EXIT_FAILURE 1
131 #endif /* !defined EXIT_FAILURE */
133 #ifdef __STDC__
135 #define alloc_size_T size_t
136 #define qsort_size_T size_t
137 #define fwrite_size_T size_t
139 #endif /* defined __STDC__ */
140 #ifndef __STDC__
142 #ifndef alloc_size_T
143 #define alloc_size_T unsigned
144 #endif /* !defined alloc_size_T */
146 #ifndef qsort_size_T
147 #ifdef USG
148 #define qsort_size_T unsigned
149 #endif /* defined USG */
150 #ifndef USG
151 #define qsort_size_T int
152 #endif /* !defined USG */
153 #endif /* !defined qsort_size_T */
155 #ifndef fwrite_size_T
156 #define fwrite_size_T int
157 #endif /* !defined fwrite_size_T */
159 #ifndef USG
160 extern char * sprintf P((char * buf, const char * format, ...));
161 #endif /* !defined USG */
163 #endif /* !defined __STDC__ */
166 ** Ensure that these are declared--redundantly declaring them shouldn't hurt.
169 extern char * getenv P((const char * name));
170 extern genericptr_T malloc P((alloc_size_T size));
171 extern genericptr_T calloc P((alloc_size_T nelem, alloc_size_T elsize));
172 extern genericptr_T realloc P((genericptr_T oldptr, alloc_size_T newsize));
174 #ifdef USG
175 extern void exit P((int s));
176 extern void qsort P((genericptr_T base, qsort_size_T nelem,
177 qsort_size_T elsize, int (*comp)()));
178 extern void perror P((const char * string));
179 extern void free P((char * buf));
180 #endif /* defined USG */
182 #ifndef TRUE
183 #define TRUE 1
184 #endif /* !defined TRUE */
186 #ifndef FALSE
187 #define FALSE 0
188 #endif /* !defined FALSE */
190 #ifndef INT_STRLEN_MAXIMUM
192 ** 302 / 1000 is log10(2.0) rounded up.
193 ** Subtract one for the sign bit;
194 ** add one for integer division truncation;
195 ** add one more for a minus sign.
197 #define INT_STRLEN_MAXIMUM(type) \
198 ((sizeof(type) * CHAR_BIT - 1) * 302 / 1000 + 2)
199 #endif /* !defined INT_STRLEN_MAXIMUM */
201 #ifndef LOCALE_HOME
202 #define LOCALE_HOME "/usr/lib/locale"
203 #endif /* !defined LOCALE_HOME */
206 ** UNIX was a registered trademark of UNIX System Laboratories in 1993.
207 ** VAX is a trademark of Digital Equipment Corporation.
210 #endif /* !defined PRIVATE_H */