123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434 |
- #ifndef _TIME_H
- #if (! defined __need_time_t && !defined __need_clock_t && \
- ! defined __need_timespec)
- # define _TIME_H 1
- # include <features.h>
- __BEGIN_DECLS
- #endif
- #ifdef _TIME_H
- # define __need_size_t
- # define __need_NULL
- # include <stddef.h>
- # include <bits/time.h>
- # if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K
- # ifndef CLK_TCK
- # define CLK_TCK CLOCKS_PER_SEC
- # endif
- # endif
- #endif
- #if !defined __clock_t_defined && (defined _TIME_H || defined __need_clock_t)
- # define __clock_t_defined 1
- # include <bits/types.h>
- __BEGIN_NAMESPACE_STD
- typedef __clock_t clock_t;
- __END_NAMESPACE_STD
- #if defined __USE_XOPEN || defined __USE_POSIX
- __USING_NAMESPACE_STD(clock_t)
- #endif
- #endif
- #undef __need_clock_t
- #if !defined __time_t_defined && (defined _TIME_H || defined __need_time_t)
- # define __time_t_defined 1
- # include <bits/types.h>
- __BEGIN_NAMESPACE_STD
- typedef __time_t time_t;
- __END_NAMESPACE_STD
- #ifdef __USE_POSIX
- __USING_NAMESPACE_STD(time_t)
- #endif
- #endif
- #undef __need_time_t
- #if !defined __clockid_t_defined && \
- ((defined _TIME_H && defined __USE_POSIX199309) || defined __need_clockid_t)
- # define __clockid_t_defined 1
- # include <bits/types.h>
- typedef __clockid_t clockid_t;
- #endif
- #undef __clockid_time_t
- #if !defined __timer_t_defined && \
- ((defined _TIME_H && defined __USE_POSIX199309) || defined __need_timer_t)
- # define __timer_t_defined 1
- # include <bits/types.h>
- typedef __timer_t timer_t;
- #endif
- #undef __need_timer_t
- #if (!defined __timespec_defined \
- && ((defined _TIME_H \
- && (defined __USE_POSIX199309 \
- || defined __USE_ISOC11)) \
- || defined __need_timespec))
- # define __timespec_defined 1
- # include <bits/types.h> /* This defines __time_t for us. */
- struct timespec
- {
- __time_t tv_sec;
- __syscall_slong_t tv_nsec;
- };
- #endif
- #undef __need_timespec
- #ifdef _TIME_H
- __BEGIN_NAMESPACE_STD
- struct tm
- {
- int tm_sec;
- int tm_min;
- int tm_hour;
- int tm_mday;
- int tm_mon;
- int tm_year;
- int tm_wday;
- int tm_yday;
- int tm_isdst;
- # ifdef __USE_MISC
- long int tm_gmtoff;
- const char *tm_zone;
- # else
- long int __tm_gmtoff;
- const char *__tm_zone;
- # endif
- };
- __END_NAMESPACE_STD
- #if defined __USE_XOPEN || defined __USE_POSIX
- __USING_NAMESPACE_STD(tm)
- #endif
- # ifdef __USE_POSIX199309
- struct itimerspec
- {
- struct timespec it_interval;
- struct timespec it_value;
- };
- struct sigevent;
- # endif
- # ifdef __USE_XOPEN2K
- # ifndef __pid_t_defined
- typedef __pid_t pid_t;
- # define __pid_t_defined
- # endif
- # endif
- # ifdef __USE_ISOC11
- # define TIME_UTC 1
- # endif
- __BEGIN_NAMESPACE_STD
- extern clock_t clock (void) __THROW;
- extern time_t time (time_t *__timer) __THROW;
- extern double difftime (time_t __time1, time_t __time0)
- __THROW __attribute__ ((__const__));
- extern time_t mktime (struct tm *__tp) __THROW;
- extern size_t strftime (char *__restrict __s, size_t __maxsize,
- const char *__restrict __format,
- const struct tm *__restrict __tp) __THROW;
- __END_NAMESPACE_STD
- # ifdef __USE_XOPEN
- extern char *strptime (const char *__restrict __s,
- const char *__restrict __fmt, struct tm *__tp)
- __THROW;
- # endif
- # ifdef __USE_XOPEN2K8
- # include <xlocale.h>
- extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
- const char *__restrict __format,
- const struct tm *__restrict __tp,
- __locale_t __loc) __THROW;
- # endif
- # ifdef __USE_GNU
- extern char *strptime_l (const char *__restrict __s,
- const char *__restrict __fmt, struct tm *__tp,
- __locale_t __loc) __THROW;
- # endif
- __BEGIN_NAMESPACE_STD
- extern struct tm *gmtime (const time_t *__timer) __THROW;
- extern struct tm *localtime (const time_t *__timer) __THROW;
- __END_NAMESPACE_STD
- # ifdef __USE_POSIX
- extern struct tm *gmtime_r (const time_t *__restrict __timer,
- struct tm *__restrict __tp) __THROW;
- extern struct tm *localtime_r (const time_t *__restrict __timer,
- struct tm *__restrict __tp) __THROW;
- # endif
- __BEGIN_NAMESPACE_STD
- extern char *asctime (const struct tm *__tp) __THROW;
- extern char *ctime (const time_t *__timer) __THROW;
- __END_NAMESPACE_STD
- # ifdef __USE_POSIX
- extern char *asctime_r (const struct tm *__restrict __tp,
- char *__restrict __buf) __THROW;
- extern char *ctime_r (const time_t *__restrict __timer,
- char *__restrict __buf) __THROW;
- # endif
- extern char *__tzname[2];
- extern int __daylight;
- extern long int __timezone;
- # ifdef __USE_POSIX
- extern char *tzname[2];
- extern void tzset (void) __THROW;
- # endif
- # if defined __USE_MISC || defined __USE_XOPEN
- extern int daylight;
- extern long int timezone;
- # endif
- # ifdef __USE_MISC
- extern int stime (const time_t *__when) __THROW;
- # endif
- # define __isleap(year) \
- ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
- # ifdef __USE_MISC
- extern time_t timegm (struct tm *__tp) __THROW;
- extern time_t timelocal (struct tm *__tp) __THROW;
- extern int dysize (int __year) __THROW __attribute__ ((__const__));
- # endif
- # ifdef __USE_POSIX199309
- extern int nanosleep (const struct timespec *__requested_time,
- struct timespec *__remaining);
- extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __THROW;
- extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __THROW;
- extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp)
- __THROW;
- # ifdef __USE_XOPEN2K
- extern int clock_nanosleep (clockid_t __clock_id, int __flags,
- const struct timespec *__req,
- struct timespec *__rem);
- extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __THROW;
- # endif
- extern int timer_create (clockid_t __clock_id,
- struct sigevent *__restrict __evp,
- timer_t *__restrict __timerid) __THROW;
- extern int timer_delete (timer_t __timerid) __THROW;
- extern int timer_settime (timer_t __timerid, int __flags,
- const struct itimerspec *__restrict __value,
- struct itimerspec *__restrict __ovalue) __THROW;
- extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
- __THROW;
- extern int timer_getoverrun (timer_t __timerid) __THROW;
- # endif
- # ifdef __USE_ISOC11
- extern int timespec_get (struct timespec *__ts, int __base)
- __THROW __nonnull ((1));
- # endif
- # ifdef __USE_XOPEN_EXTENDED
- extern int getdate_err;
- extern struct tm *getdate (const char *__string);
- # endif
- # ifdef __USE_GNU
- extern int getdate_r (const char *__restrict __string,
- struct tm *__restrict __resbufp);
- # endif
- __END_DECLS
- #endif
- #endif
|