PatchworkOS
Loading...
Searching...
No Matches
time.h
Go to the documentation of this file.
1#ifndef _TIME_H
2#define _TIME_H 1
3
4#include <stdint.h>
5
6#if defined(__cplusplus)
7extern "C"
8{
9#endif
10
11#include "_internal/NULL.h"
12#include "_internal/clock_t.h"
13#include "_internal/config.h"
14#include "_internal/size_t.h"
15#include "_internal/time_t.h"
16#include "_internal/timespec.h"
17
18#define TIME_UTC 1
19
20struct tm
21{
22 int tm_sec;
23 int tm_min;
26 int tm_mon;
31};
32
34
35_PUBLIC double difftime(time_t time1, time_t time0);
36
37_PUBLIC time_t mktime(struct tm* timeptr);
38
40
41_PUBLIC int timespec_get(struct timespec* ts, int base);
42
43_PUBLIC char* asctime(const struct tm* timeptr);
44
45_PUBLIC char* ctime(const time_t* timer);
46
47_PUBLIC struct tm* gmtime(const time_t* timer);
48
49_PUBLIC struct tm* localtime(const time_t* timer);
50
51_PUBLIC struct tm* localtime_r(const time_t* timer, struct tm* buf);
52
53_PUBLIC size_t strftime(char* _RESTRICT s, size_t maxsize, const char* _RESTRICT format,
54 const struct tm* _RESTRICT timeptr);
55
56#if (__STDC_WANT_LIB_EXT1__ + 0) != 0
57
58#include "_internal/errno_t.h"
59#include "_internal/rsize_t.h"
60
61_PUBLIC errno_t asctime_s(char* s, rsize_t maxsize, const struct tm* timeptr);
62
63_PUBLIC errno_t ctime_s(char* s, rsize_t maxsize, const time_t* timer);
64
65_PUBLIC struct tm* gmtime_s(const time_t* _RESTRICT timer, struct tm* _RESTRICT result);
66
67_PUBLIC struct tm* localtime_s(const time_t* _RESTRICT timer, struct tm* _RESTRICT result);
68
69#endif
70
71#if defined(__cplusplus)
72}
73#endif
74
75#endif
int errno_t
Definition errno_t.h:4
__UINT64_TYPE__ clock_t
A nanosecond time.
Definition clock_t.h:13
#define _PUBLIC
Definition config.h:41
#define _RESTRICT
Definition config.h:17
__SIZE_TYPE__ rsize_t
Definition rsize_t.h:4
Definition time.h:21
int tm_mon
Definition time.h:26
int tm_year
Definition time.h:27
int tm_hour
Definition time.h:24
int tm_sec
Definition time.h:22
int tm_isdst
Definition time.h:30
int tm_yday
Definition time.h:29
int tm_mday
Definition time.h:25
int tm_min
Definition time.h:23
int tm_wday
Definition time.h:28
_PUBLIC time_t time(time_t *timer)
Definition time.c:5
_PUBLIC char * ctime(const time_t *timer)
_PUBLIC double difftime(time_t time1, time_t time0)
_PUBLIC struct tm * gmtime(const time_t *timer)
_PUBLIC size_t strftime(char *_RESTRICT s, size_t maxsize, const char *_RESTRICT format, const struct tm *_RESTRICT timeptr)
_PUBLIC struct tm * localtime_r(const time_t *timer, struct tm *buf)
Definition localtime_r.c:6
_PUBLIC char * asctime(const struct tm *timeptr)
_PUBLIC clock_t clock(void)
Definition clock.c:5
_PUBLIC struct tm * localtime(const time_t *timer)
Definition localtime.c:5
_PUBLIC time_t mktime(struct tm *timeptr)
Definition mktime.c:5
_PUBLIC int timespec_get(struct timespec *ts, int base)
long long unsigned time_t
Definition time_t.h:4