Strophe 0.13
XMPP client library
|
These functions will be removed in the next release. More...
Functions | |
void * | xmpp_alloc (const xmpp_ctx_t *ctx, size_t size) |
Allocate memory in a Strophe context. | |
void * | xmpp_realloc (const xmpp_ctx_t *ctx, void *p, size_t size) |
Reallocate memory in a Strophe context. | |
char * | xmpp_strdup (const xmpp_ctx_t *ctx, const char *s) |
implement our own strdup that uses the ctx allocator | |
char * | xmpp_strndup (const xmpp_ctx_t *ctx, const char *s, size_t len) |
Duplicate a string with a maximum length. | |
void | xmpp_error (const xmpp_ctx_t *ctx, const char *area, const char *fmt,...) |
Write to the log at the ERROR level. | |
void | xmpp_warn (const xmpp_ctx_t *ctx, const char *area, const char *fmt,...) |
Write to the log at the WARN level. | |
void | xmpp_info (const xmpp_ctx_t *ctx, const char *area, const char *fmt,...) |
Write to the log at the INFO level. | |
void | xmpp_debug (const xmpp_ctx_t *ctx, const char *area, const char *fmt,...) |
Write to the log at the DEBUG level. | |
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. | |
char * | xmpp_strtok_r (char *s, const char *delim, char **saveptr) |
strtok_r(3) implementation. | |
void | xmpp_conn_set_keepalive (xmpp_conn_t *conn, int timeout, int interval) |
Set TCP keepalive parameters Turn on TCP keepalive and set timeout and interval. | |
void | xmpp_conn_disable_tls (xmpp_conn_t *conn) |
Disable TLS for this connection, called by users of the library. | |
These functions will be removed in the next release.
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_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 |
char * xmpp_strdup | ( | const xmpp_ctx_t * | ctx, |
const char * | s | ||
) |
implement our own strdup that uses the ctx allocator
Duplicate a string. This function replaces the standard strdup library call with a version that uses the Strophe context object's allocator.
ctx | a Strophe context object |
s | a string |
char * xmpp_strndup | ( | const xmpp_ctx_t * | ctx, |
const char * | s, | ||
size_t | len | ||
) |
Duplicate a string with a maximum length.
This function replaces the standard strndup library call with a version that uses the Strophe context object's allocator.
ctx | a Strophe context object |
s | a string |
len | the maximum length of the string to copy |
len
symbols of the original string or NULL on error 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 |
char * xmpp_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().
void xmpp_conn_set_keepalive | ( | xmpp_conn_t * | conn, |
int | timeout, | ||
int | interval | ||
) |
Set TCP keepalive parameters Turn on TCP keepalive and set timeout and interval.
Zero timeout disables TCP keepalives. The parameters are applied immediately for a non disconnected object. Also, they are applied when the connection object connects successfully.
conn | a Strophe connection object |
timeout | TCP keepalive timeout in seconds |
interval | TCP keepalive interval in seconds |
void xmpp_conn_disable_tls | ( | xmpp_conn_t * | conn | ) |
Disable TLS for this connection, called by users of the library.
Occasionally a server will be misconfigured to send the starttls feature, but will not support the handshake.
conn | a Strophe connection object |