aboutsummaryrefslogtreecommitdiff
path: root/src/lib/include/time.h
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2016-07-16 01:28:04 +0200
committerAlex Auvolat <alex@adnab.me>2016-07-16 01:28:04 +0200
commit59000174aa50ed6b2d24a71576d15e6a53c5be0c (patch)
tree38e0a7623f1b83c4dabb1fddfc49014e623f6456 /src/lib/include/time.h
parent32407e728971006ed3d0885e01c22fb66c8adc57 (diff)
downloadkogata-59000174aa50ed6b2d24a71576d15e6a53c5be0c.tar.gz
kogata-59000174aa50ed6b2d24a71576d15e6a53c5be0c.zip
Add stubs for many libc functions, and a few implemenations too
Diffstat (limited to 'src/lib/include/time.h')
-rw-r--r--src/lib/include/time.h25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/lib/include/time.h b/src/lib/include/time.h
index 6529c9a..fe274bb 100644
--- a/src/lib/include/time.h
+++ b/src/lib/include/time.h
@@ -1,17 +1,20 @@
#pragma once
+#include <stdint.h>
+#include <stddef.h>
+
// TODO
struct tm {
- int tm_sec; // Seconds [0,60].
- int tm_min; // Minutes [0,59].
- int tm_hour; // Hour [0,23].
- int tm_mday; // Day of month [1,31].
- int tm_mon; // Month of year [0,11].
- int tm_year; // Years since 1900.
- int tm_wday; // Day of week [0,6] (Sunday =0).
- int tm_yday; // Day of year [0,365].
- int tm_isdst; // Daylight Savings flag.
+ int tm_sec; // Seconds [0,60].
+ int tm_min; // Minutes [0,59].
+ int tm_hour; // Hour [0,23].
+ int tm_mday; // Day of month [1,31].
+ int tm_mon; // Month of year [0,11].
+ int tm_year; // Years since 1900.
+ int tm_wday; // Day of week [0,6] (Sunday =0).
+ int tm_yday; // Day of year [0,365].
+ int tm_isdst; // Daylight Savings flag.
};
typedef int64_t time_t;
@@ -20,16 +23,12 @@ time_t time(time_t*);
double difftime(time_t time1, time_t time0);
char *asctime(const struct tm *tm);
-char *asctime_r(const struct tm *tm, char *buf);
char *ctime(const time_t *timep);
-char *ctime_r(const time_t *timep, char *buf);
struct tm *gmtime(const time_t *timep);
-struct tm *gmtime_r(const time_t *timep, struct tm *result);
struct tm *localtime(const time_t *timep);
-struct tm *localtime_r(const time_t *timep, struct tm *result);
time_t mktime(struct tm *tm);