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