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