Make sure that we have a real on-the-stack alloca()
[bpt/guile.git] / lib / time.h
1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2 /* A more-standard <time.h>.
3
4 Copyright (C) 2007-2008 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 Lesser General Public License as published by
8 the Free Software Foundation; either version 2, 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 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License
17 along with this program; if not, write to the Free Software Foundation,
18 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
19
20 #if __GNUC__ >= 3
21 #pragma GCC system_header
22 #endif
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. Also, Solaris 8 <time.h> eventually includes itself
27 recursively; if that is happening, just include the system <time.h>
28 without adding our own declarations. */
29 #if (defined __need_time_t || defined __need_clock_t \
30 || defined __need_timespec \
31 || defined _GL_TIME_H)
32
33 # include_next <time.h>
34
35 #else
36
37 # define _GL_TIME_H
38
39 # include_next <time.h>
40
41 # ifdef __cplusplus
42 extern "C" {
43 # endif
44
45 /* Some systems don't define struct timespec (e.g., AIX 4.1, Ultrix 4.3).
46 Or they define it with the wrong member names or define it in <sys/time.h>
47 (e.g., FreeBSD circa 1997). */
48 # if ! 1
49 # if 0
50 # include <sys/time.h>
51 # else
52 # undef timespec
53 # define timespec rpl_timespec
54 struct timespec
55 {
56 time_t tv_sec;
57 long int tv_nsec;
58 };
59 # endif
60 # endif
61
62 /* Sleep for at least RQTP seconds unless interrupted, If interrupted,
63 return -1 and store the remaining time into RMTP. See
64 <http://www.opengroup.org/susv3xsh/nanosleep.html>. */
65 # if GNULIB_PORTCHECK
66 # define nanosleep rpl_nanosleep
67 int nanosleep (struct timespec const *__rqtp, struct timespec *__rmtp);
68 # endif
69
70 /* Convert TIMER to RESULT, assuming local time and UTC respectively. See
71 <http://www.opengroup.org/susv3xsh/localtime_r.html> and
72 <http://www.opengroup.org/susv3xsh/gmtime_r.html>. */
73 # if 0
74 # undef localtime_r
75 # define localtime_r rpl_localtime_r
76 # undef gmtime_r
77 # define gmtime_r rpl_gmtime_r
78 struct tm *localtime_r (time_t const *restrict __timer,
79 struct tm *restrict __result);
80 struct tm *gmtime_r (time_t const *restrict __timer,
81 struct tm *restrict __result);
82 # endif
83
84 /* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store
85 the resulting broken-down time into TM. See
86 <http://www.opengroup.org/susv3xsh/strptime.html>. */
87 # if GNULIB_PORTCHECK
88 # undef strptime
89 # define strptime rpl_strptime
90 char *strptime (char const *restrict __buf, char const *restrict __format,
91 struct tm *restrict __tm);
92 # endif
93
94 /* Convert TM to a time_t value, assuming UTC. */
95 # if GNULIB_PORTCHECK
96 # undef timegm
97 # define timegm rpl_timegm
98 time_t timegm (struct tm *__tm);
99 # endif
100
101 /* Encourage applications to avoid unsafe functions that can overrun
102 buffers when given outlandish struct tm values. Portable
103 applications should use strftime (or even sprintf) instead. */
104 # if GNULIB_PORTCHECK
105 # undef asctime
106 # define asctime eschew_asctime
107 # undef asctime_r
108 # define asctime_r eschew_asctime_r
109 # undef ctime
110 # define ctime eschew_ctime
111 # undef ctime_r
112 # define ctime_r eschew_ctime_r
113 # endif
114
115 # ifdef __cplusplus
116 }
117 # endif
118
119 #endif