2017-02-13 17:39:38 -08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2017 Intel Corporation
|
2019-07-11 10:31:58 -05:00
|
|
|
* Copyright (c) 2019 Peter Bigot Consulting, LLC
|
2017-02-13 17:39:38 -08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2019-07-11 10:31:58 -05:00
|
|
|
#ifndef ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_TIME_H_
|
|
|
|
#define ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_TIME_H_
|
2017-02-13 17:39:38 -08:00
|
|
|
|
2019-07-11 10:31:58 -05:00
|
|
|
#include <stdint.h>
|
2019-07-01 10:15:14 -05:00
|
|
|
#include <bits/restrict.h>
|
2019-07-11 10:31:58 -05:00
|
|
|
|
|
|
|
/* Minimal time.h to fulfill the requirements of certain libraries
|
|
|
|
* like mbedTLS and to support time APIs.
|
2017-02-13 17:39:38 -08:00
|
|
|
*/
|
2019-07-11 10:31:58 -05:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct tm {
|
|
|
|
int tm_sec;
|
|
|
|
int tm_min;
|
|
|
|
int tm_hour;
|
|
|
|
int tm_mday;
|
|
|
|
int tm_mon;
|
|
|
|
int tm_year;
|
|
|
|
int tm_wday;
|
|
|
|
int tm_yday;
|
|
|
|
int tm_isdst;
|
|
|
|
};
|
|
|
|
|
2019-08-06 15:43:38 -05:00
|
|
|
#if !defined(__time_t_defined)
|
|
|
|
#define __time_t_defined
|
2019-07-11 10:31:58 -05:00
|
|
|
typedef int64_t time_t;
|
2019-08-06 15:43:38 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(__suseconds_t_defined)
|
|
|
|
#define __suseconds_t_defined
|
2019-07-11 10:31:58 -05:00
|
|
|
typedef int32_t suseconds_t;
|
2019-08-06 15:43:38 -05:00
|
|
|
#endif
|
2019-07-11 10:31:58 -05:00
|
|
|
|
2019-07-25 15:53:55 +03:00
|
|
|
#include <sys/_timespec.h>
|
2019-07-11 10:31:58 -05:00
|
|
|
|
2019-07-01 10:15:14 -05:00
|
|
|
/*
|
|
|
|
* Conversion between civil time and UNIX time. The companion
|
|
|
|
* localtime() and inverse mktime() are not provided here since they
|
|
|
|
* require access to time zone information.
|
|
|
|
*/
|
|
|
|
struct tm *gmtime(const time_t *timep);
|
|
|
|
struct tm *gmtime_r(const time_t *_MLIBC_RESTRICT timep,
|
|
|
|
struct tm *_MLIBC_RESTRICT result);
|
|
|
|
|
2019-07-11 10:31:58 -05:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_STDIO_H_ */
|