3 #define F(t,n) {t *y = &x.n;}
4 #define C(n) switch(n){case n:;}
10 #ifdef _POSIX_C_SOURCE
23 F(struct timespec,it_interval)
24 F(struct timespec,it_value)
27 C(CLOCK_PROCESS_CPUTIME_ID)
29 C(CLOCK_THREAD_CPUTIME_ID)
44 {int x = CLOCKS_PER_SEC;}
46 {char*(*p)(const struct tm*) = asctime;}
47 {clock_t(*p)(void) = clock;}
48 {char*(*p)(const time_t*) = ctime;}
50 {double(*p)(time_t,time_t) = difftime;}
51 {struct tm*(*p)(const time_t*) = gmtime;}
52 {struct tm*(*p)(const time_t*) = localtime;}
53 {time_t(*p)(struct tm*) = mktime;}
54 {size_t(*p)(char*restrict,size_t,const char*restrict,const struct tm*restrict) = strftime;}
55 {time_t(*p)(time_t*) = time;}
56 #ifdef _POSIX_C_SOURCE
57 {char*(*p)(const struct tm*restrict,char*restrict) = asctime_r;}
58 {int(*p)(pid_t,clockid_t*) = clock_getcpuclockid;}
59 {int(*p)(clockid_t,struct timespec*) = clock_getres;}
60 {int(*p)(clockid_t,struct timespec*) = clock_gettime;}
61 {int(*p)(clockid_t,int,const struct timespec*,struct timespec*) = clock_nanosleep;}
62 {int(*p)(clockid_t,const struct timespec*) = clock_settime;}
63 {char*(*p)(const time_t*,char*) = ctime_r;}
64 {struct tm*(*p)(const time_t*restrict,struct tm*restrict) = gmtime_r;}
65 {struct tm*(*p)(const time_t*restrict,struct tm*restrict) = localtime_r;}
66 {int(*p)(const struct timespec*,struct timespec*) = nanosleep;}
67 {size_t(*p)(char*restrict,size_t,const char*restrict,const struct tm*restrict,locale_t) = strftime_l;}
68 {int(*p)(timer_t) = timer_delete;}
69 {int(*p)(timer_t) = timer_getoverrun;}
70 {int(*p)(timer_t,struct itimerspec*) = timer_gettime;}
71 {int(*p)(timer_t,int,const struct itimerspec*restrict,struct itimerspec*restrict) = timer_settime;}
73 {void(*p)(void) = tzset;}
76 {struct tm*(*p)(const char*) = getdate;}
77 {int i = getdate_err;}
78 {char*(*p)(const char*restrict,const char*restrict,struct tm*restrict) = strptime;}
82 #ifdef _POSIX_C_SOURCE
86 {int(*p)(clockid_t,struct sigevent*restrict,timer_t*restrict) = timer_create;}