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/* Defined in mktime.c. */
30extern const unsigned short int __mon_yday[2][13] attribute_hidden;
31
32/* Defined in localtime.c. */
33extern struct tm _tmbuf attribute_hidden;
34
35/* Defined in tzset.c. */
36extern char *__tzstring (const char *string);
37
38extern int __use_tzfile attribute_hidden;
39
40extern void __tzfile_read (const char *file, size_t extra,
41 char **extrap);
42extern void __tzfile_compute (time_t timer, int use_localtime,
43 long int *leap_correct, int *leap_hit,
44 struct tm *tp);
45extern void __tzfile_default (const char *std, const char *dst,
46 long int stdoff, long int dstoff);
47extern void __tzset_parse_tz (const char *tz);
48extern void __tz_compute (time_t timer, struct tm *tm, int use_localtime)
49 __THROW internal_function;
50
51/* Subroutine of `mktime'. Return the `time_t' representation of TP and
52 normalize TP, given that a `struct tm *' maps to a `time_t' as performed
53 by FUNC. Keep track of next guess for time_t offset in *OFFSET. */
54extern time_t __mktime_internal (struct tm *__tp,
55 struct tm *(*__func) (const time_t *,
56 struct tm *),
57 time_t *__offset);
58extern struct tm *__localtime_r (const time_t *__timer,
59 struct tm *__tp) attribute_hidden;
60
61extern struct tm *__gmtime_r (const time_t *__restrict __timer,
62 struct tm *__restrict __tp);
63libc_hidden_proto (__gmtime_r)
64
65/* Compute the `struct tm' representation of *T,
66 offset OFFSET seconds east of UTC,
67 and store year, yday, mon, mday, wday, hour, min, sec into *TP.
68 Return nonzero if successful. */
69extern int __offtime (const time_t *__timer,
70 long int __offset,
71 struct tm *__tp);
72
73extern char *__asctime_r (const struct tm *__tp, char *__buf);
74extern void __tzset (void);
75
76/* Prototype for the internal function to get information based on TZ. */
77extern struct tm *__tz_convert (const time_t *timer, int use_localtime, struct tm *tp);
78
79extern int __nanosleep (const struct timespec *__requested_time,
80 struct timespec *__remaining);
81hidden_proto (__nanosleep)
82extern int __nanosleep_nocancel (const struct timespec *__requested_time,
83 struct timespec *__remaining)
84 attribute_hidden;
85extern int __getdate_r (const char *__string, struct tm *__resbufp);
86
87
88/* Determine CLK_TCK value. */
89extern int __getclktck (void);
90
91
92/* strptime support. */
93extern char * __strptime_internal (const char *rp, const char *fmt,
94 struct tm *tm, void *statep,
95 locale_t locparam)
96 internal_function;
97
98extern double __difftime (time_t time1, time_t time0);
99
100
101/* Use in the clock_* functions. Size of the field representing the
102 actual clock ID. */
103#define CLOCK_IDFIELD_SIZE 3
104
105#endif
106#endif
107