23 #ifndef MBEDTLS_PLATFORM_H 24 #define MBEDTLS_PLATFORM_H 26 #if !defined(MBEDTLS_CONFIG_FILE) 29 #include MBEDTLS_CONFIG_FILE 32 #if defined(MBEDTLS_HAVE_TIME) 48 #if !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) 52 #if !defined(MBEDTLS_PLATFORM_STD_SNPRINTF) 54 #define MBEDTLS_PLATFORM_STD_SNPRINTF mbedtls_platform_win32_snprintf 56 #define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf 59 #if !defined(MBEDTLS_PLATFORM_STD_PRINTF) 60 #define MBEDTLS_PLATFORM_STD_PRINTF printf 62 #if !defined(MBEDTLS_PLATFORM_STD_FPRINTF) 63 #define MBEDTLS_PLATFORM_STD_FPRINTF fprintf 65 #if !defined(MBEDTLS_PLATFORM_STD_CALLOC) 66 #define MBEDTLS_PLATFORM_STD_CALLOC calloc 68 #if !defined(MBEDTLS_PLATFORM_STD_FREE) 69 #define MBEDTLS_PLATFORM_STD_FREE free 71 #if !defined(MBEDTLS_PLATFORM_STD_EXIT) 72 #define MBEDTLS_PLATFORM_STD_EXIT exit 74 #if !defined(MBEDTLS_PLATFORM_STD_TIME) 75 #define MBEDTLS_PLATFORM_STD_TIME time 77 #if !defined(MBEDTLS_PLATFORM_STD_EXIT_SUCCESS) 78 #define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS EXIT_SUCCESS 80 #if !defined(MBEDTLS_PLATFORM_STD_EXIT_FAILURE) 81 #define MBEDTLS_PLATFORM_STD_EXIT_FAILURE EXIT_FAILURE 83 #if defined(MBEDTLS_FS_IO) 84 #if !defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) 85 #define MBEDTLS_PLATFORM_STD_NV_SEED_READ mbedtls_platform_std_nv_seed_read 87 #if !defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) 88 #define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE mbedtls_platform_std_nv_seed_write 90 #if !defined(MBEDTLS_PLATFORM_STD_NV_SEED_FILE) 91 #define MBEDTLS_PLATFORM_STD_NV_SEED_FILE "seedfile" 95 #if defined(MBEDTLS_PLATFORM_STD_MEM_HDR) 96 #include MBEDTLS_PLATFORM_STD_MEM_HDR 106 #if defined(MBEDTLS_PLATFORM_MEMORY) 107 #if defined(MBEDTLS_PLATFORM_FREE_MACRO) && \ 108 defined(MBEDTLS_PLATFORM_CALLOC_MACRO) 109 #define mbedtls_free MBEDTLS_PLATFORM_FREE_MACRO 110 #define mbedtls_calloc MBEDTLS_PLATFORM_CALLOC_MACRO 114 extern void * (*mbedtls_calloc)(
size_t n,
size_t size );
125 int mbedtls_platform_set_calloc_free(
void * (*calloc_func)(
size_t,
size_t ),
129 #define mbedtls_free free 130 #define mbedtls_calloc calloc 136 #if defined(MBEDTLS_PLATFORM_FPRINTF_ALT) 148 int mbedtls_platform_set_fprintf(
int (*fprintf_func)(
FILE *
stream,
const char *,
151 #if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) 152 #define mbedtls_fprintf MBEDTLS_PLATFORM_FPRINTF_MACRO 154 #define mbedtls_fprintf fprintf 161 #if defined(MBEDTLS_PLATFORM_PRINTF_ALT) 171 int mbedtls_platform_set_printf(
int (*printf_func)(
const char *, ... ) );
173 #if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) 174 #define mbedtls_printf MBEDTLS_PLATFORM_PRINTF_MACRO 176 #define mbedtls_printf printf 191 int mbedtls_platform_win32_snprintf(
char *
s,
size_t n,
const char *fmt, ... );
194 #if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) 204 int mbedtls_platform_set_snprintf(
int (*snprintf_func)(
char *
s,
size_t n,
205 const char *
format, ... ) );
207 #if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) 208 #define mbedtls_snprintf MBEDTLS_PLATFORM_SNPRINTF_MACRO 210 #define mbedtls_snprintf snprintf 217 #if defined(MBEDTLS_PLATFORM_EXIT_ALT) 227 int mbedtls_platform_set_exit(
void (*exit_func)(
int status ) );
229 #if defined(MBEDTLS_PLATFORM_EXIT_MACRO) 230 #define mbedtls_exit MBEDTLS_PLATFORM_EXIT_MACRO 232 #define mbedtls_exit exit 239 #if defined(MBEDTLS_PLATFORM_STD_EXIT_SUCCESS) 240 #define MBEDTLS_EXIT_SUCCESS MBEDTLS_PLATFORM_STD_EXIT_SUCCESS 242 #define MBEDTLS_EXIT_SUCCESS 0 244 #if defined(MBEDTLS_PLATFORM_STD_EXIT_FAILURE) 245 #define MBEDTLS_EXIT_FAILURE MBEDTLS_PLATFORM_STD_EXIT_FAILURE 247 #define MBEDTLS_EXIT_FAILURE 1 256 #if defined(MBEDTLS_ENTROPY_NV_SEED) 257 #if !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) && defined(MBEDTLS_FS_IO) 259 int mbedtls_platform_std_nv_seed_read(
unsigned char *
buf,
size_t buf_len );
260 int mbedtls_platform_std_nv_seed_write(
unsigned char *
buf,
size_t buf_len );
263 #if defined(MBEDTLS_PLATFORM_NV_SEED_ALT) 264 extern int (*mbedtls_nv_seed_read)(
unsigned char *
buf,
size_t buf_len );
265 extern int (*mbedtls_nv_seed_write)(
unsigned char *
buf,
size_t buf_len );
275 int mbedtls_platform_set_nv_seed(
276 int (*nv_seed_read_func)(
unsigned char *
buf,
size_t buf_len ),
277 int (*nv_seed_write_func)(
unsigned char *
buf,
size_t buf_len )
280 #if defined(MBEDTLS_PLATFORM_NV_SEED_READ_MACRO) && \ 281 defined(MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO) 282 #define mbedtls_nv_seed_read MBEDTLS_PLATFORM_NV_SEED_READ_MACRO 283 #define mbedtls_nv_seed_write MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO 285 #define mbedtls_nv_seed_read mbedtls_platform_std_nv_seed_read 286 #define mbedtls_nv_seed_write mbedtls_platform_std_nv_seed_write 291 #if !defined(MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT) 305 #include "platform_alt.h" #define mbedtls_exit
Definition: platform.h:232
const GLvoid * ptr
Definition: nx_glsym.h:242
Configuration options (set of defines)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:8418
GLsizeiptr size
Definition: glext.h:6559
int mbedtls_platform_setup(mbedtls_platform_context *ctx)
Perform any platform initialisation operations.
Definition: platform.c:311
GLdouble s
Definition: glext.h:6390
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
#define mbedtls_snprintf
Definition: platform.h:210
AVFormatContext * ctx
Definition: record_ffmpeg.c:247
#define mbedtls_free
Definition: platform.h:129
Platform context structure.
Definition: platform.h:299
char dummy
Definition: platform.h:300
#define FILE
Definition: file_stream_transforms.h:35
#define free_func
Definition: ps3_defines.h:288
GLuint GLuint stream
Definition: glext.h:8189
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: glext.h:6293
mbed TLS Platform time abstraction
#define mbedtls_fprintf
Definition: platform.h:154
void mbedtls_platform_teardown(mbedtls_platform_context *ctx)
Perform any platform teardown operations.
Definition: platform.c:321
GLdouble n
Definition: glext.h:8396
#define mbedtls_printf
Definition: platform.h:176