mbed TLS v2.28.0
platform_time.h
Go to the documentation of this file.
1
6/*
7 * Copyright The Mbed TLS Contributors
8 * SPDX-License-Identifier: Apache-2.0
9 *
10 * Licensed under the Apache License, Version 2.0 (the "License"); you may
11 * not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
13 *
14 * http://www.apache.org/licenses/LICENSE-2.0
15 *
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
21 */
22#ifndef MBEDTLS_PLATFORM_TIME_H
23#define MBEDTLS_PLATFORM_TIME_H
24
25#if !defined(MBEDTLS_CONFIG_FILE)
26#include "mbedtls/config.h"
27#else
28#include MBEDTLS_CONFIG_FILE
29#endif
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
43/*
44 * The time_t datatype
45 */
46#if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO)
47typedef MBEDTLS_PLATFORM_TIME_TYPE_MACRO mbedtls_time_t;
48#else
49/* For time_t */
50#include <time.h>
51typedef time_t mbedtls_time_t;
52#endif /* MBEDTLS_PLATFORM_TIME_TYPE_MACRO */
53
54/*
55 * The function pointers for time
56 */
57#if defined(MBEDTLS_PLATFORM_TIME_ALT)
59
67int mbedtls_platform_set_time( mbedtls_time_t (*time_func)( mbedtls_time_t* time ) );
68#else
69#if defined(MBEDTLS_PLATFORM_TIME_MACRO)
70#define mbedtls_time MBEDTLS_PLATFORM_TIME_MACRO
71#else
72#define mbedtls_time time
73#endif /* MBEDTLS_PLATFORM_TIME_MACRO */
74#endif /* MBEDTLS_PLATFORM_TIME_ALT */
75
76#ifdef __cplusplus
77}
78#endif
79
80#endif /* platform_time.h */
Configuration options (set of defines)
#define mbedtls_time
Definition: platform_time.h:72
time_t mbedtls_time_t
Definition: platform_time.h:51