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