Basic platform-dependent routine
[Library Interfaces Overview]

Collaboration diagram for Basic platform-dependent routine:

Typedefs

typedef uint64_t zrtp_time_t
 Time in miliseconds.

Functions

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

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.


Generated on Wed Dec 9 17:31:06 2009 for libzrtp  zfone