Rough and ready port of axTLS

ssl/os_port.h

Committer:
ashleymills
Date:
2013-05-13
Revision:
0:5a29fd060ac8

File content as of revision 0:5a29fd060ac8:

#ifndef HEADER_OS_PORT_H
#define HEADER_OS_PORT_H
#ifdef __cplusplus
extern "C" {
#endif

#include "config.h"

//#include <Thread.h>
#define SSL_CTX_MUTEX_TYPE          //Mutex
#define SSL_CTX_MUTEX_INIT(A)       //pthread_mutex_init(&A, NULL)
#define SSL_CTX_MUTEX_DESTROY(A)    //pthread_mutex_destroy(&A)
#define SSL_CTX_LOCK(A)             //pthread_mutex_lock(&A)
#define SSL_CTX_UNLOCK(A)           //pthread_mutex_unlock(&A)

#define malloc(A)       ax_malloc(A)
#ifndef realloc
#define realloc(A,B)    ax_realloc(A,B)
#endif
#define calloc(A,B)     ax_calloc(A,B)

#define STDCALL
#define EXP_FUNC
EXP_FUNC void * STDCALL ax_malloc(size_t s);
EXP_FUNC void * STDCALL ax_realloc(void *y, size_t s);
EXP_FUNC void * STDCALL ax_calloc(size_t n, size_t s);
//EXP_FUNC int STDCALL ax_open(const char *pathname, int flags); 

#define SOCKET_READ(A,B,C)      lwip_recv(A,B,C,0)
#define SOCKET_WRITE(A,B,C)     lwip_send(A,B,C,0)
#define SOCKET_CLOSE(A)         closesocket(A)
#define TTY_FLUSH()
#ifdef __cplusplus
}
#endif
#endif