1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #if __GNUC__ >= 3
19 @PRAGMA_SYSTEM_HEADER@
20 #endif
21 @PRAGMA_COLUMNS@
22
23
24
25
26
27
28
29 #if (((defined __need_time_t || defined __need_clock_t \
30 || defined __need_timespec) \
31 && !defined __MINGW32__) \
32 || defined _@GUARD_PREFIX@_TIME_H)
33
34 # @INCLUDE_NEXT@ @NEXT_TIME_H@
35
36 #else
37
38 # define _@GUARD_PREFIX@_TIME_H
39
40
41
42 # if defined __MINGW32__
43 # include <unistd.h>
44 # endif
45
46 # @INCLUDE_NEXT@ @NEXT_TIME_H@
47
48
49 # include <stddef.h>
50
51
52
53
54
55
56
57
58
59
60
61 # if ! @TIME_H_DEFINES_STRUCT_TIMESPEC@
62 # if @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
63 # include <sys/time.h>
64 # elif @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
65 # include <pthread.h>
66 # elif @UNISTD_H_DEFINES_STRUCT_TIMESPEC@
67 # include <unistd.h>
68 # else
69
70 # ifdef __cplusplus
71 extern "C" {
72 # endif
73
74 # if !GNULIB_defined_struct_timespec
75 # undef timespec
76 # define timespec rpl_timespec
77 struct timespec
78 {
79 time_t tv_sec;
80 long int tv_nsec;
81 };
82 # define GNULIB_defined_struct_timespec 1
83 # endif
84
85 # ifdef __cplusplus
86 }
87 # endif
88
89 # endif
90 # endif
91
92 # if !GNULIB_defined_struct_time_t_must_be_integral
93
94
95
96
97
98 struct __time_t_must_be_integral {
99 unsigned int __floating_time_t_unsupported : (time_t) 1;
100 };
101 # define GNULIB_defined_struct_time_t_must_be_integral 1
102 # endif
103
104
105 # if ! @TIME_H_DEFINES_TIME_UTC@
106 # if !GNULIB_defined_TIME_UTC
107 # define TIME_UTC 1
108 # define GNULIB_defined_TIME_UTC 1
109 # endif
110 # endif
111
112
113
114 # if @GNULIB_TIMESPEC_GET@
115 # if ! @HAVE_TIMESPEC_GET@
116 _GL_FUNCDECL_SYS (timespec_get, int, (struct timespec *ts, int base)
117 _GL_ARG_NONNULL ((1)));
118 # endif
119 _GL_CXXALIAS_SYS (timespec_get, int, (struct timespec *ts, int base));
120 _GL_CXXALIASWARN (timespec_get);
121 # endif
122
123
124
125
126 # if @GNULIB_NANOSLEEP@
127 # if @REPLACE_NANOSLEEP@
128 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
129 # define nanosleep rpl_nanosleep
130 # endif
131 _GL_FUNCDECL_RPL (nanosleep, int,
132 (struct timespec const *__rqtp, struct timespec *__rmtp)
133 _GL_ARG_NONNULL ((1)));
134 _GL_CXXALIAS_RPL (nanosleep, int,
135 (struct timespec const *__rqtp, struct timespec *__rmtp));
136 # else
137 # if ! @HAVE_NANOSLEEP@
138 _GL_FUNCDECL_SYS (nanosleep, int,
139 (struct timespec const *__rqtp, struct timespec *__rmtp)
140 _GL_ARG_NONNULL ((1)));
141 # endif
142 _GL_CXXALIAS_SYS (nanosleep, int,
143 (struct timespec const *__rqtp, struct timespec *__rmtp));
144 # endif
145 _GL_CXXALIASWARN (nanosleep);
146 # endif
147
148
149 # if @GNULIB_TZSET@
150 # if @REPLACE_TZSET@
151 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
152 # undef tzset
153 # define tzset rpl_tzset
154 # endif
155 _GL_FUNCDECL_RPL (tzset, void, (void));
156 _GL_CXXALIAS_RPL (tzset, void, (void));
157 # elif defined _WIN32 && !defined __CYGWIN__
158 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
159 # undef tzset
160 # define tzset _tzset
161 # endif
162 _GL_CXXALIAS_MDA (tzset, void, (void));
163 # else
164 _GL_CXXALIAS_SYS (tzset, void, (void));
165 # endif
166 _GL_CXXALIASWARN (tzset);
167 # elif @GNULIB_MDA_TZSET@
168
169
170
171 # if defined _WIN32 && !defined __CYGWIN__
172 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
173 # undef tzset
174 # define tzset _tzset
175 # endif
176 _GL_CXXALIAS_MDA (tzset, void, (void));
177 # else
178 _GL_CXXALIAS_SYS (tzset, void, (void));
179 # endif
180 _GL_CXXALIASWARN (tzset);
181 # endif
182
183
184 # if @GNULIB_MKTIME@
185 # if @REPLACE_MKTIME@
186 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
187 # define mktime rpl_mktime
188 # endif
189 _GL_FUNCDECL_RPL (mktime, time_t, (struct tm *__tp) _GL_ARG_NONNULL ((1)));
190 _GL_CXXALIAS_RPL (mktime, time_t, (struct tm *__tp));
191 # else
192 _GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp));
193 # endif
194 # if __GLIBC__ >= 2
195 _GL_CXXALIASWARN (mktime);
196 # endif
197 # endif
198
199
200
201
202 # if @GNULIB_TIME_R@
203 # if @REPLACE_LOCALTIME_R@
204 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
205 # undef localtime_r
206 # define localtime_r rpl_localtime_r
207 # endif
208 _GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
209 struct tm *restrict __result)
210 _GL_ARG_NONNULL ((1, 2)));
211 _GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
212 struct tm *restrict __result));
213 # else
214 # if ! @HAVE_DECL_LOCALTIME_R@
215 _GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
216 struct tm *restrict __result)
217 _GL_ARG_NONNULL ((1, 2)));
218 # endif
219 _GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
220 struct tm *restrict __result));
221 # endif
222 # if @HAVE_DECL_LOCALTIME_R@
223 _GL_CXXALIASWARN (localtime_r);
224 # endif
225 # if @REPLACE_LOCALTIME_R@
226 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
227 # undef gmtime_r
228 # define gmtime_r rpl_gmtime_r
229 # endif
230 _GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
231 struct tm *restrict __result)
232 _GL_ARG_NONNULL ((1, 2)));
233 _GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
234 struct tm *restrict __result));
235 # else
236 # if ! @HAVE_DECL_LOCALTIME_R@
237 _GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
238 struct tm *restrict __result)
239 _GL_ARG_NONNULL ((1, 2)));
240 # endif
241 _GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
242 struct tm *restrict __result));
243 # endif
244 # if @HAVE_DECL_LOCALTIME_R@
245 _GL_CXXALIASWARN (gmtime_r);
246 # endif
247 # endif
248
249
250
251
252 # if @GNULIB_LOCALTIME@ || @REPLACE_LOCALTIME@
253 # if @REPLACE_LOCALTIME@
254 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
255 # undef localtime
256 # define localtime rpl_localtime
257 # endif
258 _GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer)
259 _GL_ARG_NONNULL ((1)));
260 _GL_CXXALIAS_RPL (localtime, struct tm *, (time_t const *__timer));
261 # else
262 _GL_CXXALIAS_SYS (localtime, struct tm *, (time_t const *__timer));
263 # endif
264 # if __GLIBC__ >= 2
265 _GL_CXXALIASWARN (localtime);
266 # endif
267 # endif
268
269 # if 0 || @REPLACE_GMTIME@
270 # if @REPLACE_GMTIME@
271 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
272 # undef gmtime
273 # define gmtime rpl_gmtime
274 # endif
275 _GL_FUNCDECL_RPL (gmtime, struct tm *, (time_t const *__timer)
276 _GL_ARG_NONNULL ((1)));
277 _GL_CXXALIAS_RPL (gmtime, struct tm *, (time_t const *__timer));
278 # else
279 _GL_CXXALIAS_SYS (gmtime, struct tm *, (time_t const *__timer));
280 # endif
281 _GL_CXXALIASWARN (gmtime);
282 # endif
283
284
285
286
287 # if @GNULIB_STRPTIME@
288 # if ! @HAVE_STRPTIME@
289 _GL_FUNCDECL_SYS (strptime, char *, (char const *restrict __buf,
290 char const *restrict __format,
291 struct tm *restrict __tm)
292 _GL_ARG_NONNULL ((1, 2, 3)));
293 # endif
294 _GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf,
295 char const *restrict __format,
296 struct tm *restrict __tm));
297 _GL_CXXALIASWARN (strptime);
298 # endif
299
300
301
302 # if @GNULIB_CTIME@
303 # if @REPLACE_CTIME@
304 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
305 # define ctime rpl_ctime
306 # endif
307 _GL_FUNCDECL_RPL (ctime, char *, (time_t const *__tp)
308 _GL_ARG_NONNULL ((1)));
309 _GL_CXXALIAS_RPL (ctime, char *, (time_t const *__tp));
310 # else
311 _GL_CXXALIAS_SYS (ctime, char *, (time_t const *__tp));
312 # endif
313 # if __GLIBC__ >= 2
314 _GL_CXXALIASWARN (ctime);
315 # endif
316 # endif
317
318
319
320 # if @GNULIB_STRFTIME@
321 # if @REPLACE_STRFTIME@
322 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
323 # define strftime rpl_strftime
324 # endif
325 _GL_FUNCDECL_RPL (strftime, size_t,
326 (char *restrict __buf, size_t __bufsize,
327 const char *restrict __fmt, const struct tm *restrict __tp)
328 _GL_ARG_NONNULL ((1, 3, 4)));
329 _GL_CXXALIAS_RPL (strftime, size_t,
330 (char *restrict __buf, size_t __bufsize,
331 const char *restrict __fmt, const struct tm *restrict __tp));
332 # else
333 _GL_CXXALIAS_SYS (strftime, size_t,
334 (char *restrict __buf, size_t __bufsize,
335 const char *restrict __fmt, const struct tm *restrict __tp));
336 # endif
337 # if __GLIBC__ >= 2
338 _GL_CXXALIASWARN (strftime);
339 # endif
340 # endif
341
342 # if defined _GNU_SOURCE && @GNULIB_TIME_RZ@ && ! @HAVE_TIMEZONE_T@
343
344
345
346
347
348
349 typedef struct tm_zone *timezone_t;
350
351
352
353
354
355
356
357
358
359 _GL_FUNCDECL_SYS (tzalloc, timezone_t, (char const *__name));
360 _GL_CXXALIAS_SYS (tzalloc, timezone_t, (char const *__name));
361
362
363
364
365 _GL_FUNCDECL_SYS (tzfree, void, (timezone_t __tz));
366 _GL_CXXALIAS_SYS (tzfree, void, (timezone_t __tz));
367
368
369
370
371
372
373 _GL_FUNCDECL_SYS (localtime_rz, struct tm *,
374 (timezone_t __tz, time_t const *restrict __timer,
375 struct tm *restrict __result) _GL_ARG_NONNULL ((2, 3)));
376 _GL_CXXALIAS_SYS (localtime_rz, struct tm *,
377 (timezone_t __tz, time_t const *restrict __timer,
378 struct tm *restrict __result));
379
380
381
382
383
384
385 _GL_FUNCDECL_SYS (mktime_z, time_t,
386 (timezone_t __tz, struct tm *restrict __tm)
387 _GL_ARG_NONNULL ((2)));
388 _GL_CXXALIAS_SYS (mktime_z, time_t,
389 (timezone_t __tz, struct tm *restrict __tm));
390
391
392
393
394
395
396
397 # endif
398
399
400 # if @GNULIB_TIMEGM@
401 # if @REPLACE_TIMEGM@
402 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
403 # undef timegm
404 # define timegm rpl_timegm
405 # endif
406 _GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
407 _GL_CXXALIAS_RPL (timegm, time_t, (struct tm *__tm));
408 # else
409 # if ! @HAVE_TIMEGM@
410 _GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
411 # endif
412 _GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm));
413 # endif
414 _GL_CXXALIASWARN (timegm);
415 # endif
416
417
418
419
420 # if defined GNULIB_POSIXCHECK
421 # undef asctime
422 _GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - "
423 "better use strftime (or even sprintf) instead");
424 # endif
425 # if defined GNULIB_POSIXCHECK
426 # undef asctime_r
427 _GL_WARN_ON_USE (asctime_r, "asctime_r can overrun buffers in some cases - "
428 "better use strftime (or even sprintf) instead");
429 # endif
430 # if defined GNULIB_POSIXCHECK
431 # undef ctime
432 _GL_WARN_ON_USE (ctime, "ctime can overrun buffers in some cases - "
433 "better use strftime (or even sprintf) instead");
434 # endif
435 # if defined GNULIB_POSIXCHECK
436 # undef ctime_r
437 _GL_WARN_ON_USE (ctime_r, "ctime_r can overrun buffers in some cases - "
438 "better use strftime (or even sprintf) instead");
439 # endif
440
441 #endif