Strophe 0.13
XMPP client library
|
Event handler management. More...
Typedefs | |
typedef int(* | xmpp_void_handler) () |
Functions | |
static void | _handler_item_remove (xmpp_handlist_t **head, xmpp_handlist_t *item) |
static void | _free_handlist_item (xmpp_ctx_t *ctx, xmpp_handlist_t *item) |
void | handler_fire_stanza (xmpp_conn_t *conn, xmpp_stanza_t *stanza) |
Fire off all stanza handlers that match. | |
uint64_t | handler_fire_timed (xmpp_ctx_t *ctx) |
Fire off all timed handlers that are ready. | |
void | handler_reset_timed (xmpp_conn_t *conn, int user_only) |
Reset all timed handlers. | |
static void | _timed_handler_add (xmpp_ctx_t *ctx, xmpp_handlist_t **handlers_list, xmpp_void_handler handler, unsigned long period, void *userdata, int user_handler) |
static void | _timed_handler_delete (xmpp_ctx_t *ctx, xmpp_handlist_t **handlers_list, xmpp_void_handler handler) |
void | xmpp_timed_handler_delete (xmpp_conn_t *conn, xmpp_timed_handler handler) |
Delete a timed handler. | |
static void | _id_handler_add (xmpp_conn_t *conn, xmpp_handler handler, const char *id, void *userdata, int user_handler) |
void | xmpp_id_handler_delete (xmpp_conn_t *conn, xmpp_handler handler, const char *id) |
Delete an id based stanza handler. | |
static int | _dup_string (xmpp_ctx_t *ctx, const char *src, char **dest) |
static void | _handler_add (xmpp_conn_t *conn, xmpp_handler handler, const char *ns, const char *name, const char *type, void *userdata, int user_handler) |
void | xmpp_handler_delete (xmpp_conn_t *conn, xmpp_handler handler) |
Delete a stanza handler. | |
void | xmpp_timed_handler_add (xmpp_conn_t *conn, xmpp_timed_handler handler, unsigned long period, void *userdata) |
Add a timed handler. | |
void | handler_add_timed (xmpp_conn_t *conn, xmpp_timed_handler handler, unsigned long period, void *userdata) |
Add a timed system handler. | |
void | xmpp_id_handler_add (xmpp_conn_t *conn, xmpp_handler handler, const char *id, void *userdata) |
Add an id based stanza handler. | |
void | handler_add_id (xmpp_conn_t *conn, xmpp_handler handler, const char *id, void *userdata) |
Add an id based system stanza handler. | |
void | xmpp_handler_add (xmpp_conn_t *conn, xmpp_handler handler, const char *ns, const char *name, const char *type, void *userdata) |
Add a stanza handler. | |
void | handler_add (xmpp_conn_t *conn, xmpp_handler handler, const char *ns, const char *name, const char *type, void *userdata) |
Add a system stanza handler. | |
void | handler_system_delete_all (xmpp_conn_t *conn) |
Delete all system handlers. | |
void | xmpp_global_timed_handler_add (xmpp_ctx_t *ctx, xmpp_global_timed_handler handler, unsigned long period, void *userdata) |
Add a global timed handler. | |
void | xmpp_global_timed_handler_delete (xmpp_ctx_t *ctx, xmpp_global_timed_handler handler) |
Delete a global timed handler. | |
Event handler management.
typedef int(* xmpp_void_handler) () |
|
static |
|
static |
void handler_fire_stanza | ( | xmpp_conn_t * | conn, |
xmpp_stanza_t * | stanza | ||
) |
Fire off all stanza handlers that match.
This function is called internally by the event loop whenever stanzas are received from the XMPP server.
conn | a Strophe connection object |
stanza | a Strophe stanza object |
uint64_t handler_fire_timed | ( | xmpp_ctx_t * | ctx | ) |
Fire off all timed handlers that are ready.
This function is called internally by the event loop.
ctx | a Strophe context object |
void handler_reset_timed | ( | xmpp_conn_t * | conn, |
int | user_only | ||
) |
Reset all timed handlers.
This function is called internally when a connection is successful.
conn | a Strophe connection object |
user_only | whether to reset all handlers or only user ones |
|
static |
|
static |
|
static |
|
static |
|
static |
void handler_add_timed | ( | xmpp_conn_t * | conn, |
xmpp_timed_handler | handler, | ||
unsigned long | period, | ||
void * | userdata | ||
) |
Add a timed system handler.
This function is used to add internal timed handlers and should not be used outside of the library.
conn | a Strophe connection object |
handler | a function pointer to a timed handler |
period | the time in milliseconds between firings |
userdata | an opaque data pointer that will be passed to the handler |
void handler_add_id | ( | xmpp_conn_t * | conn, |
xmpp_handler | handler, | ||
const char * | id, | ||
void * | userdata | ||
) |
Add an id based system stanza handler.
This function is used to add internal id based stanza handlers and should not be used outside of the library.
conn | a Strophe connection object |
handler | a function pointer to a stanza handler |
id | a string with the id |
userdata | an opaque data pointer that will be passed to the handler |
void handler_add | ( | xmpp_conn_t * | conn, |
xmpp_handler | handler, | ||
const char * | ns, | ||
const char * | name, | ||
const char * | type, | ||
void * | userdata | ||
) |
Add a system stanza handler.
This function is used to add internal stanza handlers and should not be used outside of the library.
conn | a Strophe connection object |
handler | a function pointer to a stanza handler |
ns | a string with the namespace to match |
name | a string with the stanza name to match |
type | a string with the 'type' attribute value to match |
userdata | an opaque data pointer that will be passed to the handler |
void handler_system_delete_all | ( | xmpp_conn_t * | conn | ) |
Delete all system handlers.
This function is used to reset conn object before re-connecting.
conn | a Strophe connection object |