diff --git a/www/docfiles/reference.html b/www/docfiles/reference.html index 9155702..73a1b81 100644 --- a/www/docfiles/reference.html +++ b/www/docfiles/reference.html @@ -1,1561 +1,1615 @@ - -
-Add a node to a tree.
- void mxmlAdd (
-
mxml_node_t *parent,
-
int where,
-
mxml_node_t *child,
-
mxml_node_t *node
-
);
Adds the specified node to the parent. If the - child argument is not NULL, puts the new node before or after the - specified child depending on the value of the where argument. If the - child argument is NULL, puts the new node at the beginning of the child - list (MXML_ADD_BEFORE) or at the end of the child list - (MXML_ADD_AFTER). The constant MXML_ADD_TO_PARENT can be used to - specify a NULL child pointer.
-Delete a node and all of its children.
- void mxmlDelete (
-
mxml_node_t *node
-
);
If the specified node has a parent, this function - first removes the node from its parent using the mxmlRemove() function.
-Delete an attribute.
- void mxmlElementDeleteAttr (
-
mxml_node_t *node,
-
const char *name
-
);
Get an attribute.
- const char *mxmlElementGetAttr (
-
mxml_node_t *node,
-
const char *name
-
);
Attribute value or NULL
-This function returns NULL if the node is not an - element or the named attribute does not exist.
-Set an attribute.
- void mxmlElementSetAttr (
-
mxml_node_t *node,
-
const char *name,
-
const char *value
-
);
If the named attribute already exists, the value - of the attribute is replaced by the new string value. The string value - is copied into the element node. This function does nothing if the node - is not an element.
-Set an attribute with a formatted value.
- void mxmlElementSetAttrf (
-
mxml_node_t *node,
-
const char *name,
-
const char *format,
-
...
-
);
If the named attribute already exists, the value - of the attribute is replaced by the new formatted string. The formatted - string value is copied into the element node. This function does - nothing if the node is not an element.
-Add a callback to convert entities to Unicode.
-int mxmlEntityAddCallback (void);
-0 on success, -1 on failure
-Get the name that corresponds to the character - value.
- const char *mxmlEntityGetName (
-
int val
-
);
Entity name or NULL
-If val does not need to be represented by a named - entity, NULL is returned.
-Get the character corresponding to a named - entity.
- int mxmlEntityGetValue (
-
const char *name
-
);
Character value or -1 on error
-The entity name can also be a numeric constant. -1 - is returned if the name is not known.
-Remove a callback.
-void mxmlEntityRemoveCallback (void);
-Find the named element.
- mxml_node_t *mxmlFindElement
- (
-
mxml_node_t *node,
-
mxml_node_t *top,
-
const char *name,
-
const char *attr,
-
const char *value,
-
int descend
-
);
Element node or NULL
-The search is constrained by the name, attribute - name, and value; any NULL names or values are treated as wildcards, so - different kinds of searches can be implemented by looking for all - elements of a given name or all elements with a specific attribute. The - descend argument determines whether the search descends into child - nodes; normally you will use MXML_DESCEND_FIRST for the initial search - and MXML_NO_DESCEND to find additional direct descendents of the node. - The top node argument constrains the search to a particular node's - children.
-Delete an index.
- void mxmlIndexDelete (
-
mxml_index_t *ind
-
);
Return the next node in the index.
- mxml_node_t *mxmlIndexEnum (
-
mxml_index_t *ind
-
);
Next node or NULL if there is none
-Nodes are returned in the sorted order of the - index.
-Find the next matching node.
- mxml_node_t *mxmlIndexFind (
-
mxml_index_t *ind,
-
const char *element,
-
const char *value
-
);
Node or NULL if none found
-You should call mxmlIndexReset() prior to using - this function for the first time with a particular set of "element" and - "value" strings. Passing NULL for both "element" and "value" is - equivalent to calling mxmlIndexEnum().
-Create a new index.
- mxml_index_t *mxmlIndexNew
- (
-
mxml_node_t *node,
-
const char *element,
-
const char *attr
-
);
New index
-The index will contain all nodes that contain the - named element and/or attribute. If both "element" and "attr" are NULL, - then the index will contain a sorted list of the elements in the node - tree. Nodes are sorted by element name and optionally by attribute - value if the "attr" argument is not NULL.
-Reset the enumeration/find pointer in the index - and return the first node in the index.
- mxml_node_t *mxmlIndexReset
- (
-
mxml_index_t *ind
-
);
First node or NULL if there is none
-This function should be called prior to using - mxmlIndexEnum() or mxmlIndexFind() for the first time.
-Load a file descriptor into an XML node tree.
- mxml_node_t *mxmlLoadFd (
-
mxml_node_t *top,
-
int fd,
-
mxml_load_cb_t cb
-
);
First node or NULL if the file could not be read.
-The nodes in the specified file are added to the
- specified top node. If no top node is provided, the XML file MUST be
- well-formed with a single parent node like <?xml> for the entire file.
- The callback function returns the value type that should be used for
- child nodes. If MXML_NO_CALLBACK is specified then all child nodes will
- be either MXML_ELEMENT or MXML_TEXT nodes.
-
-
The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,
- MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loading
- child nodes of the specified type.
Load a file into an XML node tree.
- mxml_node_t *mxmlLoadFile (
-
mxml_node_t *top,
-
FILE *fp,
-
mxml_load_cb_t cb
-
);
First node or NULL if the file could not be read.
-The nodes in the specified file are added to the
- specified top node. If no top node is provided, the XML file MUST be
- well-formed with a single parent node like <?xml> for the entire file.
- The callback function returns the value type that should be used for
- child nodes. If MXML_NO_CALLBACK is specified then all child nodes will
- be either MXML_ELEMENT or MXML_TEXT nodes.
-
-
The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,
- MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loading
- child nodes of the specified type.
Load a string into an XML node tree.
- mxml_node_t *mxmlLoadString
- (
-
mxml_node_t *top,
-
const char *s,
-
mxml_load_cb_t cb
-
);
First node or NULL if the string has errors.
-The nodes in the specified string are added to the
- specified top node. If no top node is provided, the XML string MUST be
- well-formed with a single parent node like <?xml> for the entire
- string. The callback function returns the value type that should be
- used for child nodes. If MXML_NO_CALLBACK is specified then all child
- nodes will be either MXML_ELEMENT or MXML_TEXT nodes.
-
-
The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,
- MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loading
- child nodes of the specified type.
Create a new CDATA node.
- mxml_node_t *mxmlNewCDATA (
-
mxml_node_t *parent,
-
const char *data
-
);
New node
-The new CDATA node is added to the end of the - specified parent's child list. The constant MXML_NO_PARENT can be used - to specify that the new CDATA node has no parent. The data string must - be nul-terminated and is copied into the new node. CDATA nodes use the - MXML_ELEMENT type.
-Create a new custom data node.
- mxml_node_t *mxmlNewCustom (
-
mxml_node_t *parent,
-
void *data,
-
mxml_custom_destroy_cb_t
- destroy
-
);
New node
-The new custom node is added to the end of the - specified parent's child list. The constant MXML_NO_PARENT can be used - to specify that the new element node has no parent. NULL can be passed - when the data in the node is not dynamically allocated or is separately - managed.
-Create a new element node.
- mxml_node_t *mxmlNewElement
- (
-
mxml_node_t *parent,
-
const char *name
-
);
New node
-The new element node is added to the end of the - specified parent's child list. The constant MXML_NO_PARENT can be used - to specify that the new element node has no parent.
-Create a new integer node.
- mxml_node_t *mxmlNewInteger
- (
-
mxml_node_t *parent,
-
int integer
-
);
New node
-The new integer node is added to the end of the - specified parent's child list. The constant MXML_NO_PARENT can be used - to specify that the new integer node has no parent.
-Create a new opaque string.
- mxml_node_t *mxmlNewOpaque (
-
mxml_node_t *parent,
-
const char *opaque
-
);
New node
-The new opaque node is added to the end of the - specified parent's child list. The constant MXML_NO_PARENT can be used - to specify that the new opaque node has no parent. The opaque string - must be nul-terminated and is copied into the new node.
-Create a new real number node.
- mxml_node_t *mxmlNewReal (
-
mxml_node_t *parent,
-
double real
-
);
New node
-The new real number node is added to the end of - the specified parent's child list. The constant MXML_NO_PARENT can be - used to specify that the new real number node has no parent.
-Create a new text fragment node.
- mxml_node_t *mxmlNewText (
-
mxml_node_t *parent,
-
int whitespace,
-
const char *string
-
);
New node
-The new text node is added to the end of the - specified parent's child list. The constant MXML_NO_PARENT can be used - to specify that the new text node has no parent. The whitespace - parameter is used to specify whether leading whitespace is present - before the node. The text string must be nul-terminated and is copied - into the new node.
-Create a new formatted text fragment node.
- mxml_node_t *mxmlNewTextf (
-
mxml_node_t *parent,
-
int whitespace,
-
const char *format,
-
...
-
);
New node
-The new text node is added to the end of the - specified parent's child list. The constant MXML_NO_PARENT can be used - to specify that the new text node has no parent. The whitespace - parameter is used to specify whether leading whitespace is present - before the node. The format string must be nul-terminated and is - formatted into the new node.
-Create a new XML document tree.
- mxml_node_t *mxmlNewXML (
-
const char *version
-
);
New ?xml node
-The "version" argument specifies the version - number to put in the ?xml element node. If NULL, version 1.0 is - assumed.
-Release a node.
- int mxmlRelease (
-
mxml_node_t *node
-
);
New reference count
-When the reference count reaches zero, the node - (and any children) is deleted via mxmlDelete().
-Remove a node from its parent.
- void mxmlRemove (
-
mxml_node_t *node
-
);
Does not free memory used by the node - use - mxmlDelete() for that. This function does nothing if the node has no - parent.
-Retain a node.
- int mxmlRetain (
-
mxml_node_t *node
-
);
New reference count
-Load a file descriptor into an XML node tree - using a SAX callback.
- mxml_node_t *mxmlSAXLoadFd (
-
mxml_node_t *top,
-
int fd,
-
mxml_load_cb_t cb,
-
mxml_sax_cb_t sax_cb,
-
void *sax_data
-
);
First node or NULL if the file could not be read.
-The nodes in the specified file are added to the
- specified top node. If no top node is provided, the XML file MUST be
- well-formed with a single parent node like <?xml> for the entire file.
- The callback function returns the value type that should be used for
- child nodes. If MXML_NO_CALLBACK is specified then all child nodes will
- be either MXML_ELEMENT or MXML_TEXT nodes.
-
-
The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,
- MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loading
- child nodes of the specified type.
-
-
The SAX callback must call mxmlRetain() for any nodes that need to
- be kept for later use. Otherwise, nodes are deleted when the parent
- node is closed or after each data, comment, CDATA, or directive node.
Load a file into an XML node tree using a SAX - callback.
- mxml_node_t *mxmlSAXLoadFile
- (
-
mxml_node_t *top,
-
FILE *fp,
-
mxml_load_cb_t cb,
-
mxml_sax_cb_t sax_cb,
-
void *sax_data
-
);
First node or NULL if the file could not be read.
-The nodes in the specified file are added to the
- specified top node. If no top node is provided, the XML file MUST be
- well-formed with a single parent node like <?xml> for the entire file.
- The callback function returns the value type that should be used for
- child nodes. If MXML_NO_CALLBACK is specified then all child nodes will
- be either MXML_ELEMENT or MXML_TEXT nodes.
-
-
The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,
- MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loading
- child nodes of the specified type.
-
-
The SAX callback must call mxmlRetain() for any nodes that need to
- be kept for later use. Otherwise, nodes are deleted when the parent
- node is closed or after each data, comment, CDATA, or directive node.
Load a string into an XML node tree using a SAX - callback.
- mxml_node_t
- *mxmlSAXLoadString (
-
mxml_node_t *top,
-
const char *s,
-
mxml_load_cb_t cb,
-
mxml_sax_cb_t sax_cb,
-
void *sax_data
-
);
First node or NULL if the string has errors.
-The nodes in the specified string are added to the
- specified top node. If no top node is provided, the XML string MUST be
- well-formed with a single parent node like <?xml> for the entire
- string. The callback function returns the value type that should be
- used for child nodes. If MXML_NO_CALLBACK is specified then all child
- nodes will be either MXML_ELEMENT or MXML_TEXT nodes.
-
-
The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,
- MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loading
- child nodes of the specified type.
-
-
The SAX callback must call mxmlRetain() for any nodes that need to
- be kept for later use. Otherwise, nodes are deleted when the parent
- node is closed or after each data, comment, CDATA, or directive node.
Save an XML node tree to an allocated string.
- char *mxmlSaveAllocString (
-
mxml_node_t *node,
-
mxml_save_cb_t cb
-
);
Allocated string or NULL
-This function returns a pointer to a string
- containing the textual representation of the XML node tree. The string
- should be freed using the free() function when you are done with it.
- NULL is returned if the node would produce an empty string or if the
- string cannot be allocated.
-
-
The callback argument specifies a function that returns a
- whitespace string or NULL before and after each element. If
- MXML_NO_CALLBACK is specified, whitespace will only be added before
- MXML_TEXT nodes with leading whitespace and before attribute names
- inside opening element tags.
Save an XML tree to a file descriptor.
- int mxmlSaveFd (
-
mxml_node_t *node,
-
int fd,
-
mxml_save_cb_t cb
-
);
0 on success, -1 on error.
-The callback argument specifies a function that - returns a whitespace string or NULL before and after each element. If - MXML_NO_CALLBACK is specified, whitespace will only be added before - MXML_TEXT nodes with leading whitespace and before attribute names - inside opening element tags.
-Save an XML tree to a file.
- int mxmlSaveFile (
-
mxml_node_t *node,
-
FILE *fp,
-
mxml_save_cb_t cb
-
);
0 on success, -1 on error.
-The callback argument specifies a function that - returns a whitespace string or NULL before and after each element. If - MXML_NO_CALLBACK is specified, whitespace will only be added before - MXML_TEXT nodes with leading whitespace and before attribute names - inside opening element tags.
-Save an XML node tree to a string.
- int mxmlSaveString (
-
mxml_node_t *node,
-
char *buffer,
-
int bufsize,
-
mxml_save_cb_t cb
-
);
Size of string
-This function returns the total number of bytes
- that would be required for the string but only copies (bufsize - 1)
- characters into the specified buffer.
-
-
The callback argument specifies a function that returns a
- whitespace string or NULL before and after each element. If
- MXML_NO_CALLBACK is specified, whitespace will only be added before
- MXML_TEXT nodes with leading whitespace and before attribute names
- inside opening element tags.
Set the element name of a CDATA node.
- int mxmlSetCDATA (
-
mxml_node_t *node,
-
const char *data
-
);
0 on success, -1 on failure
-The node is not changed if it is not a CDATA - element node.
-Set the data and destructor of a custom data - node.
- int mxmlSetCustom (
-
mxml_node_t *node,
-
void *data,
-
mxml_custom_destroy_cb_t
- destroy
-
);
0 on success, -1 on failure
-The node is not changed if it is not a custom - node.
-Set the handling functions for custom data.
- void mxmlSetCustomHandlers (
-
mxml_custom_load_cb_t
- load,
-
mxml_custom_save_cb_t save
-
);
The load function accepts a node pointer and a
- data string and must return 0 on success and non-zero on error.
-
-
The save function accepts a node pointer and must return a malloc'd
- string on success and NULL on error.
Set the name of an element node.
- int mxmlSetElement (
-
mxml_node_t *node,
-
const char *name
-
);
0 on success, -1 on failure
-The node is not changed if it is not an element - node.
-Set the error message callback.
- void mxmlSetErrorCallback (
-
mxml_error_cb_t cb
-
);
Set the value of an integer node.
- int mxmlSetInteger (
-
mxml_node_t *node,
-
int integer
-
);
0 on success, -1 on failure
-The node is not changed if it is not an integer - node.
-Set the value of an opaque node.
- int mxmlSetOpaque (
-
mxml_node_t *node,
-
const char *opaque
-
);
0 on success, -1 on failure
-The node is not changed if it is not an opaque - node.
-Set the value of a real number node.
- int mxmlSetReal (
-
mxml_node_t *node,
-
double real
-
);
0 on success, -1 on failure
-The node is not changed if it is not a real number - node.
-Set the value of a text node.
- int mxmlSetText (
-
mxml_node_t *node,
-
int whitespace,
-
const char *string
-
);
0 on success, -1 on failure
-The node is not changed if it is not a text node.
-Set the value of a text node to a formatted - string.
- int mxmlSetTextf (
-
mxml_node_t *node,
-
int whitespace,
-
const char *format,
-
...
-
);
0 on success, -1 on failure
-The node is not changed if it is not a text node.
-Set the the wrap margin when saving XML data.
- void mxmlSetWrapMargin (
-
int column
-
);
Wrapping is disabled when "column" is <= 0.
-Walk to the next logical node in the tree.
- mxml_node_t *mxmlWalkNext (
-
mxml_node_t *node,
-
mxml_node_t *top,
-
int descend
-
);
Next node or NULL
-The descend argument controls whether the first - child is considered to be the next node. The top node argument - constrains the walk to the node's children.
-Walk to the previous logical node in the tree.
- mxml_node_t *mxmlWalkPrev (
-
mxml_node_t *node,
-
mxml_node_t *top,
-
int descend
-
);
Previous node or NULL
-The descend argument controls whether the previous - node's last child is considered to be the previous node. The top node - argument constrains the walk to the node's children.
-An XML element attribute value.
-typedef struct mxml_attr_s - mxml_attr_t;
-Custom data destructor
-typedef void (*mxml_custom_destroy_cb_t)(void *);
-Custom data load callback function
-typedef int (*mxml_custom_load_cb_t)( -mxml_node_t *, const char *);
-Custom data save callback function
-typedef char *(*mxml_custom_save_cb_t)( -mxml_node_t *);
-An XML custom value.
-typedef struct mxml_custom_s - mxml_custom_t;
-An XML element value.
-typedef struct mxml_element_s - mxml_element_t;
-Error callback function
-typedef void (*mxml_error_cb_t)(const char *);
-An XML node index.
-typedef struct mxml_index_s - mxml_index_t;
-Load callback function
-typedef mxml_type_t (*mxml_load_cb_t)( -mxml_node_t *);
-An XML node.
-typedef struct mxml_node_s - mxml_node_t;
-Save callback function
-typedef const char *(*mxml_save_cb_t)( -mxml_node_t *, int);
-SAX callback function
-typedef void (*mxml_sax_cb_t)( -mxml_node_t *, mxml_sax_event_t, void *);
-SAX event type.
-typedef enum -mxml_sax_event_e mxml_sax_event_t;
-An XML text value.
-typedef struct mxml_text_s - mxml_text_t;
-An XML node value.
-typedef union mxml_value_u - mxml_value_t;
-An XML element attribute value.
-struct mxml_attr_s {
-
char *name;
-
char *value;
-
};
An XML custom value.
-struct mxml_custom_s {
-
void *data;
-
mxml_custom_destroy_cb_t
- destroy;
-
};
An XML element value.
-struct mxml_element_s {
-
mxml_attr_t *attrs;
-
char *name;
-
int num_attrs;
-
};
An XML node index.
-struct mxml_index_s {
-
int alloc_nodes;
-
char *attr;
-
int cur_node;
-
mxml_node_t **nodes;
-
int num_nodes;
-
};
An XML node.
-struct mxml_node_s {
-
struct mxml_node_s *child;
-
struct mxml_node_s *last_child;
-
struct mxml_node_s *next;
-
struct mxml_node_s *parent;
-
struct mxml_node_s *prev;
-
int ref_count;
-
mxml_type_t type;
-
void *user_data;
-
mxml_value_t value;
-
};
An XML text value.
-struct mxml_text_s {
-
char *string;
-
int whitespace;
-
};
An XML node value.
-union mxml_value_u {
-
mxml_custom_t custom;
-
mxml_element_t element;
-
int integer;
-
char *opaque;
-
double real;
-
mxml_text_t text;
-
};
SAX event type.
-The XML node type.
-Add a node to a tree.
+
+void mxmlAdd (
+ mxml_node_t *parent,
+ int where,
+ mxml_node_t *child,
+ mxml_node_t *node
+);
Adds the specified node to the parent. If the child argument is not +NULL, puts the new node before or after the specified child depending +on the value of the where argument. If the child argument is NULL, +puts the new node at the beginning of the child list (MXML_ADD_BEFORE) +or at the end of the child list (MXML_ADD_AFTER). The constant +MXML_ADD_TO_PARENT can be used to specify a NULL child pointer.
+Delete a node and all of its children.
+
+void mxmlDelete (
+ mxml_node_t *node
+);
If the specified node has a parent, this function first removes the +node from its parent using the mxmlRemove() function.
+Delete an attribute.
+
+void mxmlElementDeleteAttr (
+ mxml_node_t *node,
+ const char *name
+);
Get an attribute.
+
+const char *mxmlElementGetAttr (
+ mxml_node_t *node,
+ const char *name
+);
Attribute value or NULL
+This function returns NULL if the node is not an element or the +named attribute does not exist.
+Set an attribute.
+
+void mxmlElementSetAttr (
+ mxml_node_t *node,
+ const char *name,
+ const char *value
+);
If the named attribute already exists, the value of the attribute +is replaced by the new string value. The string value is copied +into the element node. This function does nothing if the node is +not an element.
+Set an attribute with a formatted value.
+
+void mxmlElementSetAttrf (
+ mxml_node_t *node,
+ const char *name,
+ const char *format,
+ ...
+);
If the named attribute already exists, the value of the attribute +is replaced by the new formatted string. The formatted string value is +copied into the element node. This function does nothing if the node +is not an element. + +
+Add a callback to convert entities to Unicode.
++int mxmlEntityAddCallback (void);
+0 on success, -1 on failure
+Get the name that corresponds to the character value.
+
+const char *mxmlEntityGetName (
+ int val
+);
Entity name or NULL
+If val does not need to be represented by a named entity, NULL is returned.
+Get the character corresponding to a named entity.
+
+int mxmlEntityGetValue (
+ const char *name
+);
Character value or -1 on error
+The entity name can also be a numeric constant. -1 is returned if the +name is not known.
+Remove a callback.
++void mxmlEntityRemoveCallback (void);
+Find the named element.
+
+mxml_node_t *mxmlFindElement (
+ mxml_node_t *node,
+ mxml_node_t *top,
+ const char *name,
+ const char *attr,
+ const char *value,
+ int descend
+);
Element node or NULL
+The search is constrained by the name, attribute name, and value; any +NULL names or values are treated as wildcards, so different kinds of +searches can be implemented by looking for all elements of a given name +or all elements with a specific attribute. The descend argument determines +whether the search descends into child nodes; normally you will use +MXML_DESCEND_FIRST for the initial search and MXML_NO_DESCEND to find +additional direct descendents of the node. The top node argument +constrains the search to a particular node's children.
+Delete an index.
+
+void mxmlIndexDelete (
+ mxml_index_t *ind
+);
Return the next node in the index.
+
+mxml_node_t *mxmlIndexEnum (
+ mxml_index_t *ind
+);
Next node or NULL if there is none
+Nodes are returned in the sorted order of the index.
+Find the next matching node.
+
+mxml_node_t *mxmlIndexFind (
+ mxml_index_t *ind,
+ const char *element,
+ const char *value
+);
Node or NULL if none found
+You should call mxmlIndexReset() prior to using this function for +the first time with a particular set of "element" and "value" +strings. Passing NULL for both "element" and "value" is equivalent +to calling mxmlIndexEnum().
+Create a new index.
+
+mxml_index_t *mxmlIndexNew (
+ mxml_node_t *node,
+ const char *element,
+ const char *attr
+);
New index
+The index will contain all nodes that contain the named element and/or +attribute. If both "element" and "attr" are NULL, then the index will +contain a sorted list of the elements in the node tree. Nodes are +sorted by element name and optionally by attribute value if the "attr" +argument is not NULL.
+Reset the enumeration/find pointer in the index and +return the first node in the index.
+
+mxml_node_t *mxmlIndexReset (
+ mxml_index_t *ind
+);
First node or NULL if there is none
+This function should be called prior to using mxmlIndexEnum() or +mxmlIndexFind() for the first time.
+Load a file descriptor into an XML node tree.
+
+mxml_node_t *mxmlLoadFd (
+ mxml_node_t *top,
+ int fd,
+ mxml_load_cb_t cb
+);
First node or NULL if the file could not be read.
+The nodes in the specified file are added to the specified top node.
+If no top node is provided, the XML file MUST be well-formed with a
+single parent node like <?xml> for the entire file. The callback
+function returns the value type that should be used for child nodes.
+If MXML_NO_CALLBACK is specified then all child nodes will be either
+MXML_ELEMENT or MXML_TEXT nodes.
+
+The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,
+MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loading
+child nodes of the specified type.
Load a file into an XML node tree.
+
+mxml_node_t *mxmlLoadFile (
+ mxml_node_t *top,
+ FILE *fp,
+ mxml_load_cb_t cb
+);
First node or NULL if the file could not be read.
+The nodes in the specified file are added to the specified top node.
+If no top node is provided, the XML file MUST be well-formed with a
+single parent node like <?xml> for the entire file. The callback
+function returns the value type that should be used for child nodes.
+If MXML_NO_CALLBACK is specified then all child nodes will be either
+MXML_ELEMENT or MXML_TEXT nodes.
+
+The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,
+MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loading
+child nodes of the specified type.
Load a string into an XML node tree.
+
+mxml_node_t *mxmlLoadString (
+ mxml_node_t *top,
+ const char *s,
+ mxml_load_cb_t cb
+);
First node or NULL if the string has errors.
+The nodes in the specified string are added to the specified top node.
+If no top node is provided, the XML string MUST be well-formed with a
+single parent node like <?xml> for the entire string. The callback
+function returns the value type that should be used for child nodes.
+If MXML_NO_CALLBACK is specified then all child nodes will be either
+MXML_ELEMENT or MXML_TEXT nodes.
+
+The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,
+MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loading
+child nodes of the specified type.
Create a new CDATA node.
+
+mxml_node_t *mxmlNewCDATA (
+ mxml_node_t *parent,
+ const char *data
+);
New node
+The new CDATA node is added to the end of the specified parent's child +list. The constant MXML_NO_PARENT can be used to specify that the new +CDATA node has no parent. The data string must be nul-terminated and +is copied into the new node. CDATA nodes use the MXML_ELEMENT type. + +
+Create a new custom data node.
+
+mxml_node_t *mxmlNewCustom (
+ mxml_node_t *parent,
+ void *data,
+ mxml_custom_destroy_cb_t destroy
+);
New node
+The new custom node is added to the end of the specified parent's child +list. The constant MXML_NO_PARENT can be used to specify that the new +element node has no parent. NULL can be passed when the data in the +node is not dynamically allocated or is separately managed. + +
+Create a new element node.
+
+mxml_node_t *mxmlNewElement (
+ mxml_node_t *parent,
+ const char *name
+);
New node
+The new element node is added to the end of the specified parent's child +list. The constant MXML_NO_PARENT can be used to specify that the new +element node has no parent.
+Create a new integer node.
+
+mxml_node_t *mxmlNewInteger (
+ mxml_node_t *parent,
+ int integer
+);
New node
+The new integer node is added to the end of the specified parent's child +list. The constant MXML_NO_PARENT can be used to specify that the new +integer node has no parent.
+Create a new opaque string.
+
+mxml_node_t *mxmlNewOpaque (
+ mxml_node_t *parent,
+ const char *opaque
+);
New node
+The new opaque node is added to the end of the specified parent's child +list. The constant MXML_NO_PARENT can be used to specify that the new +opaque node has no parent. The opaque string must be nul-terminated and +is copied into the new node.
+Create a new real number node.
+
+mxml_node_t *mxmlNewReal (
+ mxml_node_t *parent,
+ double real
+);
New node
+The new real number node is added to the end of the specified parent's +child list. The constant MXML_NO_PARENT can be used to specify that +the new real number node has no parent.
+Create a new text fragment node.
+
+mxml_node_t *mxmlNewText (
+ mxml_node_t *parent,
+ int whitespace,
+ const char *string
+);
New node
+The new text node is added to the end of the specified parent's child +list. The constant MXML_NO_PARENT can be used to specify that the new +text node has no parent. The whitespace parameter is used to specify +whether leading whitespace is present before the node. The text +string must be nul-terminated and is copied into the new node.
+Create a new formatted text fragment node.
+
+mxml_node_t *mxmlNewTextf (
+ mxml_node_t *parent,
+ int whitespace,
+ const char *format,
+ ...
+);
New node
+The new text node is added to the end of the specified parent's child +list. The constant MXML_NO_PARENT can be used to specify that the new +text node has no parent. The whitespace parameter is used to specify +whether leading whitespace is present before the node. The format +string must be nul-terminated and is formatted into the new node.
+Create a new XML document tree.
+
+mxml_node_t *mxmlNewXML (
+ const char *version
+);
New ?xml node
+The "version" argument specifies the version number to put in the +?xml element node. If NULL, version 1.0 is assumed. + +
+Release a node.
+
+int mxmlRelease (
+ mxml_node_t *node
+);
New reference count
+When the reference count reaches zero, the node (and any children) +is deleted via mxmlDelete(). + +
+Remove a node from its parent.
+
+void mxmlRemove (
+ mxml_node_t *node
+);
Does not free memory used by the node - use mxmlDelete() for that. +This function does nothing if the node has no parent.
+Retain a node.
+
+int mxmlRetain (
+ mxml_node_t *node
+);
New reference count
+Load a file descriptor into an XML node tree +using a SAX callback.
+
+mxml_node_t *mxmlSAXLoadFd (
+ mxml_node_t *top,
+ int fd,
+ mxml_load_cb_t cb,
+ mxml_sax_cb_t sax_cb,
+ void *sax_data
+);
First node or NULL if the file could not be read.
+The nodes in the specified file are added to the specified top node.
+If no top node is provided, the XML file MUST be well-formed with a
+single parent node like <?xml> for the entire file. The callback
+function returns the value type that should be used for child nodes.
+If MXML_NO_CALLBACK is specified then all child nodes will be either
+MXML_ELEMENT or MXML_TEXT nodes.
+
+The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,
+MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loading
+child nodes of the specified type.
+
+The SAX callback must call mxmlRetain() for any nodes that need to
+be kept for later use. Otherwise, nodes are deleted when the parent
+node is closed or after each data, comment, CDATA, or directive node.
+
+
Load a file into an XML node tree +using a SAX callback.
+
+mxml_node_t *mxmlSAXLoadFile (
+ mxml_node_t *top,
+ FILE *fp,
+ mxml_load_cb_t cb,
+ mxml_sax_cb_t sax_cb,
+ void *sax_data
+);
First node or NULL if the file could not be read.
+The nodes in the specified file are added to the specified top node.
+If no top node is provided, the XML file MUST be well-formed with a
+single parent node like <?xml> for the entire file. The callback
+function returns the value type that should be used for child nodes.
+If MXML_NO_CALLBACK is specified then all child nodes will be either
+MXML_ELEMENT or MXML_TEXT nodes.
+
+The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,
+MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loading
+child nodes of the specified type.
+
+The SAX callback must call mxmlRetain() for any nodes that need to
+be kept for later use. Otherwise, nodes are deleted when the parent
+node is closed or after each data, comment, CDATA, or directive node.
+
+
Load a string into an XML node tree +using a SAX callback.
+
+mxml_node_t *mxmlSAXLoadString (
+ mxml_node_t *top,
+ const char *s,
+ mxml_load_cb_t cb,
+ mxml_sax_cb_t sax_cb,
+ void *sax_data
+);
First node or NULL if the string has errors.
+The nodes in the specified string are added to the specified top node.
+If no top node is provided, the XML string MUST be well-formed with a
+single parent node like <?xml> for the entire string. The callback
+function returns the value type that should be used for child nodes.
+If MXML_NO_CALLBACK is specified then all child nodes will be either
+MXML_ELEMENT or MXML_TEXT nodes.
+
+The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,
+MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loading
+child nodes of the specified type.
+
+The SAX callback must call mxmlRetain() for any nodes that need to
+be kept for later use. Otherwise, nodes are deleted when the parent
+node is closed or after each data, comment, CDATA, or directive node.
+
+
Save an XML node tree to an allocated string.
+
+char *mxmlSaveAllocString (
+ mxml_node_t *node,
+ mxml_save_cb_t cb
+);
Allocated string or NULL
+This function returns a pointer to a string containing the textual
+representation of the XML node tree. The string should be freed
+using the free() function when you are done with it. NULL is returned
+if the node would produce an empty string or if the string cannot be
+allocated.
+
+The callback argument specifies a function that returns a whitespace
+string or NULL before and after each element. If MXML_NO_CALLBACK
+is specified, whitespace will only be added before MXML_TEXT nodes
+with leading whitespace and before attribute names inside opening
+element tags.
Save an XML tree to a file descriptor.
+
+int mxmlSaveFd (
+ mxml_node_t *node,
+ int fd,
+ mxml_save_cb_t cb
+);
0 on success, -1 on error.
+The callback argument specifies a function that returns a whitespace +string or NULL before and after each element. If MXML_NO_CALLBACK +is specified, whitespace will only be added before MXML_TEXT nodes +with leading whitespace and before attribute names inside opening +element tags.
+Save an XML tree to a file.
+
+int mxmlSaveFile (
+ mxml_node_t *node,
+ FILE *fp,
+ mxml_save_cb_t cb
+);
0 on success, -1 on error.
+The callback argument specifies a function that returns a whitespace +string or NULL before and after each element. If MXML_NO_CALLBACK +is specified, whitespace will only be added before MXML_TEXT nodes +with leading whitespace and before attribute names inside opening +element tags.
+Save an XML node tree to a string.
+
+int mxmlSaveString (
+ mxml_node_t *node,
+ char *buffer,
+ int bufsize,
+ mxml_save_cb_t cb
+);
Size of string
+This function returns the total number of bytes that would be
+required for the string but only copies (bufsize - 1) characters
+into the specified buffer.
+
+The callback argument specifies a function that returns a whitespace
+string or NULL before and after each element. If MXML_NO_CALLBACK
+is specified, whitespace will only be added before MXML_TEXT nodes
+with leading whitespace and before attribute names inside opening
+element tags.
Set the element name of a CDATA node.
+
+int mxmlSetCDATA (
+ mxml_node_t *node,
+ const char *data
+);
0 on success, -1 on failure
+The node is not changed if it is not a CDATA element node. + +
+Set the data and destructor of a custom data node.
+
+int mxmlSetCustom (
+ mxml_node_t *node,
+ void *data,
+ mxml_custom_destroy_cb_t destroy
+);
0 on success, -1 on failure
+The node is not changed if it is not a custom node. + +
+Set the handling functions for custom data.
+
+void mxmlSetCustomHandlers (
+ mxml_custom_load_cb_t load,
+ mxml_custom_save_cb_t save
+);
The load function accepts a node pointer and a data string and must
+return 0 on success and non-zero on error.
+
+The save function accepts a node pointer and must return a malloc'd
+string on success and NULL on error.
Set the name of an element node.
+
+int mxmlSetElement (
+ mxml_node_t *node,
+ const char *name
+);
0 on success, -1 on failure
+The node is not changed if it is not an element node.
+Set the error message callback.
+
+void mxmlSetErrorCallback (
+ mxml_error_cb_t cb
+);
Set the value of an integer node.
+
+int mxmlSetInteger (
+ mxml_node_t *node,
+ int integer
+);
0 on success, -1 on failure
+The node is not changed if it is not an integer node.
+Set the value of an opaque node.
+
+int mxmlSetOpaque (
+ mxml_node_t *node,
+ const char *opaque
+);
0 on success, -1 on failure
+The node is not changed if it is not an opaque node.
+Set the value of a real number node.
+
+int mxmlSetReal (
+ mxml_node_t *node,
+ double real
+);
0 on success, -1 on failure
+The node is not changed if it is not a real number node.
+Set the value of a text node.
+
+int mxmlSetText (
+ mxml_node_t *node,
+ int whitespace,
+ const char *string
+);
0 on success, -1 on failure
+The node is not changed if it is not a text node.
+Set the value of a text node to a formatted string.
+
+int mxmlSetTextf (
+ mxml_node_t *node,
+ int whitespace,
+ const char *format,
+ ...
+);
0 on success, -1 on failure
+The node is not changed if it is not a text node.
+Set the the wrap margin when saving XML data.
+
+void mxmlSetWrapMargin (
+ int column
+);
Wrapping is disabled when "column" is 0. + +
+Walk to the next logical node in the tree.
+
+mxml_node_t *mxmlWalkNext (
+ mxml_node_t *node,
+ mxml_node_t *top,
+ int descend
+);
Next node or NULL
+The descend argument controls whether the first child is considered +to be the next node. The top node argument constrains the walk to +the node's children.
+Walk to the previous logical node in the tree.
+
+mxml_node_t *mxmlWalkPrev (
+ mxml_node_t *node,
+ mxml_node_t *top,
+ int descend
+);
Previous node or NULL
+The descend argument controls whether the previous node's last child +is considered to be the previous node. The top node argument constrains +the walk to the node's children.
+An XML element attribute value.
++typedef struct mxml_attr_s mxml_attr_t; +
+Custom data destructor
++typedef void (*mxml_custom_destroy_cb_t)(void *); +
+Custom data load callback function
++typedef int (*mxml_custom_load_cb_t)(mxml_node_t *, const char *); +
+Custom data save callback function
++typedef char *(*mxml_custom_save_cb_t)(mxml_node_t *); +
+An XML custom value.
++typedef struct mxml_custom_s mxml_custom_t; +
+An XML element value.
++typedef struct mxml_element_s mxml_element_t; +
+Error callback function
++typedef void (*mxml_error_cb_t)(const char *); +
+An XML node index.
++typedef struct mxml_index_s mxml_index_t; +
+Load callback function
++typedef mxml_type_t (*mxml_load_cb_t)(mxml_node_t *); +
+An XML node.
++typedef struct mxml_node_s mxml_node_t; +
+Save callback function
++typedef const char *(*mxml_save_cb_t)(mxml_node_t *, int); +
+SAX callback function
++typedef void (*mxml_sax_cb_t)(mxml_node_t *, mxml_sax_event_t, void *); +
+SAX event type.
++typedef enum mxml_sax_event_e mxml_sax_event_t; +
+An XML text value.
++typedef struct mxml_text_s mxml_text_t; +
+The XML node type.
++typedef enum mxml_type_e mxml_type_t; +
+An XML node value.
++typedef union mxml_value_u mxml_value_t; +
+An XML element attribute value.
+struct mxml_attr_s {
+ char *name;
+ char *value;
+};
An XML custom value.
+struct mxml_custom_s {
+ void *data;
+ mxml_custom_destroy_cb_t destroy;
+};
An XML element value.
+struct mxml_element_s {
+ mxml_attr_t *attrs;
+ char *name;
+ int num_attrs;
+};
An XML node index.
+struct mxml_index_s {
+ int alloc_nodes;
+ char *attr;
+ int cur_node;
+ mxml_node_t **nodes;
+ int num_nodes;
+};
An XML node.
+struct mxml_node_s {
+ struct mxml_node_s *child;
+ struct mxml_node_s *last_child;
+ struct mxml_node_s *next;
+ struct mxml_node_s *parent;
+ struct mxml_node_s *prev;
+ int ref_count;
+ mxml_type_t type;
+ void *user_data;
+ mxml_value_t value;
+};
An XML text value.
+struct mxml_text_s {
+ char *string;
+ int whitespace;
+};
An XML node value.
+union mxml_value_u {
+ mxml_custom_t custom;
+ mxml_element_t element;
+ int integer;
+ char *opaque;
+ double real;
+ mxml_text_t text;
+};
SAX event type.
+The XML node type.
+