Mercurial > pidgin
diff libpurple/xmlnode.h @ 26877:ab298d237562
propagate from branch 'im.pidgin.pidgin.2.5.5.veracode' (head 1744a346c5951c97b5d6ec102b49606f3dd918cc)
to branch 'im.pidgin.pidgin' (head f4e1d87650834d9a82d09020df0fb030f25854e0)
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Thu, 14 May 2009 21:16:58 +0000 |
parents | 872d30754311 |
children | 350f097019eb |
line wrap: on
line diff
--- a/libpurple/xmlnode.h Sun May 03 23:18:28 2009 +0000 +++ b/libpurple/xmlnode.h Thu May 14 21:16:58 2009 +0000 @@ -26,6 +26,8 @@ #ifndef _PURPLE_XMLNODE_H_ #define _PURPLE_XMLNODE_H_ +#include <glib.h> + #ifdef __cplusplus extern "C" { #endif @@ -155,6 +157,7 @@ */ void xmlnode_set_attrib(xmlnode *node, const char *attr, const char *value); +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_XMLNODE_C_) /** * Sets a prefixed attribute for a node * @@ -162,6 +165,8 @@ * @param attr The name of the attribute to set * @param prefix The prefix of the attribute to ste * @param value The value of the attribute + * + * @deprecated Use xmlnode_set_attrib_full instead. */ void xmlnode_set_attrib_with_prefix(xmlnode *node, const char *attr, const char *prefix, const char *value); @@ -172,8 +177,25 @@ * @param attr The name of the attribute to set * @param xmlns The namespace of the attribute to ste * @param value The value of the attribute + * + * @deprecated Use xmlnode_set_attrib_full instead. */ void xmlnode_set_attrib_with_namespace(xmlnode *node, const char *attr, const char *xmlns, const char *value); +#endif /* PURPLE_DISABLE_DEPRECATED */ + +/** + * Sets a namespaced attribute for a node + * + * @param node The node to set an attribute for. + * @param attr The name of the attribute to set + * @param xmlns The namespace of the attribute to ste + * @param prefix The prefix of the attribute to ste + * @param value The value of the attribute + * + * @since 2.6.0 + */ +void xmlnode_set_attrib_full(xmlnode *node, const char *attr, const char *xmlns, + const char *prefix, const char *value); /** * Gets an attribute from a node. @@ -246,6 +268,17 @@ const char *xmlnode_get_prefix(const xmlnode *node); /** + * Gets the parent node. + * + * @param child The child node. + * + * @return The parent or NULL. + * + * @since 2.6.0 + */ +xmlnode *xmlnode_get_parent(const xmlnode *child); + +/** * Returns the node in a string of xml. * * @param node The starting node to output. @@ -297,6 +330,25 @@ */ void xmlnode_free(xmlnode *node); +/** + * Creates a node from a XML File. Calling this on the + * root node of an XML document will parse the entire document + * into a tree of nodes, and return the xmlnode of the root. + * + * @param dir The directory where the file is located + * @param filename The filename + * @param description A description of the file being parsed. Displayed to + * the user if the file cannot be read. + * @param process The subsystem that is calling xmlnode_from_file. Used as + * the category for debugging. + * + * @return The new node or NULL if an error occurred. + * + * @since 2.6.0 + */ +xmlnode *xmlnode_from_file(const char *dir, const char *filename, + const char *description, const char *process); + #ifdef __cplusplus } #endif