]> git.ipfire.org Git - thirdparty/glibc.git/blame - include/time.h
* iconv/gconv_int.h (__GCONV_NULCONV): New internal only error code.
[thirdparty/glibc.git] / include / time.h
CommitLineData
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 10extern __typeof (strftime_l) __strftime_l;
ee2a5ae8 11libc_hidden_proto (__strftime_l)
da4cfe38
RM
12extern __typeof (strptime_l) __strptime_l;
13
c5598d47
RM
14libc_hidden_proto (time)
15libc_hidden_proto (asctime)
16libc_hidden_proto (mktime)
17libc_hidden_proto (timelocal)
18libc_hidden_proto (localtime)
19libc_hidden_proto (strftime)
20libc_hidden_proto (strptime)
21
a9564ae9
UD
22librt_hidden_proto (clock_gettime)
23
bdbf022d
UD
24/* Now define the internal interfaces. */
25struct tm;
26
8632b240 27/* Defined in mktime.c. */
ab26a24a 28extern const unsigned short int __mon_yday[2][13] attribute_hidden;
8632b240
UD
29
30/* Defined in localtime.c. */
418f1701 31extern struct tm _tmbuf attribute_hidden;
8632b240
UD
32
33/* Defined in tzset.c. */
c19559b0 34extern char *__tzstring (const char *string);
8632b240
UD
35
36/* Defined in tzset.c. */
418f1701 37extern size_t __tzname_cur_max attribute_hidden;
8632b240
UD
38
39
418f1701 40extern int __use_tzfile attribute_hidden;
8632b240 41
fe559c5e 42extern void __tzfile_read (const char *file, size_t extra,
c19559b0 43 char **extrap);
38e68573
UD
44extern void __tzfile_compute (time_t timer, int use_localtime,
45 long int *leap_correct, int *leap_hit,
46 struct tm *tp);
fe559c5e 47extern 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
53extern time_t __mktime_internal (struct tm *__tp,
54 struct tm *(*__func) (const time_t *,
55 struct tm *),
c19559b0 56 time_t *__offset);
fe559c5e 57extern struct tm *__localtime_r (__const time_t *__timer,
dff07c4b 58 struct tm *__tp) attribute_hidden;
bdbf022d 59
fe559c5e 60extern struct tm *__gmtime_r (__const time_t *__restrict __timer,
c19559b0 61 struct tm *__restrict __tp);
230491f0 62libc_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
68extern int __offtime (__const time_t *__timer,
69 long int __offset,
c19559b0 70 struct tm *__tp);
bdbf022d 71
c19559b0
UD
72extern char *__asctime_r (__const struct tm *__tp, char *__buf);
73extern void __tzset (void);
bdbf022d 74
8632b240 75/* Prototype for the internal function to get information based on TZ. */
c19559b0 76extern 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 80extern long int __tzname_max (void);
bdbf022d 81
fe559c5e 82extern int __nanosleep (__const struct timespec *__requested_time,
c19559b0 83 struct timespec *__remaining);
b32e6700 84libc_hidden_proto (__nanosleep)
d5ba53f9 85extern int __nanosleep_nocancel (__const struct timespec *__requested_time,
b32e6700
RM
86 struct timespec *__remaining)
87 attribute_hidden;
c19559b0 88extern int __getdate_r (__const char *__string, struct tm *__resbufp);
25b3dd49
UD
89
90
91/* Determine CLK_TCK value. */
92extern 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
99enum ptime_locale_status { not, loc, raw };
100
101extern 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 108extern 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