source: azure_iot_hub/trunk/musl-1.1.18/include/time.h@ 389

Last change on this file since 389 was 389, checked in by coas-nagasima, 5 years ago

ビルドが通るよう更新

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr;charset=UTF-8
File size: 3.4 KB
Line 
1#ifndef _TIME_H
2#define _TIME_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <features.h>
9
10#ifdef __cplusplus
11#define NULL 0L
12#else
13#define NULL ((void*)0)
14#endif
15
16
17#define __NEED_size_t
18#define __NEED_time_t
19#define __NEED_clock_t
20#define __NEED_struct_timespec
21
22#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
23 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
24 || defined(_BSD_SOURCE)
25#define __NEED_clockid_t
26#define __NEED_timer_t
27#define __NEED_pid_t
28#define __NEED_locale_t
29#endif
30
31#include <bits/alltypes.h>
32
33#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
34#define __tm_gmtoff tm_gmtoff
35#define __tm_zone tm_zone
36#endif
37
38struct tm {
39 int tm_sec;
40 int tm_min;
41 int tm_hour;
42 int tm_mday;
43 int tm_mon;
44 int tm_year;
45 int tm_wday;
46 int tm_yday;
47 int tm_isdst;
48 long __tm_gmtoff;
49 const char *__tm_zone;
50};
51
52clock_t clock (void);
53time_t time (time_t *);
54double difftime (time_t, time_t);
55time_t mktime (struct tm *);
56size_t strftime (char *__restrict, size_t, const char *__restrict, const struct tm *__restrict);
57struct tm *gmtime (const time_t *);
58struct tm *localtime (const time_t *);
59char *asctime (const struct tm *);
60char *ctime (const time_t *);
61int timespec_get(struct timespec *, int);
62
63#ifndef CLOCKS_PER_SEC
64#define CLOCKS_PER_SEC 1000000L
65#endif // CLOCKS_PER_SEC
66
67#define TIME_UTC 1
68
69#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
70 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
71 || defined(_BSD_SOURCE)
72
73size_t strftime_l (char * __restrict, size_t, const char * __restrict, const struct tm * __restrict, locale_t);
74
75struct tm *gmtime_r (const time_t *__restrict, struct tm *__restrict);
76struct tm *localtime_r (const time_t *__restrict, struct tm *__restrict);
77char *asctime_r (const struct tm *__restrict, char *__restrict);
78char *ctime_r (const time_t *, char *);
79
80void tzset (void);
81
82struct itimerspec {
83 struct timespec it_interval;
84 struct timespec it_value;
85};
86
87#define CLOCK_REALTIME 0
88#define CLOCK_MONOTONIC 1
89#define CLOCK_PROCESS_CPUTIME_ID 2
90#define CLOCK_THREAD_CPUTIME_ID 3
91#define CLOCK_MONOTONIC_RAW 4
92#define CLOCK_REALTIME_COARSE 5
93#define CLOCK_MONOTONIC_COARSE 6
94#define CLOCK_BOOTTIME 7
95#define CLOCK_REALTIME_ALARM 8
96#define CLOCK_BOOTTIME_ALARM 9
97#define CLOCK_SGI_CYCLE 10
98#define CLOCK_TAI 11
99
100#define TIMER_ABSTIME 1
101
102int nanosleep (const struct timespec *, struct timespec *);
103int clock_getres (clockid_t, struct timespec *);
104int clock_gettime (clockid_t, struct timespec *);
105int clock_settime (clockid_t, const struct timespec *);
106int clock_nanosleep (clockid_t, int, const struct timespec *, struct timespec *);
107int clock_getcpuclockid (pid_t, clockid_t *);
108
109struct sigevent;
110int timer_create (clockid_t, struct sigevent *__restrict, timer_t *__restrict);
111int timer_delete (timer_t);
112int timer_settime (timer_t, int, const struct itimerspec *__restrict, struct itimerspec *__restrict);
113int timer_gettime (timer_t, struct itimerspec *);
114int timer_getoverrun (timer_t);
115
116extern char *tzname[2];
117
118#endif
119
120
121#if defined(_XOPEN_SOURCE) || defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
122char *strptime (const char *__restrict, const char *__restrict, struct tm *__restrict);
123extern int daylight;
124extern long timezone;
125extern int getdate_err;
126struct tm *getdate (const char *);
127#endif
128
129
130#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
131int stime(const time_t *);
132time_t timegm(struct tm *);
133#endif
134
135#ifdef __cplusplus
136}
137#endif
138
139
140#endif
Note: See TracBrowser for help on using the repository browser.