X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fapi%2Ftime.c;h=c87fee4029e67a08a3c18f2cdac2dadb94f1a66c;hb=2b9639f0f09c5b8bcd245fac49b2fb9da23b0302;hp=d5d3d6e5146e7e1e7fc5c24f0e585489df11717e;hpb=6a2161f389e6115bb3b948d71c56c8c882eaeda6;p=libc-test diff --git a/src/api/time.c b/src/api/time.c index d5d3d6e..c87fee4 100644 --- a/src/api/time.c +++ b/src/api/time.c @@ -43,46 +43,40 @@ F(int,tm_isdst) {void *x = NULL;} {int x = CLOCKS_PER_SEC;} C(TIMER_ABSTIME) -char*(*p_asctime)(const struct tm*) = asctime; -clock_t(*p_clock)(void) = clock; -char*(*p_ctime)(const time_t*) = ctime; -{int i = daylight;} -double(*p_difftime)(time_t,time_t) = difftime; -struct tm*(*p_gmtime)(const time_t*) = gmtime; -struct tm*(*p_localtime)(const time_t*) = localtime; -time_t(*p_mktime)(struct tm*) = mktime; -size_t(*p_strftime)(char*restrict,size_t,const char*restrict,const struct tm*restrict) = strftime; -time_t(*p_time)(time_t*) = time; +{char*(*p)(const struct tm*) = asctime;} +{clock_t(*p)(void) = clock;} +{char*(*p)(const time_t*) = ctime;} +{double(*p)(time_t,time_t) = difftime;} +{struct tm*(*p)(const time_t*) = gmtime;} +{struct tm*(*p)(const time_t*) = localtime;} +{time_t(*p)(struct tm*) = mktime;} +{size_t(*p)(char*restrict,size_t,const char*restrict,const struct tm*restrict) = strftime;} +{time_t(*p)(time_t*) = time;} #ifdef _POSIX_C_SOURCE -char*(*p_asctime_r)(const struct tm*restrict,char*restrict) = asctime_r; -int(*p_clock_getcpuclockid)(pid_t,clockid_t*) = clock_getcpuclockid; -int(*p_clock_getres)(clockid_t,struct timespec*) = clock_getres; -int(*p_clock_gettime)(clockid_t,struct timespec*) = clock_gettime; -int(*p_clock_nanosleep)(clockid_t,int,const struct timespec*,struct timespec*) = clock_nanosleep; -int(*p_clock_settime)(clockid_t,const struct timespec*) = clock_settime; -char*(*p_ctime_r)(const time_t*,char*) = ctime_r; -struct tm*(*p_gmtime_r)(const time_t*restrict,struct tm*restrict) = gmtime_r; -struct tm*(*p_localtime_r)(const time_t*restrict,struct tm*restrict) = localtime_r; -int(*p_nanosleep)(const struct timespec*,struct timespec*) = nanosleep; -size_t(*p_strftime_l)(char*restrict,size_t,const char*restrict,const struct tm*restrict,locale_t) = strftime_l; -int(*p_timer_delete)(timer_t) = timer_delete; -int(*p_timer_getoverrun)(timer_t) = timer_getoverrun; -int(*p_timer_gettime)(timer_t,struct itimerspec*) = timer_gettime; -int(*p_timer_settime)(timer_t,int,const struct itimerspec*restrict,struct itimerspec*restrict) = timer_settime; +{char*(*p)(const struct tm*restrict,char*restrict) = asctime_r;} +{int(*p)(pid_t,clockid_t*) = clock_getcpuclockid;} +{int(*p)(clockid_t,struct timespec*) = clock_getres;} +{int(*p)(clockid_t,struct timespec*) = clock_gettime;} +{int(*p)(clockid_t,int,const struct timespec*,struct timespec*) = clock_nanosleep;} +{int(*p)(clockid_t,const struct timespec*) = clock_settime;} +{char*(*p)(const time_t*,char*) = ctime_r;} +{struct tm*(*p)(const time_t*restrict,struct tm*restrict) = gmtime_r;} +{struct tm*(*p)(const time_t*restrict,struct tm*restrict) = localtime_r;} +{int(*p)(const struct timespec*,struct timespec*) = nanosleep;} +{size_t(*p)(char*restrict,size_t,const char*restrict,const struct tm*restrict,locale_t) = strftime_l;} +{int(*p)(clockid_t,struct sigevent*restrict,timer_t*restrict) = timer_create;} +{int(*p)(timer_t) = timer_delete;} +{int(*p)(timer_t) = timer_getoverrun;} +{int(*p)(timer_t,struct itimerspec*) = timer_gettime;} +{int(*p)(timer_t,int,const struct itimerspec*restrict,struct itimerspec*restrict) = timer_settime;} {char **x = tzname;} -void(*p_tzset)(void) = tzset; +{void(*p)(void) = tzset;} #endif #ifdef _XOPEN_SOURCE -struct tm*(*p_getdate)(const char*) = getdate; +{struct tm*(*p)(const char*) = getdate;} {int i = getdate_err;} -char*(*p_strptime)(const char*restrict,const char*restrict,struct tm*restrict) = strptime; +{char*(*p)(const char*restrict,const char*restrict,struct tm*restrict) = strptime;} {long i = timezone;} +{int i = daylight;} #endif } -#ifdef _POSIX_C_SOURCE -#include -static void g() -{ -int(*p_timer_create)(clockid_t,struct sigevent*restrict,timer_t*restrict) = timer_create; -} -#endif