mbed TLS v2.16.1
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: GPL-2.0
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License along
21  * with this program; if not, write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23  *
24  * This file is part of mbed TLS (https://tls.mbed.org)
25  */
26 #ifndef MBEDTLS_PLATFORM_TIME_H
27 #define MBEDTLS_PLATFORM_TIME_H
28 
29 #if !defined(MBEDTLS_CONFIG_FILE)
30 #include "config.h"
31 #else
32 #include MBEDTLS_CONFIG_FILE
33 #endif
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
47 /*
48  * The time_t datatype
49  */
50 #if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO)
51 typedef MBEDTLS_PLATFORM_TIME_TYPE_MACRO mbedtls_time_t;
52 #else
53 /* For time_t */
54 #include <time.h>
55 typedef time_t mbedtls_time_t;
56 #endif /* MBEDTLS_PLATFORM_TIME_TYPE_MACRO */
57 
58 /*
59  * The function pointers for time
60  */
61 #if defined(MBEDTLS_PLATFORM_TIME_ALT)
62 extern mbedtls_time_t (*mbedtls_time)( mbedtls_time_t* time );
63 
71 int mbedtls_platform_set_time( mbedtls_time_t (*time_func)( mbedtls_time_t* time ) );
72 #else
73 #if defined(MBEDTLS_PLATFORM_TIME_MACRO)
74 #define mbedtls_time MBEDTLS_PLATFORM_TIME_MACRO
75 #else
76 #define mbedtls_time time
77 #endif /* MBEDTLS_PLATFORM_TIME_MACRO */
78 #endif /* MBEDTLS_PLATFORM_TIME_ALT */
79 
80 #ifdef __cplusplus
81 }
82 #endif
83 
84 #endif /* platform_time.h */
Configuration options (set of defines)
#define mbedtls_time
Definition: platform_time.h:76
time_t mbedtls_time_t
Definition: platform_time.h:55