generalized pixel format handling in 3d pipeline
[bootcensus] / src / libc / time.h
1 /*
2 pcboot - bootable PC demo/game kernel
3 Copyright (C) 2018-2019  John Tsiombikas <nuclear@member.fsf.org>
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY, without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program.  If not, see <https://www.gnu.org/licenses/>.
17 */
18 #ifndef TIME_H_
19 #define TIME_H_
20
21 typedef long time_t;
22
23 struct tm {
24         int tm_sec;
25         int tm_min;
26         int tm_hour;
27         int tm_mday;
28         int tm_mon;
29         int tm_year;
30         int tm_wday;
31         int tm_yday;
32         int tm_isdst;
33 };
34
35 #define TZOFFS(x)       ((x) * 3600)
36 long timezone;
37
38 time_t time(time_t *tp);
39 char *asctime(struct tm *tm);
40 char *asctime_r(struct tm *tm, char *buf);
41
42 time_t mktime(struct tm *tm);
43 struct tm *gmtime(time_t *tp);
44 struct tm *gmtime_r(time_t *tp, struct tm *tm);
45 struct tm *localtime(time_t *tp);
46 struct tm *localtime_r(time_t *tp, struct tm *tm);
47
48 /* non-standard helpers */
49 int day_of_year(int year, int mon, int day);
50
51
52 #endif  /* TIME_H_ */