mbed TLS v2.16.3: platform_time.h Source File

mbed TLS v2.16.3

platform_time.h
Go to the documentation of this file.
1
6 /*
7 * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved
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 * This file is part of mbed TLS (https://tls.mbed.org)
23 */
24 #ifndef MBEDTLS_PLATFORM_TIME_H
25 #define MBEDTLS_PLATFORM_TIME_H
26
27 #if !defined(MBEDTLS_CONFIG_FILE)
28 #include "config.h"
29 #else
30 #include MBEDTLS_CONFIG_FILE
31 #endif
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
45 /*
46 * The time_t datatype
47 */
48 #if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO)
49 typedef MBEDTLS_PLATFORM_TIME_TYPE_MACRO mbedtls_time_t;
50 #else
51 /* For time_t */
52 #include <time.h>
53 typedef time_t mbedtls_time_t;
54 #endif /* MBEDTLS_PLATFORM_TIME_TYPE_MACRO */
55
56 /*
57 * The function pointers for time
58 */
59 #if defined(MBEDTLS_PLATFORM_TIME_ALT)
60 extern mbedtls_time_t (*mbedtls_time)( mbedtls_time_t* time );
61
69 int mbedtls_platform_set_time( mbedtls_time_t (*time_func)( mbedtls_time_t* time ) );
70 #else
71 #if defined(MBEDTLS_PLATFORM_TIME_MACRO)
72 #define mbedtls_time MBEDTLS_PLATFORM_TIME_MACRO
73 #else
74 #define mbedtls_time time
75 #endif /* MBEDTLS_PLATFORM_TIME_MACRO */
76 #endif /* MBEDTLS_PLATFORM_TIME_ALT */
77
78 #ifdef __cplusplus
79 }
80 #endif
81
82 #endif /* platform_time.h */
mbedtls_time_t
time_t mbedtls_time_t
Definition: platform_time.h:53
mbedtls_time
#define mbedtls_time
Definition: platform_time.h:74
config.h
Configuration options (set of defines)