]>
Commit | Line | Data |
---|---|---|
6796bc80 | 1 | #ifndef _TIME_H |
bdbf022d UD |
2 | #if defined __need_time_t || defined __need_clock_t || defined __need_timespec |
3 | # include <time/time.h> | |
4 | #else | |
5 | # include <time/time.h> | |
ccadf7b5 | 6 | # include <xlocale.h> |
bdbf022d | 7 | |
7735afa2 UD |
8 | __BEGIN_DECLS |
9 | ||
da4cfe38 | 10 | extern __typeof (strftime_l) __strftime_l; |
ee2a5ae8 | 11 | libc_hidden_proto (__strftime_l) |
da4cfe38 RM |
12 | extern __typeof (strptime_l) __strptime_l; |
13 | ||
c5598d47 RM |
14 | libc_hidden_proto (time) |
15 | libc_hidden_proto (asctime) | |
16 | libc_hidden_proto (mktime) | |
17 | libc_hidden_proto (timelocal) | |
18 | libc_hidden_proto (localtime) | |
19 | libc_hidden_proto (strftime) | |
20 | libc_hidden_proto (strptime) | |
21 | ||
a9564ae9 UD |
22 | librt_hidden_proto (clock_gettime) |
23 | ||
bdbf022d UD |
24 | /* Now define the internal interfaces. */ |
25 | struct tm; | |
26 | ||
8632b240 | 27 | /* Defined in mktime.c. */ |
ab26a24a | 28 | extern const unsigned short int __mon_yday[2][13] attribute_hidden; |
8632b240 UD |
29 | |
30 | /* Defined in localtime.c. */ | |
418f1701 | 31 | extern struct tm _tmbuf attribute_hidden; |
8632b240 UD |
32 | |
33 | /* Defined in tzset.c. */ | |
c19559b0 | 34 | extern char *__tzstring (const char *string); |
8632b240 UD |
35 | |
36 | /* Defined in tzset.c. */ | |
418f1701 | 37 | extern size_t __tzname_cur_max attribute_hidden; |
8632b240 UD |
38 | |
39 | ||
418f1701 | 40 | extern int __use_tzfile attribute_hidden; |
8632b240 | 41 | |
fe559c5e | 42 | extern void __tzfile_read (const char *file, size_t extra, |
c19559b0 | 43 | char **extrap); |
38e68573 UD |
44 | extern void __tzfile_compute (time_t timer, int use_localtime, |
45 | long int *leap_correct, int *leap_hit, | |
46 | struct tm *tp); | |
fe559c5e | 47 | extern void __tzfile_default (const char *std, const char *dst, |
c19559b0 | 48 | long int stdoff, long int dstoff); |
8632b240 | 49 | |
bdbf022d UD |
50 | /* Subroutine of `mktime'. Return the `time_t' representation of TP and |
51 | normalize TP, given that a `struct tm *' maps to a `time_t' as performed | |
52 | by FUNC. Keep track of next guess for time_t offset in *OFFSET. */ | |
fe559c5e UD |
53 | extern time_t __mktime_internal (struct tm *__tp, |
54 | struct tm *(*__func) (const time_t *, | |
55 | struct tm *), | |
c19559b0 | 56 | time_t *__offset); |
fe559c5e | 57 | extern struct tm *__localtime_r (__const time_t *__timer, |
dff07c4b | 58 | struct tm *__tp) attribute_hidden; |
bdbf022d | 59 | |
fe559c5e | 60 | extern struct tm *__gmtime_r (__const time_t *__restrict __timer, |
c19559b0 | 61 | struct tm *__restrict __tp); |
230491f0 | 62 | libc_hidden_proto (__gmtime_r) |
811ba236 | 63 | |
bdbf022d UD |
64 | /* Compute the `struct tm' representation of *T, |
65 | offset OFFSET seconds east of UTC, | |
66 | and store year, yday, mon, mday, wday, hour, min, sec into *TP. | |
67 | Return nonzero if successful. */ | |
fe559c5e UD |
68 | extern int __offtime (__const time_t *__timer, |
69 | long int __offset, | |
c19559b0 | 70 | struct tm *__tp); |
bdbf022d | 71 | |
c19559b0 UD |
72 | extern char *__asctime_r (__const struct tm *__tp, char *__buf); |
73 | extern void __tzset (void); | |
bdbf022d | 74 | |
8632b240 | 75 | /* Prototype for the internal function to get information based on TZ. */ |
c19559b0 | 76 | extern struct tm *__tz_convert (const time_t *timer, int use_localtime, struct tm *tp); |
8632b240 | 77 | |
bdbf022d UD |
78 | /* Return the maximum length of a timezone name. |
79 | This is what `sysconf (_SC_TZNAME_MAX)' does. */ | |
c19559b0 | 80 | extern long int __tzname_max (void); |
bdbf022d | 81 | |
fe559c5e | 82 | extern int __nanosleep (__const struct timespec *__requested_time, |
c19559b0 | 83 | struct timespec *__remaining); |
b32e6700 | 84 | libc_hidden_proto (__nanosleep) |
d5ba53f9 | 85 | extern int __nanosleep_nocancel (__const struct timespec *__requested_time, |
b32e6700 RM |
86 | struct timespec *__remaining) |
87 | attribute_hidden; | |
c19559b0 | 88 | extern int __getdate_r (__const char *__string, struct tm *__resbufp); |
25b3dd49 UD |
89 | |
90 | ||
91 | /* Determine CLK_TCK value. */ | |
92 | extern int __getclktck (void); | |
4165d44d UD |
93 | |
94 | ||
ccadf7b5 UD |
95 | /* strptime support. */ |
96 | /* Status of lookup: do we use the locale data or the raw data? */ | |
7735afa2 | 97 | #ifndef __cplusplus |
9e6c38d2 | 98 | /* C++ cannot deal with using 'not'. */ |
ccadf7b5 UD |
99 | enum ptime_locale_status { not, loc, raw }; |
100 | ||
101 | extern char * __strptime_internal (const char *rp, const char *fmt, | |
102 | struct tm *tm, | |
103 | enum ptime_locale_status *decided, | |
2d87db5b | 104 | int era_cnt, __locale_t locparam) |
ccadf7b5 | 105 | internal_function; |
7735afa2 | 106 | #endif |
ccadf7b5 | 107 | |
abca9f7f | 108 | extern double __difftime (time_t time1, time_t time0); |
ccadf7b5 UD |
109 | |
110 | ||
4165d44d UD |
111 | /* Use in the clock_* functions. Size of the field representing the |
112 | actual clock ID. */ | |
657f0417 UD |
113 | #ifndef _ISOMAC |
114 | # define CLOCK_IDFIELD_SIZE 3 | |
115 | #endif | |
7735afa2 UD |
116 | |
117 | __END_DECLS | |
118 | ||
bdbf022d | 119 | #endif |
6796bc80 | 120 | #endif |