Support for type-generic libm function implementations libm
[glibc.git] / include / time.h
blob8dd10dcdd8d9592231c052d31f35e482d081c030
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>
8 __BEGIN_DECLS
10 extern __typeof (strftime_l) __strftime_l;
11 libc_hidden_proto (__strftime_l)
12 extern __typeof (strptime_l) __strptime_l;
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)
22 extern __typeof (clock_getres) __clock_getres;
23 extern __typeof (clock_gettime) __clock_gettime;
24 libc_hidden_proto (__clock_gettime)
25 extern __typeof (clock_settime) __clock_settime;
26 extern __typeof (clock_nanosleep) __clock_nanosleep;
27 extern __typeof (clock_getcpuclockid) __clock_getcpuclockid;
29 /* Now define the internal interfaces. */
30 struct tm;
32 /* Defined in mktime.c. */
33 extern const unsigned short int __mon_yday[2][13] attribute_hidden;
35 /* Defined in localtime.c. */
36 extern struct tm _tmbuf attribute_hidden;
38 /* Defined in tzset.c. */
39 extern char *__tzstring (const char *string);
41 /* Defined in tzset.c. */
42 extern size_t __tzname_cur_max attribute_hidden;
45 extern int __use_tzfile attribute_hidden;
47 extern void __tzfile_read (const char *file, size_t extra,
48 char **extrap);
49 extern void __tzfile_compute (time_t timer, int use_localtime,
50 long int *leap_correct, int *leap_hit,
51 struct tm *tp);
52 extern void __tzfile_default (const char *std, const char *dst,
53 long int stdoff, long int dstoff);
54 extern void __tzset_parse_tz (const char *tz);
55 extern void __tz_compute (time_t timer, struct tm *tm, int use_localtime)
56 __THROW internal_function;
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. */
61 extern time_t __mktime_internal (struct tm *__tp,
62 struct tm *(*__func) (const time_t *,
63 struct tm *),
64 time_t *__offset);
65 extern struct tm *__localtime_r (const time_t *__timer,
66 struct tm *__tp) attribute_hidden;
68 extern struct tm *__gmtime_r (const time_t *__restrict __timer,
69 struct tm *__restrict __tp);
70 libc_hidden_proto (__gmtime_r)
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. */
76 extern int __offtime (const time_t *__timer,
77 long int __offset,
78 struct tm *__tp);
80 extern char *__asctime_r (const struct tm *__tp, char *__buf);
81 extern void __tzset (void);
83 /* Prototype for the internal function to get information based on TZ. */
84 extern struct tm *__tz_convert (const time_t *timer, int use_localtime, struct tm *tp);
86 /* Return the maximum length of a timezone name.
87 This is what `sysconf (_SC_TZNAME_MAX)' does. */
88 extern long int __tzname_max (void);
90 extern int __nanosleep (const struct timespec *__requested_time,
91 struct timespec *__remaining);
92 libc_hidden_proto (__nanosleep)
93 extern int __nanosleep_nocancel (const struct timespec *__requested_time,
94 struct timespec *__remaining)
95 attribute_hidden;
96 extern int __getdate_r (const char *__string, struct tm *__resbufp);
99 /* Determine CLK_TCK value. */
100 extern int __getclktck (void);
103 /* strptime support. */
104 extern char * __strptime_internal (const char *rp, const char *fmt,
105 struct tm *tm, void *statep,
106 __locale_t locparam)
107 internal_function;
109 extern double __difftime (time_t time1, time_t time0);
112 /* Use in the clock_* functions. Size of the field representing the
113 actual clock ID. */
114 #define CLOCK_IDFIELD_SIZE 3
116 __END_DECLS
118 #endif
119 #endif