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 # if @GNULIB_TIMESPEC_GETRES@
126 # if ! @HAVE_TIMESPEC_GETRES@
127 _GL_FUNCDECL_SYS (timespec_getres, int, (struct timespec *ts, int base)
128 _GL_ARG_NONNULL ((1)));
129 # endif
130 _GL_CXXALIAS_SYS (timespec_getres, int, (struct timespec *ts, int base));
131 _GL_CXXALIASWARN (timespec_getres);
132 # endif
133
134
135
136
137 # if @GNULIB_NANOSLEEP@
138 # if @REPLACE_NANOSLEEP@
139 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
140 # define nanosleep rpl_nanosleep
141 # endif
142 _GL_FUNCDECL_RPL (nanosleep, int,
143 (struct timespec const *__rqtp, struct timespec *__rmtp)
144 _GL_ARG_NONNULL ((1)));
145 _GL_CXXALIAS_RPL (nanosleep, int,
146 (struct timespec const *__rqtp, struct timespec *__rmtp));
147 # else
148 # if ! @HAVE_NANOSLEEP@
149 _GL_FUNCDECL_SYS (nanosleep, int,
150 (struct timespec const *__rqtp, struct timespec *__rmtp)
151 _GL_ARG_NONNULL ((1)));
152 # endif
153 _GL_CXXALIAS_SYS (nanosleep, int,
154 (struct timespec const *__rqtp, struct timespec *__rmtp));
155 # endif
156 _GL_CXXALIASWARN (nanosleep);
157 # endif
158
159
160 # if @GNULIB_TZSET@
161 # if @REPLACE_TZSET@
162 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
163 # undef tzset
164 # define tzset rpl_tzset
165 # endif
166 _GL_FUNCDECL_RPL (tzset, void, (void));
167 _GL_CXXALIAS_RPL (tzset, void, (void));
168 # elif defined _WIN32 && !defined __CYGWIN__
169 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
170 # undef tzset
171 # define tzset _tzset
172 # endif
173 _GL_CXXALIAS_MDA (tzset, void, (void));
174 # else
175 _GL_CXXALIAS_SYS (tzset, void, (void));
176 # endif
177 _GL_CXXALIASWARN (tzset);
178 # elif @GNULIB_MDA_TZSET@
179
180
181
182 # if defined _WIN32 && !defined __CYGWIN__
183 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
184 # undef tzset
185 # define tzset _tzset
186 # endif
187 _GL_CXXALIAS_MDA (tzset, void, (void));
188 # else
189 _GL_CXXALIAS_SYS (tzset, void, (void));
190 # endif
191 _GL_CXXALIASWARN (tzset);
192 # endif
193
194
195 # if @GNULIB_MKTIME@
196 # if @REPLACE_MKTIME@
197 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
198 # define mktime rpl_mktime
199 # endif
200 _GL_FUNCDECL_RPL (mktime, time_t, (struct tm *__tp) _GL_ARG_NONNULL ((1)));
201 _GL_CXXALIAS_RPL (mktime, time_t, (struct tm *__tp));
202 # else
203 _GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp));
204 # endif
205 # if __GLIBC__ >= 2
206 _GL_CXXALIASWARN (mktime);
207 # endif
208 # endif
209
210
211
212
213 # if @GNULIB_TIME_R@
214 # if @REPLACE_LOCALTIME_R@
215 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
216 # undef localtime_r
217 # define localtime_r rpl_localtime_r
218 # endif
219 _GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
220 struct tm *restrict __result)
221 _GL_ARG_NONNULL ((1, 2)));
222 _GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
223 struct tm *restrict __result));
224 # else
225 # if ! @HAVE_DECL_LOCALTIME_R@
226 _GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
227 struct tm *restrict __result)
228 _GL_ARG_NONNULL ((1, 2)));
229 # endif
230 _GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
231 struct tm *restrict __result));
232 # endif
233 # if @HAVE_DECL_LOCALTIME_R@
234 _GL_CXXALIASWARN (localtime_r);
235 # endif
236 # if @REPLACE_LOCALTIME_R@
237 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
238 # undef gmtime_r
239 # define gmtime_r rpl_gmtime_r
240 # endif
241 _GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
242 struct tm *restrict __result)
243 _GL_ARG_NONNULL ((1, 2)));
244 _GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
245 struct tm *restrict __result));
246 # else
247 # if ! @HAVE_DECL_LOCALTIME_R@
248 _GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
249 struct tm *restrict __result)
250 _GL_ARG_NONNULL ((1, 2)));
251 # endif
252 _GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
253 struct tm *restrict __result));
254 # endif
255 # if @HAVE_DECL_LOCALTIME_R@
256 _GL_CXXALIASWARN (gmtime_r);
257 # endif
258 # endif
259
260
261
262
263 # if @GNULIB_LOCALTIME@ || @REPLACE_LOCALTIME@
264 # if @REPLACE_LOCALTIME@
265 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
266 # undef localtime
267 # define localtime rpl_localtime
268 # endif
269 _GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer)
270 _GL_ARG_NONNULL ((1)));
271 _GL_CXXALIAS_RPL (localtime, struct tm *, (time_t const *__timer));
272 # else
273 _GL_CXXALIAS_SYS (localtime, struct tm *, (time_t const *__timer));
274 # endif
275 # if __GLIBC__ >= 2
276 _GL_CXXALIASWARN (localtime);
277 # endif
278 # endif
279
280 # if 0 || @REPLACE_GMTIME@
281 # if @REPLACE_GMTIME@
282 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
283 # undef gmtime
284 # define gmtime rpl_gmtime
285 # endif
286 _GL_FUNCDECL_RPL (gmtime, struct tm *, (time_t const *__timer)
287 _GL_ARG_NONNULL ((1)));
288 _GL_CXXALIAS_RPL (gmtime, struct tm *, (time_t const *__timer));
289 # else
290 _GL_CXXALIAS_SYS (gmtime, struct tm *, (time_t const *__timer));
291 # endif
292 _GL_CXXALIASWARN (gmtime);
293 # endif
294
295
296
297
298 # if @GNULIB_STRPTIME@
299 # if ! @HAVE_STRPTIME@
300 _GL_FUNCDECL_SYS (strptime, char *, (char const *restrict __buf,
301 char const *restrict __format,
302 struct tm *restrict __tm)
303 _GL_ARG_NONNULL ((1, 2, 3)));
304 # endif
305 _GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf,
306 char const *restrict __format,
307 struct tm *restrict __tm));
308 _GL_CXXALIASWARN (strptime);
309 # endif
310
311
312
313 # if @GNULIB_CTIME@
314 # if @REPLACE_CTIME@
315 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
316 # define ctime rpl_ctime
317 # endif
318 _GL_FUNCDECL_RPL (ctime, char *, (time_t const *__tp)
319 _GL_ARG_NONNULL ((1)));
320 _GL_CXXALIAS_RPL (ctime, char *, (time_t const *__tp));
321 # else
322 _GL_CXXALIAS_SYS (ctime, char *, (time_t const *__tp));
323 # endif
324 # if __GLIBC__ >= 2
325 _GL_CXXALIASWARN (ctime);
326 # endif
327 # endif
328
329
330
331 # if @GNULIB_STRFTIME@
332 # if @REPLACE_STRFTIME@
333 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
334 # define strftime rpl_strftime
335 # endif
336 _GL_FUNCDECL_RPL (strftime, size_t,
337 (char *restrict __buf, size_t __bufsize,
338 const char *restrict __fmt, const struct tm *restrict __tp)
339 _GL_ARG_NONNULL ((1, 3, 4)));
340 _GL_CXXALIAS_RPL (strftime, size_t,
341 (char *restrict __buf, size_t __bufsize,
342 const char *restrict __fmt, const struct tm *restrict __tp));
343 # else
344 _GL_CXXALIAS_SYS (strftime, size_t,
345 (char *restrict __buf, size_t __bufsize,
346 const char *restrict __fmt, const struct tm *restrict __tp));
347 # endif
348 # if __GLIBC__ >= 2
349 _GL_CXXALIASWARN (strftime);
350 # endif
351 # endif
352
353 # if defined _GNU_SOURCE && @GNULIB_TIME_RZ@ && ! @HAVE_TIMEZONE_T@
354
355
356
357
358
359
360 typedef struct tm_zone *timezone_t;
361
362
363
364
365
366
367
368
369
370 _GL_FUNCDECL_SYS (tzalloc, timezone_t, (char const *__name));
371 _GL_CXXALIAS_SYS (tzalloc, timezone_t, (char const *__name));
372
373
374
375
376 _GL_FUNCDECL_SYS (tzfree, void, (timezone_t __tz));
377 _GL_CXXALIAS_SYS (tzfree, void, (timezone_t __tz));
378
379
380
381
382
383
384 _GL_FUNCDECL_SYS (localtime_rz, struct tm *,
385 (timezone_t __tz, time_t const *restrict __timer,
386 struct tm *restrict __result) _GL_ARG_NONNULL ((2, 3)));
387 _GL_CXXALIAS_SYS (localtime_rz, struct tm *,
388 (timezone_t __tz, time_t const *restrict __timer,
389 struct tm *restrict __result));
390
391
392
393
394
395
396 _GL_FUNCDECL_SYS (mktime_z, time_t,
397 (timezone_t __tz, struct tm *restrict __tm)
398 _GL_ARG_NONNULL ((2)));
399 _GL_CXXALIAS_SYS (mktime_z, time_t,
400 (timezone_t __tz, struct tm *restrict __tm));
401
402
403
404
405
406
407
408 # endif
409
410
411 # if @GNULIB_TIMEGM@
412 # if @REPLACE_TIMEGM@
413 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
414 # undef timegm
415 # define timegm rpl_timegm
416 # endif
417 _GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
418 _GL_CXXALIAS_RPL (timegm, time_t, (struct tm *__tm));
419 # else
420 # if ! @HAVE_TIMEGM@
421 _GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
422 # endif
423 _GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm));
424 # endif
425 _GL_CXXALIASWARN (timegm);
426 # endif
427
428
429
430
431 # if defined GNULIB_POSIXCHECK
432 # undef asctime
433 _GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - "
434 "better use strftime (or even sprintf) instead");
435 # endif
436 # if defined GNULIB_POSIXCHECK
437 # undef asctime_r
438 # if HAVE_RAW_DECL_ASCTIME_R
439 _GL_WARN_ON_USE (asctime_r, "asctime_r can overrun buffers in some cases - "
440 "better use strftime (or even sprintf) instead");
441 # endif
442 # endif
443 # if defined GNULIB_POSIXCHECK
444 # undef ctime
445 _GL_WARN_ON_USE (ctime, "ctime can overrun buffers in some cases - "
446 "better use strftime (or even sprintf) instead");
447 # endif
448 # if defined GNULIB_POSIXCHECK
449 # undef ctime_r
450 # if HAVE_RAW_DECL_CTIME_R
451 _GL_WARN_ON_USE (ctime_r, "ctime_r can overrun buffers in some cases - "
452 "better use strftime (or even sprintf) instead");
453 # endif
454 # endif
455
456 #endif