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