• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (C) 2017 The Android Open Source Project
2 // SPDX-License-Identifier: BSD-2-Clause
3 
4 #if !defined(DO_NOT_INCLUDE_TIME_H)
5 #include <time.h>
6 #endif
7 
8 #include "header_checks.h"
9 
time_h()10 static void time_h() {
11   TYPE(clock_t);
12   TYPE(size_t);
13   TYPE(time_t);
14 
15   TYPE(clockid_t);
16   TYPE(timer_t);
17 
18   TYPE(locale_t);
19 
20   TYPE(pid_t);
21 
22   TYPE(struct tm);
23   STRUCT_MEMBER(struct tm, int, tm_sec);
24   STRUCT_MEMBER(struct tm, int, tm_min);
25   STRUCT_MEMBER(struct tm, int, tm_hour);
26   STRUCT_MEMBER(struct tm, int, tm_mday);
27   STRUCT_MEMBER(struct tm, int, tm_mon);
28   STRUCT_MEMBER(struct tm, int, tm_year);
29   STRUCT_MEMBER(struct tm, int, tm_wday);
30   STRUCT_MEMBER(struct tm, int, tm_yday);
31   STRUCT_MEMBER(struct tm, int, tm_isdst);
32 
33   TYPE(struct timespec);
34   STRUCT_MEMBER(struct timespec, time_t, tv_sec);
35   STRUCT_MEMBER(struct timespec, long, tv_nsec);
36 
37   TYPE(struct itimerspec);
38   STRUCT_MEMBER(struct itimerspec, struct timespec, it_interval);
39   STRUCT_MEMBER(struct itimerspec, struct timespec, it_value);
40 
41   MACRO(NULL);
42   MACRO(CLOCKS_PER_SEC);
43 
44   MACRO(CLOCK_MONOTONIC);
45   MACRO(CLOCK_PROCESS_CPUTIME_ID);
46   MACRO(CLOCK_REALTIME);
47   MACRO(CLOCK_THREAD_CPUTIME_ID);
48 
49   MACRO(TIMER_ABSTIME);
50 
51   FUNCTION(asctime, char* (*f)(const struct tm*));
52   FUNCTION(asctime_r, char* (*f)(const struct tm*, char*));
53   FUNCTION(clock, clock_t (*f)(void));
54   FUNCTION(clock_getcpuclockid, int (*f)(pid_t, clockid_t*));
55   FUNCTION(clock_getres, int (*f)(clockid_t, struct timespec*));
56   FUNCTION(clock_gettime, int (*f)(clockid_t, struct timespec*));
57   FUNCTION(clock_nanosleep, int (*f)(clockid_t, int, const struct timespec*, struct timespec*));
58   FUNCTION(clock_settime, int (*f)(clockid_t, const struct timespec*));
59   FUNCTION(ctime, char* (*f)(const time_t*));
60   FUNCTION(ctime_r, char* (*f)(const time_t*, char*));
61   FUNCTION(difftime, double (*f)(time_t, time_t));
62 #if !defined(__BIONIC__)
63   FUNCTION(getdate, struct tm* (*f)(const char*));
64 #endif
65   FUNCTION(gmtime, struct tm* (*f)(const time_t*));
66   FUNCTION(gmtime_r, struct tm* (*f)(const time_t*, struct tm*));
67   FUNCTION(localtime, struct tm* (*f)(const time_t*));
68   FUNCTION(localtime_r, struct tm* (*f)(const time_t*, struct tm*));
69   FUNCTION(mktime, time_t (*f)(struct tm*));
70   FUNCTION(nanosleep, int (*f)(const struct timespec*, struct timespec*));
71   FUNCTION(strftime, size_t (*f)(char*, size_t, const char*, const struct tm*));
72   FUNCTION(strftime_l, size_t (*f)(char*, size_t, const char*, const struct tm*, locale_t));
73   FUNCTION(strptime, char* (*f)(const char*, const char*, struct tm*));
74   FUNCTION(time, time_t (*f)(time_t*));
75   FUNCTION(timer_create, int (*f)(clockid_t, struct sigevent*, timer_t*));
76   FUNCTION(timer_delete, int (*f)(timer_t));
77   FUNCTION(timer_getoverrun, int (*f)(timer_t));
78   FUNCTION(timer_gettime, int (*f)(timer_t, struct itimerspec*));
79   FUNCTION(timer_settime, int (*f)(timer_t, int, const struct itimerspec*, struct itimerspec*));
80   FUNCTION(tzset, void (*f)(void));
81 
82   int i = daylight;
83   long l = timezone;
84   char** sp = tzname;
85 }
86