Functions
noPoll Support: core support functions used by the library

Functions

nopoll_bool nopoll_base64_decode (const char *content, int length, char *output, int *output_size)
 Decodes the provided base64 content into the user provided buffer. More...
 
nopoll_bool nopoll_base64_encode (const char *content, int length, char *output, int *output_size)
 Allows to encode the provided content, leaving the output on the buffer allocated by the caller. More...
 
void nopoll_cleanup_library (void)
 Optional function that can be called at the very end of the noPoll usage to ensure all memory allocated by the library is released so debugging operations are easier. More...
 
nopoll_bool nopoll_cmp (const char *string1, const char *string2)
 Allows to check if provided strings are equal. More...
 
int nopoll_get_32bit (const char *buffer)
 Allows to get a 32bits integer value from the buffer. More...
 
noPollPtr nopoll_mutex_create (void)
 Creates a mutex with the defined create mutex handler. More...
 
void nopoll_mutex_destroy (noPollPtr mutex)
 Implements a mutex destroy operation on the provided reference. More...
 
void nopoll_mutex_lock (noPollPtr mutex)
 Implements a mutex lock operation on the provided reference. More...
 
void nopoll_mutex_unlock (noPollPtr mutex)
 Implements a mutex unlock operation on the provided reference. More...
 
nopoll_bool nopoll_ncmp (const char *string1, const char *string2, int bytes)
 Allows to check if provided strings are equal for the first bytes. More...
 
nopoll_bool nopoll_nonce (char *buffer, int nonce_size)
 Fills the buffer provided with a random nonce of the requested size. More...
 
void nopoll_sleep (long microseconds)
 Portable subsecond sleep. More...
 
char * nopoll_strdup (const char *buffer)
 Safe strdup () wrapper. More...
 
char * nopoll_strdup_printf (const char *chunk,...)
 Allows to produce an newly allocated string produced by the chunk received plus arguments, using the printf-like format. More...
 
char * nopoll_strdup_printfv (const char *chunk, va_list args)
 DEPRECATED: Allows to produce an string representing the message hold by chunk with the parameters provided. More...
 
void nopoll_thread_handlers (noPollMutexCreate mutex_create, noPollMutexDestroy mutex_destroy, noPollMutexLock mutex_lock, noPollMutexUnlock mutex_unlock)
 Global optional mutex handlers used by noPoll library to create, destroy, lock and unlock mutex. More...
 
int nopoll_timeval_substract (struct timeval *a, struct timeval *b, struct timeval *result)
 Performs a timeval substract leaving the result in (result). More...
 
void nopoll_trim (char *chunk, int *trimmed)
 Removes white spaces and new lines characters from the string providing the count of bytes trimmed from the string. More...
 
int nopoll_vprintf_len (const char *format, va_list args)
 

Detailed Description