Strophe  0.8
XMPP client library
Functions
stanza.c File Reference

Stanza creation and manipulation. More...

Functions

xmpp_stanza_t * xmpp_stanza_new (xmpp_ctx_t *ctx)
 Create a stanza object.
xmpp_stanza_t * xmpp_stanza_clone (xmpp_stanza_t *const stanza)
 Clone a stanza object.
xmpp_stanza_t * xmpp_stanza_copy (const xmpp_stanza_t *const stanza)
 Copy a stanza and its children.
int xmpp_stanza_release (xmpp_stanza_t *const stanza)
 Release a stanza object and all of its children.
int xmpp_stanza_is_text (xmpp_stanza_t *const stanza)
 Determine if a stanza is a text node.
int xmpp_stanza_is_tag (xmpp_stanza_t *const stanza)
 Determine if a stanza is a tag node.
static void _render_update (int *written, const int length, const int lastwrite, size_t *left, char **ptr)
static int _render_stanza_recursive (xmpp_stanza_t *stanza, char *const buf, size_t const buflen)
int xmpp_stanza_to_text (xmpp_stanza_t *stanza, char **const buf, size_t *const buflen)
 Render a stanza object to text.
int xmpp_stanza_set_name (xmpp_stanza_t *stanza, const char *const name)
 Set the name of a stanza.
char * xmpp_stanza_get_name (xmpp_stanza_t *const stanza)
 Get the stanza name.
int xmpp_stanza_get_attribute_count (xmpp_stanza_t *const stanza)
 Count the attributes in a stanza object.
int xmpp_stanza_get_attributes (xmpp_stanza_t *const stanza, const char **attr, int attrlen)
 Get all attributes for a stanza object.
int xmpp_stanza_set_attribute (xmpp_stanza_t *const stanza, const char *const key, const char *const value)
 Set an attribute for a stanza object.
int xmpp_stanza_set_ns (xmpp_stanza_t *const stanza, const char *const ns)
 Set the stanza namespace.
int xmpp_stanza_add_child (xmpp_stanza_t *stanza, xmpp_stanza_t *child)
 Add a child stanza to a stanza object.
int xmpp_stanza_set_text (xmpp_stanza_t *stanza, const char *const text)
 Set the text data for a text stanza.
int xmpp_stanza_set_text_with_size (xmpp_stanza_t *stanza, const char *const text, const size_t size)
 Set the text data for a text stanza.
char * xmpp_stanza_get_id (xmpp_stanza_t *const stanza)
 Get the 'id' attribute of the stanza object.
char * xmpp_stanza_get_ns (xmpp_stanza_t *const stanza)
 Get the namespace attribute of the stanza object.
char * xmpp_stanza_get_type (xmpp_stanza_t *const stanza)
 Get the 'type' attribute of the stanza object.
xmpp_stanza_t * xmpp_stanza_get_child_by_name (xmpp_stanza_t *const stanza, const char *const name)
 Get the first child of stanza with name.
xmpp_stanza_t * xmpp_stanza_get_child_by_ns (xmpp_stanza_t *const stanza, const char *const ns)
 Get the first child of a stanza with a given namespace.
xmpp_stanza_t * xmpp_stanza_get_children (xmpp_stanza_t *const stanza)
 Get the list of children.
xmpp_stanza_t * xmpp_stanza_get_next (xmpp_stanza_t *const stanza)
 Get the next sibling of a stanza.
char * xmpp_stanza_get_text (xmpp_stanza_t *const stanza)
 Get the text data for a text stanza.
char * xmpp_stanza_get_text_ptr (xmpp_stanza_t *const stanza)
 Get the text data pointer for a text stanza.
int xmpp_stanza_set_id (xmpp_stanza_t *const stanza, const char *const id)
 Set the 'id' attribute of a stanza.
int xmpp_stanza_set_type (xmpp_stanza_t *const stanza, const char *const type)
 Set the 'type' attribute of a stanza.
char * xmpp_stanza_get_attribute (xmpp_stanza_t *const stanza, const char *const name)
 Get an attribute from a stanza.

Detailed Description

Stanza creation and manipulation.


Function Documentation

static void _render_update ( int *  written,
const int  length,
const int  lastwrite,
size_t *  left,
char **  ptr 
) [inline, static]
static int _render_stanza_recursive ( xmpp_stanza_t *  stanza,
char *const  buf,
size_t const  buflen 
) [static]