5 # include <bits/types/locale_t.h>
7 # include <time/mktime-internal.h>
9 extern __typeof (strftime_l
) __strftime_l
;
10 libc_hidden_proto (__strftime_l
)
11 extern __typeof (strptime_l
) __strptime_l
;
13 libc_hidden_proto (time
)
14 libc_hidden_proto (asctime
)
15 libc_hidden_proto (mktime
)
16 libc_hidden_proto (timelocal
)
17 libc_hidden_proto (localtime
)
18 libc_hidden_proto (strftime
)
19 libc_hidden_proto (strptime
)
21 extern __typeof (clock_getres
) __clock_getres
;
22 extern __typeof (clock_gettime
) __clock_gettime
;
23 libc_hidden_proto (__clock_gettime
)
24 extern __typeof (clock_settime
) __clock_settime
;
25 extern __typeof (clock_nanosleep
) __clock_nanosleep
;
26 extern __typeof (clock_getcpuclockid
) __clock_getcpuclockid
;
28 /* Now define the internal interfaces. */
31 /* Defined in mktime.c. */
32 extern const unsigned short int __mon_yday
[2][13] attribute_hidden
;
34 /* Defined in localtime.c. */
35 extern struct tm _tmbuf attribute_hidden
;
37 /* Defined in tzset.c. */
38 extern char *__tzstring (const char *string
) attribute_hidden
;
40 extern int __use_tzfile attribute_hidden
;
42 extern void __tzfile_read (const char *file
, size_t extra
,
43 char **extrap
) attribute_hidden
;
44 extern void __tzfile_compute (__time64_t timer
, int use_localtime
,
45 long int *leap_correct
, int *leap_hit
,
46 struct tm
*tp
) attribute_hidden
;
47 extern void __tzfile_default (const char *std
, const char *dst
,
48 int stdoff
, int dstoff
)
50 extern void __tzset_parse_tz (const char *tz
) attribute_hidden
;
51 extern void __tz_compute (__time64_t timer
, struct tm
*tm
, int use_localtime
)
52 __THROW attribute_hidden
;
55 # define __ctime64 ctime
57 extern char *__ctime64 (const __time64_t
*__timer
) __THROW
;
58 libc_hidden_proto (__ctime64
)
62 # define __ctime64_r ctime_r
64 extern char *__ctime64_r (const __time64_t
*__restrict __timer
,
65 char *__restrict __buf
) __THROW
;
66 libc_hidden_proto (__ctime64_r
)
70 # define __localtime64 localtime
72 extern struct tm
*__localtime64 (const __time64_t
*__timer
);
73 libc_hidden_proto (__localtime64
)
76 extern struct tm
*__localtime_r (const time_t *__timer
,
77 struct tm
*__tp
) attribute_hidden
;
79 extern struct tm
*__localtime64_r (const __time64_t
*__timer
,
81 libc_hidden_proto (__localtime64_r
)
83 extern __time64_t
__mktime64 (struct tm
*__tp
) __THROW
;
84 libc_hidden_proto (__mktime64
)
87 extern struct tm
*__gmtime_r (const time_t *__restrict __timer
,
88 struct tm
*__restrict __tp
);
89 libc_hidden_proto (__gmtime_r
)
92 # define __gmtime64 gmtime
94 extern struct tm
*__gmtime64 (const __time64_t
*__timer
);
95 libc_hidden_proto (__gmtime64
)
97 extern struct tm
*__gmtime64_r (const __time64_t
*__restrict __timer
,
98 struct tm
*__restrict __tp
);
99 libc_hidden_proto (__gmtime64_r
)
101 extern __time64_t
__timegm64 (struct tm
*__tp
) __THROW
;
102 libc_hidden_proto (__timegm64
)
105 /* Compute the `struct tm' representation of T,
106 offset OFFSET seconds east of UTC,
107 and store year, yday, mon, mday, wday, hour, min, sec into *TP.
108 Return nonzero if successful. */
109 extern int __offtime (__time64_t __timer
,
111 struct tm
*__tp
) attribute_hidden
;
113 extern char *__asctime_r (const struct tm
*__tp
, char *__buf
)
115 extern void __tzset (void) attribute_hidden
;
117 /* Prototype for the internal function to get information based on TZ. */
118 extern struct tm
*__tz_convert (__time64_t timer
, int use_localtime
,
119 struct tm
*tp
) attribute_hidden
;
121 extern int __nanosleep (const struct timespec
*__requested_time
,
122 struct timespec
*__remaining
);
123 hidden_proto (__nanosleep
)
124 extern int __getdate_r (const char *__string
, struct tm
*__resbufp
)
128 /* Determine CLK_TCK value. */
129 extern int __getclktck (void) attribute_hidden
;
132 /* strptime support. */
133 extern char * __strptime_internal (const char *rp
, const char *fmt
,
134 struct tm
*tm
, void *statep
,
135 locale_t locparam
) attribute_hidden
;
138 # define __difftime64 __difftime
140 extern double __difftime64 (__time64_t time1
, __time64_t time0
);
141 libc_hidden_proto (__difftime64
)
144 extern double __difftime (time_t time1
, time_t time0
);
147 /* Use in the clock_* functions. Size of the field representing the
149 #define CLOCK_IDFIELD_SIZE 3
151 /* Check whether T fits in time_t. */
153 in_time_t_range (__time64_t t
)