dhcpd-pools  3.0
ISC dhcpd lease usage analyser
time.h
Go to the documentation of this file.
1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2 /* A more-standard <time.h>.
3 
4  Copyright (C) 2007-2017 Free Software Foundation, Inc.
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 3, or (at your option)
9  any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, see <https://www.gnu.org/licenses/>. */
18 
19 #if __GNUC__ >= 3
20 #pragma GCC system_header
21 #endif
22 
23 
24 /* Don't get in the way of glibc when it includes time.h merely to
25  declare a few standard symbols, rather than to declare all the
26  symbols. (However, skip this for MinGW as it treats __need_time_t
27  incompatibly.) Also, Solaris 8 <time.h> eventually includes itself
28  recursively; if that is happening, just include the system <time.h>
29  without adding our own declarations. */
30 #if (((defined __need_time_t || defined __need_clock_t \
31  || defined __need_timespec) \
32  && !defined __MINGW32__) \
33  || defined _GL_TIME_H)
34 
35 # include_next <time.h>
36 
37 #else
38 
39 # define _GL_TIME_H
40 
41 # include_next <time.h>
42 
43 /* NetBSD 5.0 mis-defines NULL. */
44 # include <stddef.h>
45 
46 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
47 /* C++ compatible function declaration macros.
48  Copyright (C) 2010-2017 Free Software Foundation, Inc.
49 
50  This program is free software: you can redistribute it and/or modify it
51  under the terms of the GNU General Public License as published
52  by the Free Software Foundation; either version 3 of the License, or
53  (at your option) any later version.
54 
55  This program is distributed in the hope that it will be useful,
56  but WITHOUT ANY WARRANTY; without even the implied warranty of
57  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
58  General Public License for more details.
59 
60  You should have received a copy of the GNU General Public License
61  along with this program. If not, see <https://www.gnu.org/licenses/>. */
62 
63 #ifndef _GL_CXXDEFS_H
64 #define _GL_CXXDEFS_H
65 
66 /* Begin/end the GNULIB_NAMESPACE namespace. */
67 #if defined __cplusplus && defined GNULIB_NAMESPACE
68 # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
69 # define _GL_END_NAMESPACE }
70 #else
71 # define _GL_BEGIN_NAMESPACE
72 # define _GL_END_NAMESPACE
73 #endif
74 
75 /* The three most frequent use cases of these macros are:
76 
77  * For providing a substitute for a function that is missing on some
78  platforms, but is declared and works fine on the platforms on which
79  it exists:
80 
81  #if @GNULIB_FOO@
82  # if !@HAVE_FOO@
83  _GL_FUNCDECL_SYS (foo, ...);
84  # endif
85  _GL_CXXALIAS_SYS (foo, ...);
86  _GL_CXXALIASWARN (foo);
87  #elif defined GNULIB_POSIXCHECK
88  ...
89  #endif
90 
91  * For providing a replacement for a function that exists on all platforms,
92  but is broken/insufficient and needs to be replaced on some platforms:
93 
94  #if @GNULIB_FOO@
95  # if @REPLACE_FOO@
96  # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
97  # undef foo
98  # define foo rpl_foo
99  # endif
100  _GL_FUNCDECL_RPL (foo, ...);
101  _GL_CXXALIAS_RPL (foo, ...);
102  # else
103  _GL_CXXALIAS_SYS (foo, ...);
104  # endif
105  _GL_CXXALIASWARN (foo);
106  #elif defined GNULIB_POSIXCHECK
107  ...
108  #endif
109 
110  * For providing a replacement for a function that exists on some platforms
111  but is broken/insufficient and needs to be replaced on some of them and
112  is additionally either missing or undeclared on some other platforms:
113 
114  #if @GNULIB_FOO@
115  # if @REPLACE_FOO@
116  # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
117  # undef foo
118  # define foo rpl_foo
119  # endif
120  _GL_FUNCDECL_RPL (foo, ...);
121  _GL_CXXALIAS_RPL (foo, ...);
122  # else
123  # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
124  _GL_FUNCDECL_SYS (foo, ...);
125  # endif
126  _GL_CXXALIAS_SYS (foo, ...);
127  # endif
128  _GL_CXXALIASWARN (foo);
129  #elif defined GNULIB_POSIXCHECK
130  ...
131  #endif
132 */
133 
134 /* _GL_EXTERN_C declaration;
135  performs the declaration with C linkage. */
136 #if defined __cplusplus
137 # define _GL_EXTERN_C extern "C"
138 #else
139 # define _GL_EXTERN_C extern
140 #endif
141 
142 /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
143  declares a replacement function, named rpl_func, with the given prototype,
144  consisting of return type, parameters, and attributes.
145  Example:
146  _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
147  _GL_ARG_NONNULL ((1)));
148  */
149 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
150  _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
151 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
152  _GL_EXTERN_C rettype rpl_func parameters_and_attributes
153 
154 /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
155  declares the system function, named func, with the given prototype,
156  consisting of return type, parameters, and attributes.
157  Example:
158  _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
159  _GL_ARG_NONNULL ((1)));
160  */
161 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
162  _GL_EXTERN_C rettype func parameters_and_attributes
163 
164 /* _GL_CXXALIAS_RPL (func, rettype, parameters);
165  declares a C++ alias called GNULIB_NAMESPACE::func
166  that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
167  Example:
168  _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
169 
170  Wrapping rpl_func in an object with an inline conversion operator
171  avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is
172  actually used in the program. */
173 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
174  _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
175 #if defined __cplusplus && defined GNULIB_NAMESPACE
176 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
177  namespace GNULIB_NAMESPACE \
178  { \
179  static const struct _gl_ ## func ## _wrapper \
180  { \
181  typedef rettype (*type) parameters; \
182  \
183  inline operator type () const \
184  { \
185  return ::rpl_func; \
186  } \
187  } func = {}; \
188  } \
189  _GL_EXTERN_C int _gl_cxxalias_dummy
190 #else
191 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
192  _GL_EXTERN_C int _gl_cxxalias_dummy
193 #endif
194 
195 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
196  is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
197  except that the C function rpl_func may have a slightly different
198  declaration. A cast is used to silence the "invalid conversion" error
199  that would otherwise occur. */
200 #if defined __cplusplus && defined GNULIB_NAMESPACE
201 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
202  namespace GNULIB_NAMESPACE \
203  { \
204  static const struct _gl_ ## func ## _wrapper \
205  { \
206  typedef rettype (*type) parameters; \
207  \
208  inline operator type () const \
209  { \
210  return reinterpret_cast<type>(::rpl_func); \
211  } \
212  } func = {}; \
213  } \
214  _GL_EXTERN_C int _gl_cxxalias_dummy
215 #else
216 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
217  _GL_EXTERN_C int _gl_cxxalias_dummy
218 #endif
219 
220 /* _GL_CXXALIAS_SYS (func, rettype, parameters);
221  declares a C++ alias called GNULIB_NAMESPACE::func
222  that redirects to the system provided function func, if GNULIB_NAMESPACE
223  is defined.
224  Example:
225  _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
226 
227  Wrapping func in an object with an inline conversion operator
228  avoids a reference to func unless GNULIB_NAMESPACE::func is
229  actually used in the program. */
230 #if defined __cplusplus && defined GNULIB_NAMESPACE
231 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
232  namespace GNULIB_NAMESPACE \
233  { \
234  static const struct _gl_ ## func ## _wrapper \
235  { \
236  typedef rettype (*type) parameters; \
237  \
238  inline operator type () const \
239  { \
240  return ::func; \
241  } \
242  } func = {}; \
243  } \
244  _GL_EXTERN_C int _gl_cxxalias_dummy
245 #else
246 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
247  _GL_EXTERN_C int _gl_cxxalias_dummy
248 #endif
249 
250 /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
251  is like _GL_CXXALIAS_SYS (func, rettype, parameters);
252  except that the C function func may have a slightly different declaration.
253  A cast is used to silence the "invalid conversion" error that would
254  otherwise occur. */
255 #if defined __cplusplus && defined GNULIB_NAMESPACE
256 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
257  namespace GNULIB_NAMESPACE \
258  { \
259  static const struct _gl_ ## func ## _wrapper \
260  { \
261  typedef rettype (*type) parameters; \
262  \
263  inline operator type () const \
264  { \
265  return reinterpret_cast<type>(::func); \
266  } \
267  } func = {}; \
268  } \
269  _GL_EXTERN_C int _gl_cxxalias_dummy
270 #else
271 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
272  _GL_EXTERN_C int _gl_cxxalias_dummy
273 #endif
274 
275 /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
276  is like _GL_CXXALIAS_SYS (func, rettype, parameters);
277  except that the C function is picked among a set of overloaded functions,
278  namely the one with rettype2 and parameters2. Two consecutive casts
279  are used to silence the "cannot find a match" and "invalid conversion"
280  errors that would otherwise occur. */
281 #if defined __cplusplus && defined GNULIB_NAMESPACE
282  /* The outer cast must be a reinterpret_cast.
283  The inner cast: When the function is defined as a set of overloaded
284  functions, it works as a static_cast<>, choosing the designated variant.
285  When the function is defined as a single variant, it works as a
286  reinterpret_cast<>. The parenthesized cast syntax works both ways. */
287 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
288  namespace GNULIB_NAMESPACE \
289  { \
290  static const struct _gl_ ## func ## _wrapper \
291  { \
292  typedef rettype (*type) parameters; \
293  \
294  inline operator type () const \
295  { \
296  return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \
297  } \
298  } func = {}; \
299  } \
300  _GL_EXTERN_C int _gl_cxxalias_dummy
301 #else
302 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
303  _GL_EXTERN_C int _gl_cxxalias_dummy
304 #endif
305 
306 /* _GL_CXXALIASWARN (func);
307  causes a warning to be emitted when ::func is used but not when
308  GNULIB_NAMESPACE::func is used. func must be defined without overloaded
309  variants. */
310 #if defined __cplusplus && defined GNULIB_NAMESPACE
311 # define _GL_CXXALIASWARN(func) \
312  _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
313 # define _GL_CXXALIASWARN_1(func,namespace) \
314  _GL_CXXALIASWARN_2 (func, namespace)
315 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
316  we enable the warning only when not optimizing. */
317 # if !__OPTIMIZE__
318 # define _GL_CXXALIASWARN_2(func,namespace) \
319  _GL_WARN_ON_USE (func, \
320  "The symbol ::" #func " refers to the system function. " \
321  "Use " #namespace "::" #func " instead.")
322 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
323 # define _GL_CXXALIASWARN_2(func,namespace) \
324  extern __typeof__ (func) func
325 # else
326 # define _GL_CXXALIASWARN_2(func,namespace) \
327  _GL_EXTERN_C int _gl_cxxalias_dummy
328 # endif
329 #else
330 # define _GL_CXXALIASWARN(func) \
331  _GL_EXTERN_C int _gl_cxxalias_dummy
332 #endif
333 
334 /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
335  causes a warning to be emitted when the given overloaded variant of ::func
336  is used but not when GNULIB_NAMESPACE::func is used. */
337 #if defined __cplusplus && defined GNULIB_NAMESPACE
338 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
339  _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
340  GNULIB_NAMESPACE)
341 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
342  _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
343 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
344  we enable the warning only when not optimizing. */
345 # if !__OPTIMIZE__
346 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
347  _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
348  "The symbol ::" #func " refers to the system function. " \
349  "Use " #namespace "::" #func " instead.")
350 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
351 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
352  extern __typeof__ (func) func
353 # else
354 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
355  _GL_EXTERN_C int _gl_cxxalias_dummy
356 # endif
357 #else
358 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
359  _GL_EXTERN_C int _gl_cxxalias_dummy
360 #endif
361 
362 #endif /* _GL_CXXDEFS_H */
363 
364 /* The definition of _GL_ARG_NONNULL is copied here. */
365 /* A C macro for declaring that specific arguments must not be NULL.
366  Copyright (C) 2009-2017 Free Software Foundation, Inc.
367 
368  This program is free software: you can redistribute it and/or modify it
369  under the terms of the GNU General Public License as published
370  by the Free Software Foundation; either version 3 of the License, or
371  (at your option) any later version.
372 
373  This program is distributed in the hope that it will be useful,
374  but WITHOUT ANY WARRANTY; without even the implied warranty of
375  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376  General Public License for more details.
377 
378  You should have received a copy of the GNU General Public License
379  along with this program. If not, see <https://www.gnu.org/licenses/>. */
380 
381 /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
382  that the values passed as arguments n, ..., m must be non-NULL pointers.
383  n = 1 stands for the first argument, n = 2 for the second argument etc. */
384 #ifndef _GL_ARG_NONNULL
385 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
386 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
387 # else
388 # define _GL_ARG_NONNULL(params)
389 # endif
390 #endif
391 
392 /* The definition of _GL_WARN_ON_USE is copied here. */
393 /* A C macro for emitting warnings if a function is used.
394  Copyright (C) 2010-2017 Free Software Foundation, Inc.
395 
396  This program is free software: you can redistribute it and/or modify it
397  under the terms of the GNU General Public License as published
398  by the Free Software Foundation; either version 3 of the License, or
399  (at your option) any later version.
400 
401  This program is distributed in the hope that it will be useful,
402  but WITHOUT ANY WARRANTY; without even the implied warranty of
403  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
404  General Public License for more details.
405 
406  You should have received a copy of the GNU General Public License
407  along with this program. If not, see <https://www.gnu.org/licenses/>. */
408 
409 /* _GL_WARN_ON_USE (function, "literal string") issues a declaration
410  for FUNCTION which will then trigger a compiler warning containing
411  the text of "literal string" anywhere that function is called, if
412  supported by the compiler. If the compiler does not support this
413  feature, the macro expands to an unused extern declaration.
414 
415  This macro is useful for marking a function as a potential
416  portability trap, with the intent that "literal string" include
417  instructions on the replacement function that should be used
418  instead. However, one of the reasons that a function is a
419  portability trap is if it has the wrong signature. Declaring
420  FUNCTION with a different signature in C is a compilation error, so
421  this macro must use the same type as any existing declaration so
422  that programs that avoid the problematic FUNCTION do not fail to
423  compile merely because they included a header that poisoned the
424  function. But this implies that _GL_WARN_ON_USE is only safe to
425  use if FUNCTION is known to already have a declaration. Use of
426  this macro implies that there must not be any other macro hiding
427  the declaration of FUNCTION; but undefining FUNCTION first is part
428  of the poisoning process anyway (although for symbols that are
429  provided only via a macro, the result is a compilation error rather
430  than a warning containing "literal string"). Also note that in
431  C++, it is only safe to use if FUNCTION has no overloads.
432 
433  For an example, it is possible to poison 'getline' by:
434  - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
435  [getline]) in configure.ac, which potentially defines
436  HAVE_RAW_DECL_GETLINE
437  - adding this code to a header that wraps the system <stdio.h>:
438  #undef getline
439  #if HAVE_RAW_DECL_GETLINE
440  _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
441  "not universally present; use the gnulib module getline");
442  #endif
443 
444  It is not possible to directly poison global variables. But it is
445  possible to write a wrapper accessor function, and poison that
446  (less common usage, like &environ, will cause a compilation error
447  rather than issue the nice warning, but the end result of informing
448  the developer about their portability problem is still achieved):
449  #if HAVE_RAW_DECL_ENVIRON
450  static char ***rpl_environ (void) { return &environ; }
451  _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
452  # undef environ
453  # define environ (*rpl_environ ())
454  #endif
455  */
456 #ifndef _GL_WARN_ON_USE
457 
458 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
459 /* A compiler attribute is available in gcc versions 4.3.0 and later. */
460 # define _GL_WARN_ON_USE(function, message) \
461 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
462 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
463 /* Verify the existence of the function. */
464 # define _GL_WARN_ON_USE(function, message) \
465 extern __typeof__ (function) function
466 # else /* Unsupported. */
467 # define _GL_WARN_ON_USE(function, message) \
468 _GL_WARN_EXTERN_C int _gl_warn_on_use
469 # endif
470 #endif
471 
472 /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
473  is like _GL_WARN_ON_USE (function, "string"), except that the function is
474  declared with the given prototype, consisting of return type, parameters,
475  and attributes.
476  This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
477  not work in this case. */
478 #ifndef _GL_WARN_ON_USE_CXX
479 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
480 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
481 extern rettype function parameters_and_attributes \
482  __attribute__ ((__warning__ (msg)))
483 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
484 /* Verify the existence of the function. */
485 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
486 extern rettype function parameters_and_attributes
487 # else /* Unsupported. */
488 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
489 _GL_WARN_EXTERN_C int _gl_warn_on_use
490 # endif
491 #endif
492 
493 /* _GL_WARN_EXTERN_C declaration;
494  performs the declaration with C linkage. */
495 #ifndef _GL_WARN_EXTERN_C
496 # if defined __cplusplus
497 # define _GL_WARN_EXTERN_C extern "C"
498 # else
499 # define _GL_WARN_EXTERN_C extern
500 # endif
501 #endif
502 
503 /* Some systems don't define struct timespec (e.g., AIX 4.1, Ultrix 4.3).
504  Or they define it with the wrong member names or define it in <sys/time.h>
505  (e.g., FreeBSD circa 1997). Stock Mingw prior to 3.0 does not define it,
506  but the pthreads-win32 library defines it in <pthread.h>. */
507 # if ! 1
508 # if 0
509 # include <sys/time.h>
510 # elif 0
511 # include <pthread.h>
512 # elif 0
513 # include <unistd.h>
514 # else
515 
516 # ifdef __cplusplus
517 extern "C" {
518 # endif
519 
520 # if !GNULIB_defined_struct_timespec
521 # undef timespec
522 # define timespec rpl_timespec
523 struct timespec
524 {
525  time_t tv_sec;
526  long int tv_nsec;
527 };
528 # define GNULIB_defined_struct_timespec 1
529 # endif
530 
531 # ifdef __cplusplus
532 }
533 # endif
534 
535 # endif
536 # endif
537 
538 # if !GNULIB_defined_struct_time_t_must_be_integral
539 /* Per http://austingroupbugs.net/view.php?id=327, POSIX requires
540  time_t to be an integer type, even though C99 permits floating
541  point. We don't know of any implementation that uses floating
542  point, and it is much easier to write code that doesn't have to
543  worry about that corner case, so we force the issue. */
545  unsigned int __floating_time_t_unsupported : (time_t) 1;
546 };
547 # define GNULIB_defined_struct_time_t_must_be_integral 1
548 # endif
549 
550 /* Sleep for at least RQTP seconds unless interrupted, If interrupted,
551  return -1 and store the remaining time into RMTP. See
552  <http://www.opengroup.org/susv3xsh/nanosleep.html>. */
553 # if 0
554 # if GNULIB_PORTCHECK
555 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
556 # define nanosleep rpl_nanosleep
557 # endif
558 _GL_FUNCDECL_RPL (nanosleep, int,
559  (struct timespec const *__rqtp, struct timespec *__rmtp)
560  _GL_ARG_NONNULL ((1)));
561 _GL_CXXALIAS_RPL (nanosleep, int,
562  (struct timespec const *__rqtp, struct timespec *__rmtp));
563 # else
564 # if ! 1
565 _GL_FUNCDECL_SYS (nanosleep, int,
566  (struct timespec const *__rqtp, struct timespec *__rmtp)
567  _GL_ARG_NONNULL ((1)));
568 # endif
569 _GL_CXXALIAS_SYS (nanosleep, int,
570  (struct timespec const *__rqtp, struct timespec *__rmtp));
571 # endif
572 _GL_CXXALIASWARN (nanosleep);
573 # endif
574 
575 /* Initialize time conversion information. */
576 # if 1
577 # if 0
578 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
579 # undef tzset
580 # define tzset rpl_tzset
581 # endif
582 _GL_FUNCDECL_RPL (tzset, void, (void));
583 _GL_CXXALIAS_RPL (tzset, void, (void));
584 # else
585 # if ! 1
586 _GL_FUNCDECL_SYS (tzset, void, (void));
587 # endif
588 _GL_CXXALIAS_SYS (tzset, void, (void));
589 # endif
591 # endif
592 
593 /* Return the 'time_t' representation of TP and normalize TP. */
594 # if 1
595 # if 0
596 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
597 # define mktime rpl_mktime
598 # endif
599 _GL_FUNCDECL_RPL (mktime, time_t, (struct tm *__tp) _GL_ARG_NONNULL ((1)));
600 _GL_CXXALIAS_RPL (mktime, time_t, (struct tm *__tp));
601 # else
602 _GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp));
603 # endif
604 _GL_CXXALIASWARN (mktime);
605 # endif
606 
607 /* Convert TIMER to RESULT, assuming local time and UTC respectively. See
608  <http://www.opengroup.org/susv3xsh/localtime_r.html> and
609  <http://www.opengroup.org/susv3xsh/gmtime_r.html>. */
610 # if 1
611 # if 0
612 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
613 # undef localtime_r
614 # define localtime_r rpl_localtime_r
615 # endif
616 _GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
617  struct tm *restrict __result)
618  _GL_ARG_NONNULL ((1, 2)));
619 _GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
620  struct tm *restrict __result));
621 # else
622 # if ! 1
623 _GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
624  struct tm *restrict __result)
625  _GL_ARG_NONNULL ((1, 2)));
626 # endif
627 _GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
628  struct tm *restrict __result));
629 # endif
630 # if 1
632 # endif
633 # if 0
634 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
635 # undef gmtime_r
636 # define gmtime_r rpl_gmtime_r
637 # endif
638 _GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
639  struct tm *restrict __result)
640  _GL_ARG_NONNULL ((1, 2)));
641 _GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
642  struct tm *restrict __result));
643 # else
644 # if ! 1
645 _GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
646  struct tm *restrict __result)
647  _GL_ARG_NONNULL ((1, 2)));
648 # endif
649 _GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
650  struct tm *restrict __result));
651 # endif
652 # if 1
654 # endif
655 # endif
656 
657 /* Convert TIMER to RESULT, assuming local time and UTC respectively. See
658  <http://www.opengroup.org/susv3xsh/localtime.html> and
659  <http://www.opengroup.org/susv3xsh/gmtime.html>. */
660 # if 0 || 0
661 # if 0
662 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
663 # undef localtime
664 # define localtime rpl_localtime
665 # endif
666 _GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer)
667  _GL_ARG_NONNULL ((1)));
668 _GL_CXXALIAS_RPL (localtime, struct tm *, (time_t const *__timer));
669 # else
670 _GL_CXXALIAS_SYS (localtime, struct tm *, (time_t const *__timer));
671 # endif
672 _GL_CXXALIASWARN (localtime);
673 # endif
674 
675 # if 0 || 0
676 # if 0
677 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
678 # undef gmtime
679 # define gmtime rpl_gmtime
680 # endif
681 _GL_FUNCDECL_RPL (gmtime, struct tm *, (time_t const *__timer)
682  _GL_ARG_NONNULL ((1)));
683 _GL_CXXALIAS_RPL (gmtime, struct tm *, (time_t const *__timer));
684 # else
685 _GL_CXXALIAS_SYS (gmtime, struct tm *, (time_t const *__timer));
686 # endif
687 _GL_CXXALIASWARN (gmtime);
688 # endif
689 
690 /* Parse BUF as a timestamp, assuming FORMAT specifies its layout, and store
691  the resulting broken-down time into TM. See
692  <http://www.opengroup.org/susv3xsh/strptime.html>. */
693 # if 0
694 # if ! 1
695 _GL_FUNCDECL_SYS (strptime, char *, (char const *restrict __buf,
696  char const *restrict __format,
697  struct tm *restrict __tm)
698  _GL_ARG_NONNULL ((1, 2, 3)));
699 # endif
700 _GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf,
701  char const *restrict __format,
702  struct tm *restrict __tm));
703 _GL_CXXALIASWARN (strptime);
704 # endif
705 
706 /* Convert *TP to a date and time string. See
707  <http://pubs.opengroup.org/onlinepubs/9699919799/functions/ctime.html>. */
708 # if 0
709 # if GNULIB_PORTCHECK
710 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
711 # define ctime rpl_ctime
712 # endif
713 _GL_FUNCDECL_RPL (ctime, char *, (time_t const *__tp)
714  _GL_ARG_NONNULL ((1)));
715 _GL_CXXALIAS_RPL (ctime, char *, (time_t const *__tp));
716 # else
717 _GL_CXXALIAS_SYS (ctime, char *, (time_t const *__tp));
718 # endif
719 _GL_CXXALIASWARN (ctime);
720 # endif
721 
722 /* Convert *TP to a date and time string. See
723  <http://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html>. */
724 # if 0
725 # if GNULIB_PORTCHECK
726 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
727 # define strftime rpl_strftime
728 # endif
729 _GL_FUNCDECL_RPL (strftime, size_t, (char *__buf, size_t __bufsize,
730  const char *__fmt, const struct tm *__tp)
731  _GL_ARG_NONNULL ((1, 3, 4)));
732 _GL_CXXALIAS_RPL (strftime, size_t, (char *__buf, size_t __bufsize,
733  const char *__fmt, const struct tm *__tp));
734 # else
735 _GL_CXXALIAS_SYS (strftime, size_t, (char *__buf, size_t __bufsize,
736  const char *__fmt, const struct tm *__tp));
737 # endif
738 _GL_CXXALIASWARN (strftime);
739 # endif
740 
741 # if defined _GNU_SOURCE && 1 && ! 0
742 typedef struct tm_zone *timezone_t;
743 _GL_FUNCDECL_SYS (tzalloc, timezone_t, (char const *__name));
744 _GL_CXXALIAS_SYS (tzalloc, timezone_t, (char const *__name));
745 _GL_FUNCDECL_SYS (tzfree, void, (timezone_t __tz));
746 _GL_CXXALIAS_SYS (tzfree, void, (timezone_t __tz));
747 _GL_FUNCDECL_SYS (localtime_rz, struct tm *,
748  (timezone_t __tz, time_t const *restrict __timer,
749  struct tm *restrict __result) _GL_ARG_NONNULL ((2, 3)));
750 _GL_CXXALIAS_SYS (localtime_rz, struct tm *,
751  (timezone_t __tz, time_t const *restrict __timer,
752  struct tm *restrict __result));
753 _GL_FUNCDECL_SYS (mktime_z, time_t,
754  (timezone_t __tz, struct tm *restrict __result)
755  _GL_ARG_NONNULL ((2)));
756 _GL_CXXALIAS_SYS (mktime_z, time_t,
757  (timezone_t __tz, struct tm *restrict __result));
758 # endif
759 
760 /* Convert TM to a time_t value, assuming UTC. */
761 # if 1
762 # if 0
763 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
764 # undef timegm
765 # define timegm rpl_timegm
766 # endif
767 _GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
768 _GL_CXXALIAS_RPL (timegm, time_t, (struct tm *__tm));
769 # else
770 # if ! 1
771 _GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
772 # endif
773 _GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm));
774 # endif
776 # endif
777 
778 /* Encourage applications to avoid unsafe functions that can overrun
779  buffers when given outlandish struct tm values. Portable
780  applications should use strftime (or even sprintf) instead. */
781 # if defined GNULIB_POSIXCHECK
782 # undef asctime
783 _GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - "
784  "better use strftime (or even sprintf) instead");
785 # endif
786 # if defined GNULIB_POSIXCHECK
787 # undef asctime_r
788 _GL_WARN_ON_USE (asctime, "asctime_r can overrun buffers in some cases - "
789  "better use strftime (or even sprintf) instead");
790 # endif
791 # if defined GNULIB_POSIXCHECK
792 # undef ctime
793 _GL_WARN_ON_USE (asctime, "ctime can overrun buffers in some cases - "
794  "better use strftime (or even sprintf) instead");
795 # endif
796 # if defined GNULIB_POSIXCHECK
797 # undef ctime_r
798 _GL_WARN_ON_USE (asctime, "ctime_r can overrun buffers in some cases - "
799  "better use strftime (or even sprintf) instead");
800 # endif
801 
802 #endif
Definition: time-internal.h:21
#define _GL_CXXALIAS_RPL(func, rettype, parameters)
Definition: time.h:173
unsigned int __floating_time_t_unsupported
Definition: time.h:545
time_t mktime_z(timezone_t tz, struct tm *tm)
Definition: time_rz.c:306
#define _GL_ARG_NONNULL(params)
Definition: time.h:388
timezone_t tzalloc(char const *name)
Definition: time_rz.c:95
#define _GL_WARN_ON_USE(function, message)
Definition: time.h:467
struct tm * localtime_r(time_t const *restrict t, struct tm *restrict tp)
Definition: time_r.c:41
void tzfree(timezone_t tz)
Definition: time_rz.c:196
Definition: time.h:544
#define _GL_FUNCDECL_SYS(func, rettype, parameters_and_attributes)
Definition: time.h:161
#define _GL_CXXALIASWARN(func)
Definition: time.h:330
time_t tv_sec
Definition: time.in.h:73
#define _GL_FUNCDECL_RPL(func, rettype, parameters_and_attributes)
Definition: time.h:149
#define _GL_CXXALIAS_SYS(func, rettype, parameters)
Definition: time.h:246
time_t timegm(struct tm *tmp)
Definition: timegm.c:35
struct tm * gmtime_r(time_t const *restrict t, struct tm *restrict tp)
Definition: time_r.c:35
void tzset(void)
Definition: tzset.c:34
Definition: time.in.h:71
struct tm * localtime_rz(timezone_t tz, time_t const *t, struct tm *tm)
Definition: time_rz.c:287
long int tv_nsec
Definition: time.in.h:74
#define restrict
Definition: config.h:1858