-
Notifications
You must be signed in to change notification settings - Fork 0
/
time.kai
52 lines (44 loc) · 1.51 KB
/
time.kai
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#library "libc"
Tm :: struct {
sec: i32 /* seconds after the minute [0-60] */
min: i32 /* minutes after the hour [0-59] */
hour: i32 /* hours since midnight [0-23] */
mday: i32 /* day of the month [1-31] */
mon: i32 /* months since January [0-11] */
year: i32 /* years since 1900 */
wday: i32 /* days since Sunday [0-6] */
yday: i32 /* days since January 1 [0-365] */
isdst: i32 /* Daylight Savings Time flag */
gmtoff: i64 /* offset from UTC in seconds */
zone: *u8 /* timezone abbreviation */
}
Timespec :: struct {
sec: i64
nsec: i64
}
#foreign libc #callconv "c" {
asctime :: (time: *Tm) -> *u8
clock :: () -> u64
ctime :: (clock: *i64) -> *u8
difftime :: (time1: i64, time0: i64) -> f64
getdate :: (s: *u8) -> *Tm
gmtime :: (clock: *i64) -> *Tm
localtime :: (clock: *i64) -> *Tm
mktime :: (time: *Tm) -> i64
strftime :: (s: *u8, size: u64, format: *u8, time: *Tm) -> u64
strptime :: (*u8, *u8, *Tm) -> *u8
time :: (*i64) -> i64
tzset :: () -> void
/* [TSF] Thread safe functions */
asctime_r :: (*Tm, *u8) -> *u8
ctime_r :: (*i64, *u8) -> *u8
gmtime_r :: (*i64, *Tm) -> *Tm
localtime_r :: (*i64, *Tm) -> *Tm
posix2time :: (i64) -> i64
timezone :: (i32, i32) -> *u8
tzsetwall :: () -> void
time2posix :: (i64) -> i64
timelocal :: (*Tm) -> i64
timegm :: (*Tm) -> i64
nanosleep :: (rqtp: *Timespec, rmtp: *Timespec) -> i32
}