| 1 | #ifndef _TIME_H |
| 2 | #include <time/time.h> |
| 3 | |
| 4 | #ifndef _ISOMAC |
| 5 | # include <bits/types/locale_t.h> |
| 6 | |
| 7 | extern __typeof (strftime_l) __strftime_l; |
| 8 | libc_hidden_proto (__strftime_l) |
| 9 | extern __typeof (strptime_l) __strptime_l; |
| 10 | |
| 11 | libc_hidden_proto (time) |
| 12 | libc_hidden_proto (asctime) |
| 13 | libc_hidden_proto (mktime) |
| 14 | libc_hidden_proto (timelocal) |
| 15 | libc_hidden_proto (localtime) |
| 16 | libc_hidden_proto (strftime) |
| 17 | libc_hidden_proto (strptime) |
| 18 | |
| 19 | extern __typeof (clock_getres) __clock_getres; |
| 20 | extern __typeof (clock_gettime) __clock_gettime; |
| 21 | libc_hidden_proto (__clock_gettime) |
| 22 | extern __typeof (clock_settime) __clock_settime; |
| 23 | extern __typeof (clock_nanosleep) __clock_nanosleep; |
| 24 | extern __typeof (clock_getcpuclockid) __clock_getcpuclockid; |
| 25 | |
| 26 | /* Now define the internal interfaces. */ |
| 27 | struct tm; |
| 28 | |
| 29 | /* Defined in mktime.c. */ |
| 30 | extern const unsigned short int __mon_yday[2][13] attribute_hidden; |
| 31 | |
| 32 | /* Defined in localtime.c. */ |
| 33 | extern struct tm _tmbuf attribute_hidden; |
| 34 | |
| 35 | /* Defined in tzset.c. */ |
| 36 | extern char *__tzstring (const char *string) attribute_hidden; |
| 37 | |
| 38 | extern int __use_tzfile attribute_hidden; |
| 39 | |
| 40 | extern void __tzfile_read (const char *file, size_t , |
| 41 | char **) attribute_hidden; |
| 42 | extern void __tzfile_compute (__time64_t timer, int use_localtime, |
| 43 | long int *leap_correct, int *leap_hit, |
| 44 | struct tm *tp) attribute_hidden; |
| 45 | extern void __tzfile_default (const char *std, const char *dst, |
| 46 | long int stdoff, long int dstoff) |
| 47 | attribute_hidden; |
| 48 | extern void __tzset_parse_tz (const char *tz) attribute_hidden; |
| 49 | extern void __tz_compute (__time64_t timer, struct tm *tm, int use_localtime) |
| 50 | __THROW attribute_hidden; |
| 51 | |
| 52 | /* Subroutine of `mktime'. Return the `time_t' representation of TP and |
| 53 | normalize TP, given that a `struct tm *' maps to a `time_t' as performed |
| 54 | by FUNC. Record next guess for localtime-gmtime offset in *OFFSET. */ |
| 55 | extern time_t __mktime_internal (struct tm *__tp, |
| 56 | struct tm *(*__func) (const time_t *, |
| 57 | struct tm *), |
| 58 | long int *__offset) attribute_hidden; |
| 59 | |
| 60 | #if __TIMESIZE == 64 |
| 61 | # define __ctime64 ctime |
| 62 | #else |
| 63 | extern char *__ctime64 (const __time64_t *__timer) __THROW; |
| 64 | libc_hidden_proto (__ctime64); |
| 65 | #endif |
| 66 | |
| 67 | #if __TIMESIZE == 64 |
| 68 | # define __ctime64_r ctime_r |
| 69 | #else |
| 70 | extern char *__ctime64_r (const __time64_t *__restrict __timer, |
| 71 | char *__restrict __buf) __THROW; |
| 72 | libc_hidden_proto (__ctime64_r); |
| 73 | #endif |
| 74 | |
| 75 | #if __TIMESIZE == 64 |
| 76 | # define __localtime64 localtime |
| 77 | #else |
| 78 | extern struct tm *__localtime64 (const __time64_t *__timer); |
| 79 | libc_hidden_proto (__localtime64) |
| 80 | #endif |
| 81 | |
| 82 | extern struct tm *__localtime_r (const time_t *__timer, |
| 83 | struct tm *__tp) attribute_hidden; |
| 84 | |
| 85 | #if __TIMESIZE == 64 |
| 86 | # define __localtime64_r __localtime_r |
| 87 | #else |
| 88 | extern struct tm *__localtime64_r (const __time64_t *__timer, |
| 89 | struct tm *__tp); |
| 90 | libc_hidden_proto (__localtime64_r) |
| 91 | #endif |
| 92 | |
| 93 | extern struct tm *__gmtime_r (const time_t *__restrict __timer, |
| 94 | struct tm *__restrict __tp); |
| 95 | libc_hidden_proto (__gmtime_r) |
| 96 | |
| 97 | #if __TIMESIZE == 64 |
| 98 | # define __gmtime64 gmtime |
| 99 | #else |
| 100 | extern struct tm *__gmtime64 (const __time64_t *__timer); |
| 101 | libc_hidden_proto (__gmtime64) |
| 102 | #endif |
| 103 | |
| 104 | #if __TIMESIZE == 64 |
| 105 | # define __gmtime64_r __gmtime_r |
| 106 | #else |
| 107 | extern struct tm *__gmtime64_r (const __time64_t *__restrict __timer, |
| 108 | struct tm *__restrict __tp); |
| 109 | libc_hidden_proto (__gmtime64_r); |
| 110 | #endif |
| 111 | |
| 112 | /* Compute the `struct tm' representation of T, |
| 113 | offset OFFSET seconds east of UTC, |
| 114 | and store year, yday, mon, mday, wday, hour, min, sec into *TP. |
| 115 | Return nonzero if successful. */ |
| 116 | extern int __offtime (__time64_t __timer, |
| 117 | long int __offset, |
| 118 | struct tm *__tp) attribute_hidden; |
| 119 | |
| 120 | extern char *__asctime_r (const struct tm *__tp, char *__buf) |
| 121 | attribute_hidden; |
| 122 | extern void __tzset (void) attribute_hidden; |
| 123 | |
| 124 | /* Prototype for the internal function to get information based on TZ. */ |
| 125 | extern struct tm *__tz_convert (__time64_t timer, int use_localtime, |
| 126 | struct tm *tp) attribute_hidden; |
| 127 | |
| 128 | extern int __nanosleep (const struct timespec *__requested_time, |
| 129 | struct timespec *__remaining); |
| 130 | hidden_proto (__nanosleep) |
| 131 | extern int __getdate_r (const char *__string, struct tm *__resbufp) |
| 132 | attribute_hidden; |
| 133 | |
| 134 | |
| 135 | /* Determine CLK_TCK value. */ |
| 136 | extern int __getclktck (void) attribute_hidden; |
| 137 | |
| 138 | |
| 139 | /* strptime support. */ |
| 140 | extern char * __strptime_internal (const char *rp, const char *fmt, |
| 141 | struct tm *tm, void *statep, |
| 142 | locale_t locparam) attribute_hidden; |
| 143 | |
| 144 | #if __TIMESIZE == 64 |
| 145 | # define __difftime64 __difftime |
| 146 | #else |
| 147 | extern double __difftime64 (__time64_t time1, __time64_t time0); |
| 148 | libc_hidden_proto (__difftime64) |
| 149 | #endif |
| 150 | |
| 151 | extern double __difftime (time_t time1, time_t time0); |
| 152 | |
| 153 | |
| 154 | /* Use in the clock_* functions. Size of the field representing the |
| 155 | actual clock ID. */ |
| 156 | #define CLOCK_IDFIELD_SIZE 3 |
| 157 | |
| 158 | #endif |
| 159 | #endif |
| 160 | |