libzrtp  1.2.0
ZRTP VoIP security
Typedefs | Functions
Basic platform-dependent routine

Typedefs

typedef uint64_t zrtp_time_t
 Time in miliseconds. More...
 

Functions

void * zrtp_sys_alloc (unsigned int size)
 Allocates memory of a defined size. More...
 
void zrtp_sys_free (void *obj)
 release memory More...
 
void * zrtp_memcpy (void *dest, const void *src, unsigned int length)
 Memory copying function. More...
 
void * zrtp_memset (void *s, int c, unsigned int n)
 Write a byte to a byte string. More...
 
zrtp_time_t zrtp_time_now ()
 Returns current date and time. More...
 

Detailed Description

Typedef Documentation

typedef uint64_t zrtp_time_t

Time in miliseconds.

libzrtp uses a unix-like time calculation scheme: time since 1/1/1970.

Function Documentation

void* zrtp_memcpy ( void *  dest,
const void *  src,
unsigned int  length 
)

Memory copying function.

This function copies length bytes from memory area src to memory area dest. The memory areas should not overlap.

Parameters
dest- pointer to the destination buffer
src- pointer to the source buffer;
length- number of bytes to be copied.
Returns
  • pointer to the destination buffer (dest)
void* zrtp_memset ( void *  s,
int  c,
unsigned int  n 
)

Write a byte to a byte string.

The zrtp_memset() function writes n bytes of value c (converted to an unsigned char) to the string s.

Returns
  • first argument
void* zrtp_sys_alloc ( unsigned int  size)

Allocates memory of a defined size.

Allocates size bytes and returns a pointer to the allocated memory Allocated memory is not cleared.

Parameters
size- number of bytes for allocation
Returns
  • pointer to the allocated memory if successful.
  • NULL if the memory allocation failed.
void zrtp_sys_free ( void *  obj)

release memory

Release the memory space pointed to by obj, which was returned by a previous zrtp_sys_alloc() call. If obj is NULL, no operation is performed.

Parameters
obj- pointer to the released memory
zrtp_time_t zrtp_time_now ( )

Returns current date and time.

This function should return current unix-like date and time: number of microseconds since 1.1.1970.