summaryrefslogtreecommitdiff
path: root/libc/include/time.h
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2017-12-27 16:22:00 -0600
committerGitHub <noreply@github.com>2017-12-27 16:22:00 -0600
commit6b611a3046a694d3972f2aa4df90d3ef78801217 (patch)
tree05f295c00cbbc1d5987a05da37e746fb841d4d83 /libc/include/time.h
parent58c860d6c48324eba66dd19540db5584d832cf58 (diff)
parentd88495e3f4061a411e654c7307aa94ac8a98c94b (diff)
Merge pull request #13 from ProjectRevoTPP/libc
add libc building to agbcc.
Diffstat (limited to 'libc/include/time.h')
-rw-r--r--libc/include/time.h90
1 files changed, 90 insertions, 0 deletions
diff --git a/libc/include/time.h b/libc/include/time.h
new file mode 100644
index 0000000..c9c85bc
--- /dev/null
+++ b/libc/include/time.h
@@ -0,0 +1,90 @@
+/*
+ * time.h
+ *
+ * Struct and function declarations for dealing with time.
+ */
+
+#ifndef _TIME_H_
+#define _TIME_H_
+
+#include "_ansi.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef NULL
+#define NULL 0L
+#endif
+
+/* Get _CLOCKS_PER_SEC_ */
+#include <machine/time.h>
+
+#ifndef _CLOCKS_PER_SEC_
+#define _CLOCKS_PER_SEC_ 1000
+#endif
+
+#define CLOCKS_PER_SEC _CLOCKS_PER_SEC_
+#define CLK_TCK CLOCKS_PER_SEC
+#define __need_size_t
+#include <stddef.h>
+
+/* Get _CLOCK_T_ and _TIME_T_. */
+#include <machine/types.h>
+
+#ifndef __clock_t_defined
+typedef _CLOCK_T_ clock_t;
+#define __clock_t_defined
+#endif
+
+#ifndef __time_t_defined
+typedef _TIME_T_ time_t;
+#define __time_t_defined
+#endif
+
+struct tm
+{
+ int tm_sec;
+ int tm_min;
+ int tm_hour;
+ int tm_mday;
+ int tm_mon;
+ int tm_year;
+ int tm_wday;
+ int tm_yday;
+ int tm_isdst;
+};
+
+clock_t _EXFUN(clock, (void));
+double _EXFUN(difftime, (time_t _time2, time_t _time1));
+time_t _EXFUN(mktime, (struct tm *_timeptr));
+time_t _EXFUN(time, (time_t *_timer));
+#ifndef _REENT_ONLY
+char *_EXFUN(asctime, (const struct tm *_tblock));
+char *_EXFUN(ctime, (const time_t *_time));
+struct tm *_EXFUN(gmtime, (const time_t *_timer));
+struct tm *_EXFUN(localtime,(const time_t *_timer));
+#endif
+size_t _EXFUN(strftime, (char *_s, size_t _maxsize, const char *_fmt, const struct tm *_t));
+
+char *_EXFUN(asctime_r, (const struct tm *, char *));
+char *_EXFUN(ctime_r, (const time_t *, char *));
+struct tm *_EXFUN(gmtime_r, (const time_t *, struct tm *));
+struct tm *_EXFUN(localtime_r, (const time_t *, struct tm *));
+
+#ifdef __CYGWIN32__
+#ifndef __STRICT_ANSI__
+extern time_t _timezone __declspec(dllimport);
+extern int _daylight __declspec(dllimport);
+extern char *_tzname[2] __declspec(dllimport);
+
+char *_EXFUN(timezone, (void));
+void _EXFUN(tzset, (void));
+#endif
+#endif /* __CYGWIN32__ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* _TIME_H_ */
+