xref: /rk3399_ARM-atf/include/lib/libc/time.h (revision 27989a8e34a44ff8e6a2e5b011123a09fd8a82c7)
1 /*
2  * Copyright (c) 2012-2017 Roberto E. Vargas Caballero
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef _TIME_H
8 #define _TIME_H
9 
10 #include <arch/time.h>
11 
12 #ifndef NULL
13 #define NULL ((void *) 0)
14 #endif
15 
16 #define CLOCKS_PER_SEC 1000000
17 
18 typedef long int clock_t;
19 
20 struct tm {
21 	int tm_sec;
22 	int tm_min;
23 	int tm_hour;
24 	int tm_mday;
25 	int tm_mon;
26 	int tm_year;
27 	int tm_wday;
28 	int tm_yday;
29 	int tm_isdst;
30 };
31 
32 extern clock_t clock(void);
33 extern double difftime(time_t time1, time_t time0);
34 extern time_t mktime(struct tm *timeptr);
35 extern time_t time(time_t *timer);
36 extern char *asctime(const struct tm *timeptr);
37 extern char *ctime(const time_t *timer);
38 extern struct tm *gmtime(const time_t *timer);
39 extern struct tm *localtime(const time_t *timer);
40 extern size_t strftime(char * restrict s, size_t maxsize,
41                        const char * restrict format,
42                        const struct tm * restrict timeptr);
43 
44 #endif
45