123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- #ifndef _TIME_H
- #define _TIME_H
- #include <features.h>
- #include <sys/time.h>
- #ifndef _TIME_T
- #define _TIME_T
- typedef long time_t;
- #endif
- #ifndef _CLOCK_T
- #define _CLOCK_T
- typedef long clock_t;
- #endif
- #ifndef _SIZE_T
- #define _SIZE_T
- typedef unsigned int size_t;
- #endif
- #ifndef NULL
- #ifdef __cplusplus
- #define NULL 0
- #else
- #define NULL ((void *) 0)
- #endif
- #endif
- #define CLOCKS_PER_SEC 100
- #define CLK_TCK 100
- 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;
-
- long int __tm_gmtoff__;
- __const char *__tm_zone__;
- };
- #define __isleap(year) \
- ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
- extern char *tzname[2];
- extern int daylight;
- extern long int timezone;
- __BEGIN_DECLS
- extern int stime __P ((time_t* __tptr));
- extern clock_t clock __P ((void));
- extern time_t time __P ((time_t * __tp));
- extern __CONSTVALUE double difftime __P ((time_t __time2,
- time_t __time1)) __CONSTVALUE2;
- extern time_t mktime __P ((struct tm * __tp));
- extern char * asctime __P ((__const struct tm * __tp));
- extern char * ctime __P ((__const time_t * __tp));
- extern size_t strftime __P ((char * __s, size_t __smax,
- __const char * __fmt, __const struct tm * __tp));
- extern char * strptime __P ((__const char * __s, __const char * __fmt,
- struct tm * __tm));
- extern void tzset __P ((void));
- extern struct tm* gmtime __P ((__const time_t *__tp));
- extern struct tm* localtime __P ((__const time_t * __tp));
- #ifdef __USE_MISC
- extern time_t timegm __P ((struct tm *__tp));
-
- extern time_t timelocal __P ((struct tm *__tp));
- #endif
- extern char * asctime_r __P((__const struct tm *, char *));
- extern char * ctime_r __P((__const time_t *, char *));
- extern struct tm* gmtime_r __P((__const time_t *, struct tm *));
- extern struct tm* localtime_r __P((__const time_t *, struct tm *));
- struct timespec;
- extern int nanosleep __P((__const struct timespec *__rqtp,
- struct timespec *__rmtp));
- __END_DECLS
- #endif
|