Strophe 0.9 XMPP client library

Functions
Stanza and timed event handlers

## Functions
void | xmpp_timed_handler_delete (xmpp_conn_t *const conn, xmpp_timed_handler handler)
| Delete a timed handler.
void | xmpp_id_handler_delete (xmpp_conn_t *const conn, xmpp_handler handler, const char *const id)
| Delete an id based stanza handler.
void | xmpp_handler_delete (xmpp_conn_t *const conn, xmpp_handler handler)
| Delete a stanza handler.
void | xmpp_timed_handler_add (xmpp_conn_t *const conn, xmpp_timed_handler handler, const unsigned long period, void *const userdata)
| Add a timed handler.
void | xmpp_id_handler_add (xmpp_conn_t *const conn, xmpp_handler handler, const char *const id, void *const userdata)
| Add an id based stanza handler.
void | xmpp_handler_add (xmpp_conn_t *const conn, xmpp_handler handler, const char *const ns, const char *const name, const char *const type, void *const userdata)
| Add a stanza handler.

## Detailed Description

## Function Documentation

## ◆ xmpp_timed_handler_delete()

void xmpp_timed_handler_delete | ( | xmpp_conn_t *const | conn,
|  | xmpp_timed_handler | handler )

Delete a timed handler.

Parameters

  conn | a Strophe connection object
  handler | function pointer to the handler

## ◆ xmpp_id_handler_delete()

void xmpp_id_handler_delete | ( | xmpp_conn_t *const | conn,
|  | xmpp_handler | handler,
|  | const char *const | id )

Delete an id based stanza handler.

Parameters

  conn | a Strophe connection object
  handler | a function pointer to a stanza handler
  id | a string containing the id the handler is for

## ◆ xmpp_handler_delete()

void xmpp_handler_delete | ( | xmpp_conn_t *const | conn,
|  | xmpp_handler | handler )

Delete a stanza handler.

Parameters

  conn | a Strophe connection object
  handler | a function pointer to a stanza handler

## ◆ xmpp_timed_handler_add()

void xmpp_timed_handler_add | ( | xmpp_conn_t *const | conn,
|  | xmpp_timed_handler | handler,
|  | const unsigned long | period,
|  | void *const | userdata )

Add a timed handler.

The handler will fire for the first time once the period has elapsed, and continue firing regularly after that. Strophe will try its best to fire handlers as close to the period times as it can, but accuracy will vary depending on the resolution of the event loop.

If the handler function returns true, it will be kept, and if it returns false, it will be deleted from the list of handlers.

Parameters

  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

## ◆ xmpp_id_handler_add()

void xmpp_id_handler_add | ( | xmpp_conn_t *const | conn,
|  | xmpp_handler | handler,
|  | const char *const | id,
|  | void *const | userdata )

Add an id based stanza handler.

This function adds a stanza handler for an <iq/> stanza of type 'result' or 'error' with a specific id attribute. This can be used to handle responses to specific <iq/>s.

If the handler function returns true, it will be kept, and if it returns false, it will be deleted from the list of handlers.

Parameters

  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

## ◆ xmpp_handler_add()

void xmpp_handler_add | ( | xmpp_conn_t *const | conn,
|  | xmpp_handler | handler,
|  | const char *const | ns,
|  | const char *const | name,
|  | const char *const | type,
|  | void *const | userdata )

Add a stanza handler.

This function is used to add a stanza handler to a connection. The handler will be called when the any of the filters match. The name filter matches to the top level stanza name. The type filter matches the 'type' attribute of the top level stanza. The ns filter matches the namespace ('xmlns' attribute) of either the top level stanza or any of it's immediate children (this allows you do handle specific <iq/> stanzas based on the <query/> child namespace.

If the handler function returns true, it will be kept, and if it returns false, it will be deleted from the list of handlers.

Parameters

  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 to match
  userdata | an opaque data pointer that will be passed to the handler