]> git.sur5r.net Git - cc65/blob - libsrc/geos/system/systime.c
Stefan Haubenthal's patch for Contiki port
[cc65] / libsrc / geos / system / systime.c
1
2 /*
3  * systime.c
4  *
5  * Maciej 'YTM/Elysium' Witkowiak, 22.11.2002
6  */
7
8 #include <time.h>
9 #include <geos.h>
10
11 time_t _systime(void) {
12
13 struct tm currentTime;
14
15     currentTime.tm_sec = system_date.s_seconds;
16     currentTime.tm_min = system_date.s_minutes;
17     currentTime.tm_hour = system_date.s_hour;
18     currentTime.tm_mday = system_date.s_day;
19     currentTime.tm_mon = system_date.s_month;
20     currentTime.tm_year = system_date.s_year;
21     if (system_date.s_year < 87) {
22         currentTime.tm_year+=100;
23     }
24     currentTime.tm_isdst = -1;
25
26     return mktime(&currentTime);
27
28 }
29
30 clock_t clock(void) {
31
32     return _systime();
33
34 }