Strophe 0.11
XMPP client library
|
Runtime contexts, library initialization and shutdown, and versioning. More...
Macros | |
#define | va_copy(d, s) (memcpy(&d, &s, sizeof(va_list))) |
#define | LIBXMPP_VERSION_MAJOR (0) |
The major version number of Strophe. More... | |
#define | LIBXMPP_VERSION_MINOR (0) |
The minor version number of Strophe. More... | |
#define | EVENT_LOOP_DEFAULT_TIMEOUT 1000 |
The default timeout in milliseconds for the event loop. More... | |
Functions | |
void | xmpp_initialize (void) |
Initialize the Strophe library. More... | |
void | xmpp_shutdown (void) |
Shutdown the Strophe library. More... | |
int | xmpp_version_check (int major, int minor) |
Check that Strophe supports a specific API version. More... | |
static void * | _malloc (size_t size, void *userdata) |
static void | _free (void *p, void *userdata) |
static void * | _realloc (void *p, size_t size, void *userdata) |
static void | xmpp_default_logger (void *userdata, xmpp_log_level_t level, const char *area, const char *msg) |
Log a message. More... | |
xmpp_log_t * | xmpp_get_default_logger (xmpp_log_level_t level) |
Get a default logger with filtering. More... | |
void * | xmpp_alloc (const xmpp_ctx_t *ctx, size_t size) |
Allocate memory in a Strophe context. More... | |
void | xmpp_free (const xmpp_ctx_t *ctx, void *p) |
Free memory in a Strophe context. More... | |
void * | xmpp_realloc (const xmpp_ctx_t *ctx, void *p, size_t size) |
Reallocate memory in a Strophe context. More... | |
void | xmpp_log (const xmpp_ctx_t *ctx, xmpp_log_level_t level, const char *area, const char *fmt, va_list ap) |
Write a log message to the logger. More... | |
void | xmpp_error (const xmpp_ctx_t *ctx, const char *area, const char *fmt,...) |
Write to the log at the ERROR level. More... | |
void | xmpp_warn (const xmpp_ctx_t *ctx, const char *area, const char *fmt,...) |
Write to the log at the WARN level. More... | |
void | xmpp_info (const xmpp_ctx_t *ctx, const char *area, const char *fmt,...) |
Write to the log at the INFO level. More... | |
void | xmpp_debug (const xmpp_ctx_t *ctx, const char *area, const char *fmt,...) |
Write to the log at the DEBUG level. More... | |
void | xmpp_debug_verbose (int level, const xmpp_ctx_t *ctx, const char *area, const char *fmt,...) |
Write to the log at the DEBUG level if verbosity is enabled. More... | |
xmpp_ctx_t * | xmpp_ctx_new (const xmpp_mem_t *mem, const xmpp_log_t *log) |
Create and initialize a Strophe context object. More... | |
void | xmpp_ctx_free (xmpp_ctx_t *ctx) |
Free a Strophe context object that is no longer in use. More... | |
void | xmpp_ctx_set_timeout (xmpp_ctx_t *ctx, unsigned long timeout) |
Set the timeout to use when calling xmpp_run(). More... | |
void | xmpp_ctx_set_verbosity (xmpp_ctx_t *ctx, int level) |
Set the verbosity level of a Strophe context. More... | |
Variables | |
static xmpp_mem_t | xmpp_default_mem |
static const char * | _xmpp_log_level_name [4] = {"DEBUG", "INFO", "WARN", "ERROR"} |
static const xmpp_log_level_t | _xmpp_default_logger_levels [] |
static const xmpp_log_t | _xmpp_default_loggers [] |
static xmpp_log_t | xmpp_default_log = {NULL, NULL} |
Runtime contexts, library initialization and shutdown, and versioning.
#define va_copy | ( | d, | |
s | |||
) | (memcpy(&d, &s, sizeof(va_list))) |
#define LIBXMPP_VERSION_MAJOR (0) |
The major version number of Strophe.
#define LIBXMPP_VERSION_MINOR (0) |
The minor version number of Strophe.
#define EVENT_LOOP_DEFAULT_TIMEOUT 1000 |
The default timeout in milliseconds for the event loop.
This is set to 1 second.
|
static |
|
static |
|
static |
|
static |
Log a message.
The default logger writes to stderr.
userdata | the opaque data used by the default logger. This contains the filter level in the default logger. |
level | the level to log at |
area | the area the log message is for |
msg | the log message |
void * xmpp_alloc | ( | const xmpp_ctx_t * | ctx, |
size_t | size | ||
) |
Allocate memory in a Strophe context.
All Strophe functions will use this to allocate memory.
ctx | a Strophe context object |
size | the number of bytes to allocate |
void xmpp_free | ( | const xmpp_ctx_t * | ctx, |
void * | p | ||
) |
Free memory in a Strophe context.
All Strophe functions will use this to free allocated memory.
ctx | a Strophe context object |
p | a pointer referencing memory to be freed |
void * xmpp_realloc | ( | const xmpp_ctx_t * | ctx, |
void * | p, | ||
size_t | size | ||
) |
Reallocate memory in a Strophe context.
All Strophe functions will use this to reallocate memory.
ctx | a Strophe context object |
p | a pointer to previously allocated memory |
size | the new size in bytes to allocate |
void xmpp_log | ( | const xmpp_ctx_t * | ctx, |
xmpp_log_level_t | level, | ||
const char * | area, | ||
const char * | fmt, | ||
va_list | ap | ||
) |
Write a log message to the logger.
Write a log message to the logger for the context for the specified level and area. This function takes a printf-style format string and a variable argument list (in va_list) format. This function is not meant to be called directly, but is used via xmpp_error, xmpp_warn, xmpp_info, and xmpp_debug.
ctx | a Strophe context object |
level | the level at which to log |
area | the area to log for |
fmt | a printf-style format string for the message |
ap | variable argument list supplied for the format string |
void xmpp_error | ( | const xmpp_ctx_t * | ctx, |
const char * | area, | ||
const char * | fmt, | ||
... | |||
) |
Write to the log at the ERROR level.
This is a convenience function for writing to the log at the ERROR level. It takes a printf-style format string followed by a variable list of arguments for formatting.
ctx | a Strophe context object |
area | the area to log for |
fmt | a printf-style format string followed by a variable list of arguments to format |
void xmpp_warn | ( | const xmpp_ctx_t * | ctx, |
const char * | area, | ||
const char * | fmt, | ||
... | |||
) |
Write to the log at the WARN level.
This is a convenience function for writing to the log at the WARN level. It takes a printf-style format string followed by a variable list of arguments for formatting.
ctx | a Strophe context object |
area | the area to log for |
fmt | a printf-style format string followed by a variable list of arguments to format |
void xmpp_info | ( | const xmpp_ctx_t * | ctx, |
const char * | area, | ||
const char * | fmt, | ||
... | |||
) |
Write to the log at the INFO level.
This is a convenience function for writing to the log at the INFO level. It takes a printf-style format string followed by a variable list of arguments for formatting.
ctx | a Strophe context object |
area | the area to log for |
fmt | a printf-style format string followed by a variable list of arguments to format |
void xmpp_debug | ( | const xmpp_ctx_t * | ctx, |
const char * | area, | ||
const char * | fmt, | ||
... | |||
) |
Write to the log at the DEBUG level.
This is a convenience function for writing to the log at the DEBUG level. It takes a printf-style format string followed by a variable list of arguments for formatting.
ctx | a Strophe context object |
area | the area to log for |
fmt | a printf-style format string followed by a variable list of arguments to format |
void xmpp_debug_verbose | ( | int | level, |
const xmpp_ctx_t * | ctx, | ||
const char * | area, | ||
const char * | fmt, | ||
... | |||
) |
Write to the log at the DEBUG level if verbosity is enabled.
This is a convenience function for writing to the log at the DEBUG level. It takes a printf-style format string followed by a variable list of arguments for formatting.
level | the verbosity level |
ctx | a Strophe context object |
area | the area to log for |
fmt | a printf-style format string followed by a variable list of arguments to format |
|
static |
|
static |
|
static |
|
static |
|
static |