Sat, 10 Nov 2007 05:16:58 +0000
make our xmlnode preserve prefixes
| 7131 | 1 | /** |
| 2 | * @file xmlnode.h XML DOM functions | |
| 10327 | 3 | * @ingroup core |
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
4 | */ |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
5 | |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
6 | /* purple |
| 7131 | 7 | * |
| 15884 | 8 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 9 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 10 | * source distribution. | |
| 7131 | 11 | * |
| 12 | * This program is free software; you can redistribute it and/or modify | |
| 13 | * it under the terms of the GNU General Public License as published by | |
| 14 | * the Free Software Foundation; either version 2 of the License, or | |
| 15 | * (at your option) any later version. | |
| 16 | * | |
| 17 | * This program is distributed in the hope that it will be useful, | |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 20 | * GNU General Public License for more details. | |
| 21 | * | |
| 22 | * You should have received a copy of the GNU General Public License | |
| 23 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18131
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 7131 | 25 | */ |
| 15884 | 26 | #ifndef _PURPLE_XMLNODE_H_ |
| 27 | #define _PURPLE_XMLNODE_H_ | |
| 7131 | 28 | |
|
14988
66b34458d49e
[gaim-migrate @ 17698]
Richard Laager <rlaager@pidgin.im>
parents:
14498
diff
changeset
|
29 | #ifdef __cplusplus |
|
66b34458d49e
[gaim-migrate @ 17698]
Richard Laager <rlaager@pidgin.im>
parents:
14498
diff
changeset
|
30 | extern "C" { |
|
66b34458d49e
[gaim-migrate @ 17698]
Richard Laager <rlaager@pidgin.im>
parents:
14498
diff
changeset
|
31 | #endif |
|
66b34458d49e
[gaim-migrate @ 17698]
Richard Laager <rlaager@pidgin.im>
parents:
14498
diff
changeset
|
32 | |
| 10327 | 33 | /** |
| 34 | * The valid types for an xmlnode | |
| 35 | */ | |
| 8135 | 36 | typedef enum _XMLNodeType |
| 7131 | 37 | { |
| 10327 | 38 | XMLNODE_TYPE_TAG, /**< Just a tag */ |
|
14162
3546040af8e2
[gaim-migrate @ 16730]
Daniel Atallah <datallah@pidgin.im>
parents:
13808
diff
changeset
|
39 | XMLNODE_TYPE_ATTRIB, /**< Has attributes */ |
| 10327 | 40 | XMLNODE_TYPE_DATA /**< Has data */ |
| 8135 | 41 | } XMLNodeType; |
| 7131 | 42 | |
| 10327 | 43 | /** |
| 44 | * An xmlnode. | |
| 45 | */ | |
| 14386 | 46 | typedef struct _xmlnode xmlnode; |
| 47 | struct _xmlnode | |
| 7131 | 48 | { |
|
14162
3546040af8e2
[gaim-migrate @ 16730]
Daniel Atallah <datallah@pidgin.im>
parents:
13808
diff
changeset
|
49 | char *name; /**< The name of the node. */ |
|
15238
e52522b871ee
[gaim-migrate @ 17963]
Mark Doliner <markdoliner@pidgin.im>
parents:
14988
diff
changeset
|
50 | char *xmlns; /**< The namespace of the node */ |
|
14162
3546040af8e2
[gaim-migrate @ 16730]
Daniel Atallah <datallah@pidgin.im>
parents:
13808
diff
changeset
|
51 | XMLNodeType type; /**< The type of the node. */ |
|
3546040af8e2
[gaim-migrate @ 16730]
Daniel Atallah <datallah@pidgin.im>
parents:
13808
diff
changeset
|
52 | char *data; /**< The data for the node. */ |
|
3546040af8e2
[gaim-migrate @ 16730]
Daniel Atallah <datallah@pidgin.im>
parents:
13808
diff
changeset
|
53 | size_t data_sz; /**< The size of the data. */ |
| 10327 | 54 | struct _xmlnode *parent; /**< The parent node or @c NULL.*/ |
| 55 | struct _xmlnode *child; /**< The child node or @c NULL.*/ | |
|
12233
0570720fee6c
[gaim-migrate @ 14535]
Michael Carlson <corfe83@users.sourceforge.net>
parents:
11707
diff
changeset
|
56 | struct _xmlnode *lastchild; /**< The last child node or @c NULL.*/ |
| 10327 | 57 | struct _xmlnode *next; /**< The next node or @c NULL. */ |
|
21454
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
58 | char *prefix; /**< The namespace prefix if any. */ |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
59 | GHashTable *namespace_map; /**< The namespace map. */ |
| 14386 | 60 | }; |
| 7131 | 61 | |
| 10327 | 62 | /** |
| 63 | * Creates a new xmlnode. | |
| 64 | * | |
| 65 | * @param name The name of the node. | |
| 66 | * | |
| 67 | * @return The new node. | |
| 68 | */ | |
| 7131 | 69 | xmlnode *xmlnode_new(const char *name); |
| 10327 | 70 | |
| 71 | /** | |
| 72 | * Creates a new xmlnode child. | |
| 73 | * | |
| 74 | * @param parent The parent node. | |
| 75 | * @param name The name of the child node. | |
| 76 | * | |
| 77 | * @return The new child node. | |
| 78 | */ | |
| 7131 | 79 | xmlnode *xmlnode_new_child(xmlnode *parent, const char *name); |
| 10327 | 80 | |
| 81 | /** | |
| 82 | * Inserts a node into a node as a child. | |
| 83 | * | |
| 84 | * @param parent The parent node to insert child into. | |
| 85 | * @param child The child node to insert into parent. | |
| 86 | */ | |
| 7131 | 87 | void xmlnode_insert_child(xmlnode *parent, xmlnode *child); |
| 10327 | 88 | |
| 89 | /** | |
| 90 | * Gets a child node named name. | |
| 91 | * | |
| 92 | * @param parent The parent node. | |
| 93 | * @param name The child's name. | |
| 94 | * | |
| 95 | * @return The child or NULL. | |
| 96 | */ | |
|
10736
fb529f29c25c
[gaim-migrate @ 12338]
Mark Doliner <markdoliner@pidgin.im>
parents:
10425
diff
changeset
|
97 | xmlnode *xmlnode_get_child(const xmlnode *parent, const char *name); |
| 10327 | 98 | |
| 99 | /** | |
| 100 | * Gets a child node named name in a namespace. | |
| 101 | * | |
| 102 | * @param parent The parent node. | |
| 103 | * @param name The child's name. | |
| 104 | * @param xmlns The namespace. | |
| 105 | * | |
| 106 | * @return The child or NULL. | |
| 107 | */ | |
|
10736
fb529f29c25c
[gaim-migrate @ 12338]
Mark Doliner <markdoliner@pidgin.im>
parents:
10425
diff
changeset
|
108 | xmlnode *xmlnode_get_child_with_namespace(const xmlnode *parent, const char *name, const char *xmlns); |
| 10327 | 109 | |
| 110 | /** | |
| 111 | * Gets the next node with the same name as node. | |
| 112 | * | |
| 113 | * @param node The node of a twin to find. | |
| 114 | * | |
| 115 | * @return The twin of node or NULL. | |
| 116 | */ | |
| 8135 | 117 | xmlnode *xmlnode_get_next_twin(xmlnode *node); |
| 10327 | 118 | |
| 119 | /** | |
| 120 | * Inserts data into a node. | |
| 121 | * | |
|
10415
faceb835eb87
[gaim-migrate @ 11665]
Mark Doliner <markdoliner@pidgin.im>
parents:
10337
diff
changeset
|
122 | * @param node The node to insert data into. |
| 10327 | 123 | * @param data The data to insert. |
|
10415
faceb835eb87
[gaim-migrate @ 11665]
Mark Doliner <markdoliner@pidgin.im>
parents:
10337
diff
changeset
|
124 | * @param size The size of the data to insert. If data is |
|
faceb835eb87
[gaim-migrate @ 11665]
Mark Doliner <markdoliner@pidgin.im>
parents:
10337
diff
changeset
|
125 | * null-terminated you can pass in -1. |
| 10327 | 126 | */ |
| 10848 | 127 | void xmlnode_insert_data(xmlnode *node, const char *data, gssize size); |
| 10327 | 128 | |
| 129 | /** | |
|
18131
7127441da3ba
add xmlnode_get_data_unescaped(), and got rid of an unecessary realloc
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
130 | * Gets (escaped) data from a node. |
| 10327 | 131 | * |
| 132 | * @param node The node to get data from. | |
| 133 | * | |
|
20546
35d778ab0450
Correctly process an additional <Service> with type Profile and name 'Messenger Roaming Identity' sent with the contact list using a recently registered WLM account, that was causing the initial ADL command to be sent malformed, and our presence status not being forwarded to our buddies
Carlos Silva <typ0@pidgin.im>
parents:
18131
diff
changeset
|
134 | * @return The data from the node or NULL. This data is in raw escaped format. |
|
18131
7127441da3ba
add xmlnode_get_data_unescaped(), and got rid of an unecessary realloc
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
135 | * You must g_free this string when finished using it. |
|
7127441da3ba
add xmlnode_get_data_unescaped(), and got rid of an unecessary realloc
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
136 | */ |
|
7127441da3ba
add xmlnode_get_data_unescaped(), and got rid of an unecessary realloc
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
137 | char *xmlnode_get_data(xmlnode *node); |
|
7127441da3ba
add xmlnode_get_data_unescaped(), and got rid of an unecessary realloc
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
138 | |
|
7127441da3ba
add xmlnode_get_data_unescaped(), and got rid of an unecessary realloc
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
139 | /** |
|
7127441da3ba
add xmlnode_get_data_unescaped(), and got rid of an unecessary realloc
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
140 | * Gets unescaped data from a node. |
|
7127441da3ba
add xmlnode_get_data_unescaped(), and got rid of an unecessary realloc
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
141 | * |
|
7127441da3ba
add xmlnode_get_data_unescaped(), and got rid of an unecessary realloc
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
142 | * @param node The node to get data from. |
|
7127441da3ba
add xmlnode_get_data_unescaped(), and got rid of an unecessary realloc
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
143 | * |
|
7127441da3ba
add xmlnode_get_data_unescaped(), and got rid of an unecessary realloc
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
144 | * @return The data from the node, in unescaped form. You must g_free |
|
14162
3546040af8e2
[gaim-migrate @ 16730]
Daniel Atallah <datallah@pidgin.im>
parents:
13808
diff
changeset
|
145 | * this string when finished using it. |
| 10327 | 146 | */ |
|
18131
7127441da3ba
add xmlnode_get_data_unescaped(), and got rid of an unecessary realloc
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
147 | char *xmlnode_get_data_unescaped(xmlnode *node); |
| 10327 | 148 | |
| 149 | /** | |
| 150 | * Sets an attribute for a node. | |
| 151 | * | |
| 152 | * @param node The node to set an attribute for. | |
| 153 | * @param attr The name of the attribute. | |
| 154 | * @param value The value of the attribute. | |
| 155 | */ | |
| 7131 | 156 | void xmlnode_set_attrib(xmlnode *node, const char *attr, const char *value); |
| 10327 | 157 | |
| 158 | /** | |
|
21454
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
159 | * Sets a prefixed attribute for a node |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
160 | * |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
161 | * @param node The node to set an attribute for. |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
162 | * @param attr The name of the attribute to set |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
163 | * @param xmlns The prefix of the attribute to ste |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
164 | * @param value The value of the attribute |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
165 | */ |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
166 | void xmlnode_set_attrib_with_prefix(xmlnode *node, const char *attr, const char *prefix, const char *value); |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
167 | |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
168 | /** |
| 15265 | 169 | * Sets a namespaced attribute for a node |
| 170 | * | |
| 171 | * @param node The node to set an attribute for. | |
| 172 | * @param attr The name of the attribute to set | |
| 173 | * @param xmlns The namespace of the attribute to ste | |
| 174 | * @param value The value of the attribute | |
| 175 | */ | |
| 176 | void xmlnode_set_attrib_with_namespace(xmlnode *node, const char *attr, const char *xmlns, const char *value); | |
| 177 | ||
| 178 | /** | |
| 10327 | 179 | * Gets an attribute from a node. |
| 180 | * | |
| 181 | * @param node The node to get an attribute from. | |
| 182 | * @param attr The attribute to get. | |
| 183 | * | |
| 184 | * @return The value of the attribute. | |
| 185 | */ | |
| 7131 | 186 | const char *xmlnode_get_attrib(xmlnode *node, const char *attr); |
| 10327 | 187 | |
| 188 | /** | |
| 15265 | 189 | * Gets a namespaced attribute from a node |
| 190 | * | |
| 191 | * @param node The node to get an attribute from. | |
| 192 | * @param attr The attribute to get | |
| 193 | * @param xmlns The namespace of the attribute to get | |
| 194 | * | |
| 195 | * @return The value of the attribute/ | |
| 196 | */ | |
| 197 | const char *xmlnode_get_attrib_with_namespace(xmlnode *node, const char *attr, const char *xmlns); | |
| 198 | ||
| 199 | /** | |
| 10327 | 200 | * Removes an attribute from a node. |
| 201 | * | |
| 202 | * @param node The node to remove an attribute from. | |
| 203 | * @param attr The attribute to remove. | |
| 204 | */ | |
| 7131 | 205 | void xmlnode_remove_attrib(xmlnode *node, const char *attr); |
| 10327 | 206 | |
| 207 | /** | |
| 15265 | 208 | * Removes a namespaced attribute from a node |
| 209 | * | |
| 210 | * @param node The node to remove an attribute from | |
| 211 | * @param attr The attribute to remove | |
| 212 | * @param xmlns The namespace of the attribute to remove | |
| 213 | */ | |
| 214 | void xmlnode_remove_attrib_with_namespace(xmlnode *node, const char *attr, const char *xmlns); | |
| 215 | ||
| 216 | /** | |
| 13808 | 217 | * Sets the namespace of a node |
| 218 | * | |
| 219 | * @param node The node to qualify | |
| 220 | * @param xmlns The namespace of the node | |
| 221 | */ | |
| 222 | void xmlnode_set_namespace(xmlnode *node, const char *xmlns); | |
| 223 | ||
| 224 | /** | |
| 225 | * Returns the namespace of a node | |
| 226 | * | |
| 227 | * @param node The node to get the namepsace from | |
| 228 | * @return The namespace of this node | |
| 229 | */ | |
| 230 | const char *xmlnode_get_namespace(xmlnode *node); | |
| 231 | ||
| 232 | /** | |
|
21454
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
233 | * Sets the prefix of a node |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
234 | * |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
235 | * @param node The node to qualify |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
236 | * @param xmlns The prefix of the node |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
237 | */ |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
238 | void xmlnode_set_prefix(xmlnode *node, const char *prefix); |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
239 | |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
240 | /** |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
241 | * Returns the prefix of a node |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
242 | * |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
243 | * @param node The node to get the prefix from |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
244 | * @return The prefix of this node |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
245 | */ |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
246 | const char *xmlnode_get_prefix(xmlnode *node); |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
247 | |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
248 | /** |
| 10327 | 249 | * Returns the node in a string of xml. |
| 250 | * | |
| 251 | * @param node The starting node to output. | |
| 252 | * @param len Address for the size of the string. | |
| 253 | * | |
|
12887
4235bbee17b1
[gaim-migrate @ 15240]
Daniel Atallah <datallah@pidgin.im>
parents:
12233
diff
changeset
|
254 | * @return The node represented as a string. You must |
|
10415
faceb835eb87
[gaim-migrate @ 11665]
Mark Doliner <markdoliner@pidgin.im>
parents:
10337
diff
changeset
|
255 | * g_free this string when finished using it. |
| 10327 | 256 | */ |
|
10425
d82cef15da95
[gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents:
10424
diff
changeset
|
257 | char *xmlnode_to_str(xmlnode *node, int *len); |
| 10327 | 258 | |
| 259 | /** | |
| 260 | * Returns the node in a string of human readable xml. | |
| 261 | * | |
| 262 | * @param node The starting node to output. | |
| 263 | * @param len Address for the size of the string. | |
| 264 | * | |
| 265 | * @return The node as human readable string including | |
|
10415
faceb835eb87
[gaim-migrate @ 11665]
Mark Doliner <markdoliner@pidgin.im>
parents:
10337
diff
changeset
|
266 | * tab and new line characters. You must |
|
faceb835eb87
[gaim-migrate @ 11665]
Mark Doliner <markdoliner@pidgin.im>
parents:
10337
diff
changeset
|
267 | * g_free this string when finished using it. |
| 10327 | 268 | */ |
|
10425
d82cef15da95
[gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents:
10424
diff
changeset
|
269 | char *xmlnode_to_formatted_str(xmlnode *node, int *len); |
| 10327 | 270 | |
| 271 | /** | |
|
10337
778231f38df6
[gaim-migrate @ 11545]
Mark Doliner <markdoliner@pidgin.im>
parents:
10327
diff
changeset
|
272 | * Creates a node from a string of XML. Calling this on the |
|
778231f38df6
[gaim-migrate @ 11545]
Mark Doliner <markdoliner@pidgin.im>
parents:
10327
diff
changeset
|
273 | * root node of an XML document will parse the entire document |
|
778231f38df6
[gaim-migrate @ 11545]
Mark Doliner <markdoliner@pidgin.im>
parents:
10327
diff
changeset
|
274 | * into a tree of nodes, and return the xmlnode of the root. |
| 10327 | 275 | * |
| 276 | * @param str The string of xml. | |
|
11707
a2c8dd795e3b
[gaim-migrate @ 13998]
Richard Laager <rlaager@pidgin.im>
parents:
10848
diff
changeset
|
277 | * @param size The size of the string, or -1 if @a str is |
|
a2c8dd795e3b
[gaim-migrate @ 13998]
Richard Laager <rlaager@pidgin.im>
parents:
10848
diff
changeset
|
278 | * NUL-terminated. |
| 10327 | 279 | * |
| 280 | * @return The new node. | |
| 281 | */ | |
| 10848 | 282 | xmlnode *xmlnode_from_str(const char *str, gssize size); |
| 10327 | 283 | |
| 284 | /** | |
| 285 | * Creates a new node from the source node. | |
| 286 | * | |
| 287 | * @param src The node to copy. | |
| 288 | * | |
| 289 | * @return A new copy of the src node. | |
| 290 | */ | |
|
15609
e432251bd57e
sf patch #1647731, from Markus Elfring
Mark Doliner <markdoliner@pidgin.im>
parents:
15435
diff
changeset
|
291 | xmlnode *xmlnode_copy(const xmlnode *src); |
| 7131 | 292 | |
| 10327 | 293 | /** |
|
17775
1df27cab581c
implemented user mood, still missing the front end interface
Andreas Monitzer <am@adiumx.com>
parents:
15884
diff
changeset
|
294 | * Frees a node and all of its children. |
| 10327 | 295 | * |
| 296 | * @param node The node to free. | |
| 297 | */ | |
| 7131 | 298 | void xmlnode_free(xmlnode *node); |
| 299 | ||
|
14988
66b34458d49e
[gaim-migrate @ 17698]
Richard Laager <rlaager@pidgin.im>
parents:
14498
diff
changeset
|
300 | #ifdef __cplusplus |
|
66b34458d49e
[gaim-migrate @ 17698]
Richard Laager <rlaager@pidgin.im>
parents:
14498
diff
changeset
|
301 | } |
|
66b34458d49e
[gaim-migrate @ 17698]
Richard Laager <rlaager@pidgin.im>
parents:
14498
diff
changeset
|
302 | #endif |
|
66b34458d49e
[gaim-migrate @ 17698]
Richard Laager <rlaager@pidgin.im>
parents:
14498
diff
changeset
|
303 | |
| 15884 | 304 | #endif /* _PURPLE_XMLNODE_H_ */ |