Strophe 0.12
XMPP client library
|
Internally used utility functions. More...
Macros | |
#define | ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) |
#define | xmpp_min(x, y) ((x) < (y) ? (x) : (y)) |
Functions | |
char * | strophe_strtok_r (char *s, const char *delim, char **saveptr) |
strtok_r(3) implementation. | |
uint64_t | time_stamp (void) |
Return an integer based time stamp. | |
uint64_t | time_elapsed (uint64_t t1, uint64_t t2) |
Get the time elapsed between two time stamps. | |
int | string_to_ul (const char *s, unsigned long *ul) |
void | hex_encode (char *writebuf, void *readbuf, size_t len) |
Internally used utility functions.
#define ARRAY_SIZE | ( | arr | ) | (sizeof(arr) / sizeof((arr)[0])) |
#define xmpp_min | ( | x, | |
y | |||
) | ((x) < (y) ? (x) : (y)) |
char * strophe_strtok_r | ( | char * | s, |
const char * | delim, | ||
char ** | saveptr | ||
) |
strtok_r(3) implementation.
This function has appeared in POSIX.1-2001, but not in C standard. For example, visual studio older than 2005 doesn't provide strtok_r() nor strtok_s().
uint64_t time_stamp | ( | void | ) |
Return an integer based time stamp.
This function uses gettimeofday or timeGetTime (on Win32 platforms) to compute an integer based time stamp. This is used internally by the event loop and timed handlers.
uint64_t time_elapsed | ( | uint64_t | t1, |
uint64_t | t2 | ||
) |
Get the time elapsed between two time stamps.
This function returns the time elapsed between t1 and t2 by subtracting t1 from t2. If t2 happened before t1, the result will be negative. This function is used internally by the event loop and timed handlers.
t1 | first time stamp |
t2 | second time stamp |
int string_to_ul | ( | const char * | s, |
unsigned long * | ul | ||
) |
void hex_encode | ( | char * | writebuf, |
void * | readbuf, | ||
size_t | len | ||
) |