1#ifndef _TIME_H
2#include <time/time.h>
3
4#ifndef _ISOMAC
5# include <bits/types/locale_t.h>
6
7extern __typeof (strftime_l) __strftime_l;
8libc_hidden_proto (__strftime_l)
9extern __typeof (strptime_l) __strptime_l;
10
11libc_hidden_proto (time)
12libc_hidden_proto (asctime)
13libc_hidden_proto (mktime)
14libc_hidden_proto (timelocal)
15libc_hidden_proto (localtime)
16libc_hidden_proto (strftime)
17libc_hidden_proto (strptime)
18
19extern __typeof (clock_getres) __clock_getres;
20extern __typeof (clock_gettime) __clock_gettime;
21libc_hidden_proto (__clock_gettime)
22extern __typeof (clock_settime) __clock_settime;
23extern __typeof (clock_nanosleep) __clock_nanosleep;
24extern __typeof (clock_getcpuclockid) __clock_getcpuclockid;
25
26/* Now define the internal interfaces. */
27struct tm;
28
29/* time_t variant for representing time zone data, independent of
30 time_t. */
31typedef __int64_t internal_time_t;
32
33/* Defined in mktime.c. */
34extern const unsigned short int __mon_yday[2][13] attribute_hidden;
35
36/* Defined in localtime.c. */
37extern struct tm _tmbuf attribute_hidden;
38
39/* Defined in tzset.c. */
40extern char *__tzstring (const char *string) attribute_hidden;
41
42extern int __use_tzfile attribute_hidden;
43
44extern void __tzfile_read (const char *file, size_t extra,
45 char **extrap) attribute_hidden;
46extern void __tzfile_compute (internal_time_t timer, int use_localtime,
47 long int *leap_correct, int *leap_hit,
48 struct tm *tp) attribute_hidden;
49extern void __tzfile_default (const char *std, const char *dst,
50 long int stdoff, long int dstoff)
51 attribute_hidden;
52extern void __tzset_parse_tz (const char *tz) attribute_hidden;
53extern void __tz_compute (time_t timer, struct tm *tm, int use_localtime)
54 __THROW attribute_hidden;
55
56/* Subroutine of `mktime'. Return the `time_t' representation of TP and
57 normalize TP, given that a `struct tm *' maps to a `time_t' as performed
58 by FUNC. Keep track of next guess for time_t offset in *OFFSET. */
59extern time_t __mktime_internal (struct tm *__tp,
60 struct tm *(*__func) (const time_t *,
61 struct tm *),
62 time_t *__offset) attribute_hidden;
63extern struct tm *__localtime_r (const time_t *__timer,
64 struct tm *__tp) attribute_hidden;
65
66extern struct tm *__gmtime_r (const time_t *__restrict __timer,
67 struct tm *__restrict __tp);
68libc_hidden_proto (__gmtime_r)
69
70/* Compute the `struct tm' representation of *T,
71 offset OFFSET seconds east of UTC,
72 and store year, yday, mon, mday, wday, hour, min, sec into *TP.
73 Return nonzero if successful. */
74extern int __offtime (const time_t *__timer,
75 long int __offset,
76 struct tm *__tp) attribute_hidden;
77
78extern char *__asctime_r (const struct tm *__tp, char *__buf)
79 attribute_hidden;
80extern void __tzset (void) attribute_hidden;
81
82/* Prototype for the internal function to get information based on TZ. */
83extern struct tm *__tz_convert (const time_t *timer, int use_localtime,
84 struct tm *tp) attribute_hidden;
85
86extern int __nanosleep (const struct timespec *__requested_time,
87 struct timespec *__remaining);
88hidden_proto (__nanosleep)
89extern int __getdate_r (const char *__string, struct tm *__resbufp)
90 attribute_hidden;
91
92
93/* Determine CLK_TCK value. */
94extern int __getclktck (void) attribute_hidden;
95
96
97/* strptime support. */
98extern char * __strptime_internal (const char *rp, const char *fmt,
99 struct tm *tm, void *statep,
100 locale_t locparam) attribute_hidden;
101
102extern double __difftime (time_t time1, time_t time0);
103
104
105/* Use in the clock_* functions. Size of the field representing the
106 actual clock ID. */
107#define CLOCK_IDFIELD_SIZE 3
108
109#endif
110#endif
111