1 #ifndef _TIME_H 2 #define _TIME_H 3 4 #ifndef _TIME_T 5 #define _TIME_T 6 typedef long time_t; 7 #endif 8 9 #ifndef _SIZE_T 10 #define _SIZE_T 11 typedef unsigned int size_t; 12 #endif 13 14 #ifndef NULL 15 #define NULL ((void *) 0) 16 #endif 17 18 #define CLOCKS_PER_SEC 100 19 20 typedef long clock_t; 21 22 struct tm { 23 int tm_sec; 24 int tm_min; 25 int tm_hour; 26 int tm_mday; 27 int tm_mon; 28 int tm_year; 29 int tm_wday; 30 int tm_yday; 31 int tm_isdst; 32 }; 33 34 #define __isleap(year) \ 35 ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) 36 37 clock_t clock(void); 38 time_t time(time_t * tp); 39 double difftime(time_t time2, time_t time1); 40 time_t mktime(struct tm * tp); 41 42 char * asctime(const struct tm * tp); 43 char * ctime(const time_t * tp); 44 struct tm * gmtime(const time_t *tp); 45 struct tm *localtime(const time_t * tp); 46 size_t strftime(char * s, size_t smax, const char * fmt, const struct tm * tp); 47 void tzset(void); 48 49 #endif