blob: 846ec21e0068d07d4fa1668e8f61c808410706a6 [file] [log] [blame]
Antonio Nino Diaz27989a82018-08-17 10:45:47 +01001/*
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
18typedef long int clock_t;
19
20struct 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
32extern clock_t clock(void);
33extern double difftime(time_t time1, time_t time0);
34extern time_t mktime(struct tm *timeptr);
35extern time_t time(time_t *timer);
36extern char *asctime(const struct tm *timeptr);
37extern char *ctime(const time_t *timer);
38extern struct tm *gmtime(const time_t *timer);
39extern struct tm *localtime(const time_t *timer);
40extern size_t strftime(char * restrict s, size_t maxsize,
41 const char * restrict format,
42 const struct tm * restrict timeptr);
43
44#endif