Update.
[glibc.git] / include / time.h
blob3b63b3dc9c0ad4230caa882fdede3cb652445dc2
1 #ifndef _TIME_H
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>
7 libc_hidden_proto (time)
8 libc_hidden_proto (asctime)
9 libc_hidden_proto (mktime)
10 libc_hidden_proto (timelocal)
11 libc_hidden_proto (localtime)
12 libc_hidden_proto (strftime)
13 libc_hidden_proto (strptime)
15 /* Now define the internal interfaces. */
16 struct tm;
18 /* Defined in mktime.c. */
19 extern const unsigned short int __mon_yday[2][13] attribute_hidden;
21 /* Defined in localtime.c. */
22 extern struct tm _tmbuf attribute_hidden;
24 /* Defined in tzset.c. */
25 extern char *__tzstring (const char *string);
27 /* Defined in tzset.c. */
28 extern size_t __tzname_cur_max attribute_hidden;
31 extern int __use_tzfile attribute_hidden;
33 extern void __tzfile_read (const char *file, size_t extra,
34 char **extrap);
35 extern int __tzfile_compute (time_t timer, int use_localtime,
36 long int *leap_correct, int *leap_hit,
37 struct tm *tp);
38 extern void __tzfile_default (const char *std, const char *dst,
39 long int stdoff, long int dstoff);
41 /* Subroutine of `mktime'. Return the `time_t' representation of TP and
42 normalize TP, given that a `struct tm *' maps to a `time_t' as performed
43 by FUNC. Keep track of next guess for time_t offset in *OFFSET. */
44 extern time_t __mktime_internal (struct tm *__tp,
45 struct tm *(*__func) (const time_t *,
46 struct tm *),
47 time_t *__offset);
48 extern struct tm *__localtime_r (__const time_t *__timer,
49 struct tm *__tp) attribute_hidden;
51 extern struct tm *__gmtime_r (__const time_t *__restrict __timer,
52 struct tm *__restrict __tp);
53 libc_hidden_proto (__gmtime_r)
55 /* Compute the `struct tm' representation of *T,
56 offset OFFSET seconds east of UTC,
57 and store year, yday, mon, mday, wday, hour, min, sec into *TP.
58 Return nonzero if successful. */
59 extern int __offtime (__const time_t *__timer,
60 long int __offset,
61 struct tm *__tp);
63 extern char *__asctime_r (__const struct tm *__tp, char *__buf);
64 extern void __tzset (void);
66 /* Prototype for the internal function to get information based on TZ. */
67 extern struct tm *__tz_convert (const time_t *timer, int use_localtime, struct tm *tp);
69 /* Return the maximum length of a timezone name.
70 This is what `sysconf (_SC_TZNAME_MAX)' does. */
71 extern long int __tzname_max (void);
73 extern int __nanosleep (__const struct timespec *__requested_time,
74 struct timespec *__remaining);
75 extern int __getdate_r (__const char *__string, struct tm *__resbufp);
78 /* Determine CLK_TCK value. */
79 extern int __getclktck (void);
80 #endif
81 #endif