cyassl re-port with cellular comms, PSK test

Dependencies:   VodafoneUSBModem_bleedingedge2 mbed-rtos mbed-src

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers memory.h Source File

memory.h

00001 /* memory.h
00002  *
00003  * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
00004  *
00005  * This file is part of CyaSSL.
00006  *
00007  * CyaSSL is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or
00010  * (at your option) any later version.
00011  *
00012  * CyaSSL is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
00020  */
00021 
00022 /* submitted by eof */
00023 
00024 
00025 #ifndef CYASSL_MEMORY_H
00026 #define CYASSL_MEMORY_H
00027 
00028 #include <stdlib.h>
00029 
00030 #ifdef __cplusplus
00031     extern "C" {
00032 #endif
00033 
00034 
00035 typedef void *(*CyaSSL_Malloc_cb)(size_t size);
00036 typedef void (*CyaSSL_Free_cb)(void *ptr);
00037 typedef void *(*CyaSSL_Realloc_cb)(void *ptr, size_t size);
00038 
00039 
00040 /* Public set function */
00041 CYASSL_API int CyaSSL_SetAllocators(CyaSSL_Malloc_cb  malloc_function,
00042                                     CyaSSL_Free_cb    free_function,
00043                                     CyaSSL_Realloc_cb realloc_function);
00044 
00045 /* Public in case user app wants to use XMALLOC/XFREE */
00046 CYASSL_API void* CyaSSL_Malloc(size_t size);
00047 CYASSL_API void  CyaSSL_Free(void *ptr);
00048 CYASSL_API void* CyaSSL_Realloc(void *ptr, size_t size);
00049 
00050 
00051 #ifdef __cplusplus
00052 }
00053 #endif
00054 
00055 #endif /* CYASSL_MEMORY_H */