Imported Upstream version 1.3.14
[debian/gzip] / lib / time.in.h
1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* A more-standard <time.h>.
4
5    Copyright (C) 2007-2009 Free Software Foundation, Inc.
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3, or (at your option)
10    any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software Foundation,
19    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
20
21 #if __GNUC__ >= 3
22 @PRAGMA_SYSTEM_HEADER@
23 #endif
24
25 /* Don't get in the way of glibc when it includes time.h merely to
26    declare a few standard symbols, rather than to declare all the
27    symbols.  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 _GL_TIME_H)
33
34 # @INCLUDE_NEXT@ @NEXT_TIME_H@
35
36 #else
37
38 # define _GL_TIME_H
39
40 # @INCLUDE_NEXT@ @NEXT_TIME_H@
41
42 /* NetBSD 5.0 mis-defines NULL.  */
43 #include <stddef.h>
44
45 # ifdef __cplusplus
46 extern "C" {
47 # endif
48
49 /* Some systems don't define struct timespec (e.g., AIX 4.1, Ultrix 4.3).
50    Or they define it with the wrong member names or define it in <sys/time.h>
51    (e.g., FreeBSD circa 1997).  */
52 # if ! @TIME_H_DEFINES_STRUCT_TIMESPEC@
53 #  if @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
54 #   include <sys/time.h>
55 #  else
56 #   undef timespec
57 #   define timespec rpl_timespec
58 struct timespec
59 {
60   time_t tv_sec;
61   long int tv_nsec;
62 };
63 #  endif
64 # endif
65
66 /* Sleep for at least RQTP seconds unless interrupted,  If interrupted,
67    return -1 and store the remaining time into RMTP.  See
68    <http://www.opengroup.org/susv3xsh/nanosleep.html>.  */
69 # if @REPLACE_NANOSLEEP@
70 #  define nanosleep rpl_nanosleep
71 int nanosleep (struct timespec const *__rqtp, struct timespec *__rmtp);
72 # endif
73
74 /* Return the 'time_t' representation of TP and normalize TP.  */
75 # if @REPLACE_MKTIME@
76 #  define mktime rpl_mktime
77 extern time_t mktime (struct tm *__tp);
78 # endif
79
80 /* Convert TIMER to RESULT, assuming local time and UTC respectively.  See
81    <http://www.opengroup.org/susv3xsh/localtime_r.html> and
82    <http://www.opengroup.org/susv3xsh/gmtime_r.html>.  */
83 # if @REPLACE_LOCALTIME_R@
84 #  undef localtime_r
85 #  define localtime_r rpl_localtime_r
86 #  undef gmtime_r
87 #  define gmtime_r rpl_gmtime_r
88 struct tm *localtime_r (time_t const *restrict __timer,
89                         struct tm *restrict __result);
90 struct tm *gmtime_r (time_t const *restrict __timer,
91                      struct tm *restrict __result);
92 # endif
93
94 /* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store
95    the resulting broken-down time into TM.  See
96    <http://www.opengroup.org/susv3xsh/strptime.html>.  */
97 # if @REPLACE_STRPTIME@
98 #  undef strptime
99 #  define strptime rpl_strptime
100 char *strptime (char const *restrict __buf, char const *restrict __format,
101                 struct tm *restrict __tm);
102 # endif
103
104 /* Convert TM to a time_t value, assuming UTC.  */
105 # if @REPLACE_TIMEGM@
106 #  undef timegm
107 #  define timegm rpl_timegm
108 time_t timegm (struct tm *__tm);
109 # endif
110
111 /* Encourage applications to avoid unsafe functions that can overrun
112    buffers when given outlandish struct tm values.  Portable
113    applications should use strftime (or even sprintf) instead.  */
114 # if GNULIB_PORTCHECK
115 #  undef asctime
116 #  define asctime eschew_asctime
117 #  undef asctime_r
118 #  define asctime_r eschew_asctime_r
119 #  undef ctime
120 #  define ctime eschew_ctime
121 #  undef ctime_r
122 #  define ctime_r eschew_ctime_r
123 # endif
124
125 # ifdef __cplusplus
126 }
127 # endif
128
129 #endif