libzrtp  1.2.0
ZRTP VoIP security
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
zrtp_iface_system.h
Go to the documentation of this file.
1 /*
2  * libZRTP SDK library, implements the ZRTP secure VoIP protocol.
3  * Copyright (c) 2006-2009 Philip R. Zimmermann. All rights reserved.
4  * Contact: http://philzimmermann.com
5  * For licensing and other legal details, see the file zrtp_legal.c.
6  *
7  * Viktor Krykun <v.krikun at zfoneproject.com>
8  */
9 
10 
16 #ifndef __ZRTP_IFACE_SYSTEM_H__
17 #define __ZRTP_IFACE_SYSTEM_H__
18 
19 #include "zrtp_config.h"
20 #include "zrtp_types.h"
21 
22 #if defined(__cplusplus)
23 extern "C"
24 {
25 #endif
26 
27 
28 /*============================================================================*/
29 /* System wide functions */
30 /*============================================================================*/
31 
50 typedef uint64_t zrtp_time_t;
51 
52 
64 extern void* zrtp_sys_alloc(unsigned int size);
65 
74 extern void zrtp_sys_free(void* obj);
75 
88 extern void* zrtp_memcpy(void* dest, const void* src, unsigned int length);
89 
98 extern void *zrtp_memset(void *s, int c, unsigned int n);
99 
106 extern zrtp_time_t zrtp_time_now();
107 
110 /*============================================================================*/
111 /* Mutex related interfaces */
112 /*============================================================================*/
113 
133 extern zrtp_status_t zrtp_mutex_init(zrtp_mutex_t** mutex);
134 
146  extern zrtp_status_t zrtp_mutex_destroy(zrtp_mutex_t* mutex);
147 
160 extern zrtp_status_t zrtp_mutex_lock(zrtp_mutex_t* mutex);
161 
175 extern zrtp_status_t zrtp_mutex_unlock(zrtp_mutex_t* mutex);
176 
179 #if defined(__cplusplus)
180 }
181 #endif
182 
183 #endif /* __ZRTP_IFACE_SYSTEM_H__ */