2 * @file upnp/upnp_xmlnode.h XML DOM functions
7 * Gaim is the legal property of its developers, whose names are too numerous
8 * to list here. Please refer to the COPYRIGHT file distributed with this
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #ifndef _GGAIM_XMLNODE_H_
26 #define _GGAIM_XMLNODE_H_
37 typedef struct _xmlnode xmlnode;
40 * Gets a child node named name.
42 * @param parent The parent node.
43 * @param name The child's name.
45 * @return The child or NULL.
47 xmlnode *xmlnode_get_child (const xmlnode * parent, const char *name);
50 * Gets the next node with the same name as node.
52 * @param node The node of a twin to find.
54 * @return The twin of node or NULL.
56 xmlnode *xmlnode_get_next_twin (xmlnode * node);
59 * Gets data from a node.
61 * @param node The node to get data from.
63 * @return The data from the node. You must g_free
64 * this string when finished using it.
66 char *xmlnode_get_data (xmlnode * node);
69 * Creates a node from a string of XML. Calling this on the
70 * root node of an XML document will parse the entire document
71 * into a tree of nodes, and return the xmlnode of the root.
73 * @param str The string of xml.
74 * @param size The size of the string, or -1 if @a str is
77 * @return The new node.
79 xmlnode *xmlnode_from_str (const char *str, int size);
82 * Frees a node and all of it's children.
84 * @param node The node to free.
86 void xmlnode_free (xmlnode * node);
92 #endif /* _GAIM_XMLNODE_H_ */