Zephyr API Documentation  3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
time.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 Intel Corporation
3 * Copyright (c) 2019 Peter Bigot Consulting, LLC
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8#ifndef ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_TIME_H_
9#define ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_TIME_H_
10
11#include <stdint.h>
12#include <zephyr/toolchain.h>
13#include <sys/_types.h>
14#include <sys/_timespec.h>
15
16/* Minimal time.h to fulfill the requirements of certain libraries
17 * like mbedTLS and to support time APIs.
18 */
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24struct tm {
25 int tm_sec;
26 int tm_min;
29 int tm_mon;
34};
35
36#if !defined(__time_t_defined)
37#define __time_t_defined
38typedef _TIME_T_ time_t;
39#endif
40
41#if !defined(__suseconds_t_defined)
42#define __suseconds_t_defined
43typedef _SUSECONDS_T_ suseconds_t;
44#endif
45
46/*
47 * Conversion between civil time and UNIX time. The companion
48 * localtime() and inverse mktime() are not provided here since they
49 * require access to time zone information.
50 */
51struct tm *gmtime(const time_t *timep);
52struct tm *gmtime_r(const time_t *ZRESTRICT timep,
53 struct tm *ZRESTRICT result);
54
56
57#ifdef __cplusplus
58}
59#endif
60
61#endif /* ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_STDIO_H_ */
_TIME_T_ time_t
Definition: _timespec.h:14
#define ZRESTRICT
Definition: common.h:36
struct tm * gmtime(const time_t *timep)
time_t time(time_t *tloc)
_TIME_T_ time_t
Definition: time.h:38
_SUSECONDS_T_ suseconds_t
Definition: time.h:43
struct tm * gmtime_r(const time_t *ZRESTRICT timep, struct tm *ZRESTRICT result)
Definition: time.h:24
int tm_mon
Definition: time.h:29
int tm_year
Definition: time.h:30
int tm_hour
Definition: time.h:27
int tm_sec
Definition: time.h:25
int tm_isdst
Definition: time.h:33
int tm_yday
Definition: time.h:32
int tm_mday
Definition: time.h:28
int tm_min
Definition: time.h:26
int tm_wday
Definition: time.h:31
Macros to abstract toolchain specific capabilities.