2.3.90-16
[glibc/history.git] / include / time.h
blobc2171ef449e925027387c203d5a190e72bdabdc7
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>
6 # include <xlocale.h>
8 extern __typeof (strftime_l) __strftime_l;
9 libc_hidden_proto (__strftime_l)
10 extern __typeof (strptime_l) __strptime_l;
12 libc_hidden_proto (time)
13 libc_hidden_proto (asctime)
14 libc_hidden_proto (mktime)
15 libc_hidden_proto (timelocal)
16 libc_hidden_proto (localtime)
17 libc_hidden_proto (strftime)
18 libc_hidden_proto (strptime)
20 librt_hidden_proto (clock_gettime)
22 /* Now define the internal interfaces. */
23 struct tm;
25 /* Defined in mktime.c. */
26 extern const unsigned short int __mon_yday[2][13] attribute_hidden;
28 /* Defined in localtime.c. */
29 extern struct tm _tmbuf attribute_hidden;
31 /* Defined in tzset.c. */
32 extern char *__tzstring (const char *string);
34 /* Defined in tzset.c. */
35 extern size_t __tzname_cur_max attribute_hidden;
38 extern int __use_tzfile attribute_hidden;
40 extern void __tzfile_read (const char *file, size_t extra,
41 char **extrap);
42 extern void __tzfile_compute (time_t timer, int use_localtime,
43 long int *leap_correct, int *leap_hit,
44 struct tm *tp);
45 extern void __tzfile_default (const char *std, const char *dst,
46 long int stdoff, long int dstoff);
48 /* Subroutine of `mktime'. Return the `time_t' representation of TP and
49 normalize TP, given that a `struct tm *' maps to a `time_t' as performed
50 by FUNC. Keep track of next guess for time_t offset in *OFFSET. */
51 extern time_t __mktime_internal (struct tm *__tp,
52 struct tm *(*__func) (const time_t *,
53 struct tm *),
54 time_t *__offset);
55 extern struct tm *__localtime_r (__const time_t *__timer,
56 struct tm *__tp) attribute_hidden;
58 extern struct tm *__gmtime_r (__const time_t *__restrict __timer,
59 struct tm *__restrict __tp);
60 libc_hidden_proto (__gmtime_r)
62 /* Compute the `struct tm' representation of *T,
63 offset OFFSET seconds east of UTC,
64 and store year, yday, mon, mday, wday, hour, min, sec into *TP.
65 Return nonzero if successful. */
66 extern int __offtime (__const time_t *__timer,
67 long int __offset,
68 struct tm *__tp);
70 extern char *__asctime_r (__const struct tm *__tp, char *__buf);
71 extern void __tzset (void);
73 /* Prototype for the internal function to get information based on TZ. */
74 extern struct tm *__tz_convert (const time_t *timer, int use_localtime, struct tm *tp);
76 /* Return the maximum length of a timezone name.
77 This is what `sysconf (_SC_TZNAME_MAX)' does. */
78 extern long int __tzname_max (void);
80 extern int __nanosleep (__const struct timespec *__requested_time,
81 struct timespec *__remaining);
82 libc_hidden_proto(__nanosleep)
83 extern int __getdate_r (__const char *__string, struct tm *__resbufp);
86 /* Determine CLK_TCK value. */
87 extern int __getclktck (void);
90 /* strptime support. */
91 /* Status of lookup: do we use the locale data or the raw data? */
92 enum ptime_locale_status { not, loc, raw };
94 extern char * __strptime_internal (const char *rp, const char *fmt,
95 struct tm *tm,
96 enum ptime_locale_status *decided,
97 int era_cnt, __locale_t locparam)
98 internal_function;
100 extern double __difftime (time_t time1, time_t time0);
103 /* Use in the clock_* functions. Size of the field representing the
104 actual clock ID. */
105 #ifndef _ISOMAC
106 # define CLOCK_IDFIELD_SIZE 3
107 #endif
108 #endif
109 #endif