Fri, 31 Jan 2014 19:42:12 +0530
Merged gtkdoc-conversion branch
| 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 | |
|
23659
8251d0f67df5
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23643
diff
changeset
|
29 | #include <glib.h> |
|
34863
dc0c27a2289a
Included glib-object.h in xmlnode.h
Ankit Vani <a@nevitus.org>
parents:
34791
diff
changeset
|
30 | #include <glib-object.h> |
|
23659
8251d0f67df5
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23643
diff
changeset
|
31 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
32 | #define PURPLE_TYPE_XMLNODE (purple_xmlnode_get_type()) |
|
34791
df49377a0778
Added GBoxed wrapping to xmlnode
Ankit Vani <a@nevitus.org>
parents:
33889
diff
changeset
|
33 | |
| 10327 | 34 | /** |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
35 | * The valid types for an PurpleXmlNode |
| 10327 | 36 | */ |
|
32206
a2c62b07ae5a
Please correct me if I'm wrong, but I don't think we gain anything
Mark Doliner <markdoliner@pidgin.im>
parents:
30510
diff
changeset
|
37 | typedef enum |
| 7131 | 38 | { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
39 | PURPLE_XMLNODE_TYPE_TAG, /**< Just a tag */ |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
40 | PURPLE_XMLNODE_TYPE_ATTRIB, /**< Has attributes */ |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
41 | PURPLE_XMLNODE_TYPE_DATA /**< Has data */ |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
42 | } PurpleXmlNodeType; |
| 7131 | 43 | |
| 10327 | 44 | /** |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
45 | * An PurpleXmlNode. |
| 10327 | 46 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
47 | typedef struct _PurpleXmlNode PurpleXmlNode; |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
48 | struct _PurpleXmlNode |
| 7131 | 49 | { |
|
33889
4efe5c21db45
Doc and code formatting (use spaces not tabs to align comments after code and
Mark Doliner <mark@kingant.net>
parents:
32787
diff
changeset
|
50 | char *name; /**< The name of the node. */ |
|
4efe5c21db45
Doc and code formatting (use spaces not tabs to align comments after code and
Mark Doliner <mark@kingant.net>
parents:
32787
diff
changeset
|
51 | char *xmlns; /**< The namespace of the node */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
52 | PurpleXmlNodeType type; /**< The type of the node. */ |
|
33889
4efe5c21db45
Doc and code formatting (use spaces not tabs to align comments after code and
Mark Doliner <mark@kingant.net>
parents:
32787
diff
changeset
|
53 | char *data; /**< The data for the node. */ |
|
4efe5c21db45
Doc and code formatting (use spaces not tabs to align comments after code and
Mark Doliner <mark@kingant.net>
parents:
32787
diff
changeset
|
54 | size_t data_sz; /**< The size of the data. */ |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
55 | PurpleXmlNode *parent; /**< The parent node or %NULL.*/ |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
56 | PurpleXmlNode *child; /**< The child node or %NULL.*/ |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
57 | PurpleXmlNode *lastchild; /**< The last child node or %NULL.*/ |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
58 | PurpleXmlNode *next; /**< The next node or %NULL. */ |
|
21454
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
59 | char *prefix; /**< The namespace prefix if any. */ |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
60 | GHashTable *namespace_map; /**< The namespace map. */ |
| 14386 | 61 | }; |
| 7131 | 62 | |
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32554
diff
changeset
|
63 | G_BEGIN_DECLS |
|
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32554
diff
changeset
|
64 | |
| 10327 | 65 | /** |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
66 | * Returns the GType for the PurpleXmlNode boxed structure. |
|
34791
df49377a0778
Added GBoxed wrapping to xmlnode
Ankit Vani <a@nevitus.org>
parents:
33889
diff
changeset
|
67 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
68 | GType purple_xmlnode_get_type(void); |
|
34791
df49377a0778
Added GBoxed wrapping to xmlnode
Ankit Vani <a@nevitus.org>
parents:
33889
diff
changeset
|
69 | |
|
df49377a0778
Added GBoxed wrapping to xmlnode
Ankit Vani <a@nevitus.org>
parents:
33889
diff
changeset
|
70 | /** |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
71 | * Creates a new PurpleXmlNode. |
| 10327 | 72 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
73 | * @name: The name of the node. |
| 10327 | 74 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
75 | * Returns: The new node. |
| 10327 | 76 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
77 | PurpleXmlNode *purple_xmlnode_new(const char *name); |
| 10327 | 78 | |
| 79 | /** | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
80 | * Creates a new PurpleXmlNode child. |
| 10327 | 81 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
82 | * @parent: The parent node. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
83 | * @name: The name of the child node. |
| 10327 | 84 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
85 | * Returns: The new child node. |
| 10327 | 86 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
87 | PurpleXmlNode *purple_xmlnode_new_child(PurpleXmlNode *parent, const char *name); |
| 10327 | 88 | |
| 89 | /** | |
| 90 | * Inserts a node into a node as a child. | |
| 91 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
92 | * @parent: The parent node to insert child into. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
93 | * @child: The child node to insert into parent. |
| 10327 | 94 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
95 | void purple_xmlnode_insert_child(PurpleXmlNode *parent, PurpleXmlNode *child); |
| 10327 | 96 | |
| 97 | /** | |
| 98 | * Gets a child node named name. | |
| 99 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
100 | * @parent: The parent node. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
101 | * @name: The child's name. |
| 10327 | 102 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
103 | * Returns: The child or NULL. |
| 10327 | 104 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
105 | PurpleXmlNode *purple_xmlnode_get_child(const PurpleXmlNode *parent, const char *name); |
| 10327 | 106 | |
| 107 | /** | |
| 108 | * Gets a child node named name in a namespace. | |
| 109 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
110 | * @parent: The parent node. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
111 | * @name: The child's name. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
112 | * @xmlns: The namespace. |
| 10327 | 113 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
114 | * Returns: The child or NULL. |
| 10327 | 115 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
116 | PurpleXmlNode *purple_xmlnode_get_child_with_namespace(const PurpleXmlNode *parent, const char *name, const char *xmlns); |
| 10327 | 117 | |
| 118 | /** | |
| 119 | * Gets the next node with the same name as node. | |
| 120 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
121 | * @node: The node of a twin to find. |
| 10327 | 122 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
123 | * Returns: The twin of node or NULL. |
| 10327 | 124 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
125 | PurpleXmlNode *purple_xmlnode_get_next_twin(PurpleXmlNode *node); |
| 10327 | 126 | |
| 127 | /** | |
| 128 | * Inserts data into a node. | |
| 129 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
130 | * @node: The node to insert data into. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
131 | * @data: The data to insert. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
132 | * @size: The size of the data to insert. If data is |
|
10415
faceb835eb87
[gaim-migrate @ 11665]
Mark Doliner <markdoliner@pidgin.im>
parents:
10337
diff
changeset
|
133 | * null-terminated you can pass in -1. |
| 10327 | 134 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
135 | void purple_xmlnode_insert_data(PurpleXmlNode *node, const char *data, gssize size); |
| 10327 | 136 | |
| 137 | /** | |
|
18131
7127441da3ba
add xmlnode_get_data_unescaped(), and got rid of an unecessary realloc
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
138 | * Gets (escaped) data from a node. |
| 10327 | 139 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
140 | * @node: The node to get data from. |
| 10327 | 141 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
142 | * Returns: 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
|
143 | * 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
|
144 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
145 | char *purple_xmlnode_get_data(const PurpleXmlNode *node); |
|
18131
7127441da3ba
add xmlnode_get_data_unescaped(), and got rid of an unecessary realloc
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
146 | |
|
7127441da3ba
add xmlnode_get_data_unescaped(), and got rid of an unecessary realloc
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
147 | /** |
|
7127441da3ba
add xmlnode_get_data_unescaped(), and got rid of an unecessary realloc
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
148 | * 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
|
149 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
150 | * @node: The node to get data from. |
|
18131
7127441da3ba
add xmlnode_get_data_unescaped(), and got rid of an unecessary realloc
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
151 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
152 | * Returns: 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
|
153 | * this string when finished using it. |
| 10327 | 154 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
155 | char *purple_xmlnode_get_data_unescaped(const PurpleXmlNode *node); |
| 10327 | 156 | |
| 157 | /** | |
| 158 | * Sets an attribute for a node. | |
| 159 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
160 | * @node: The node to set an attribute for. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
161 | * @attr: The name of the attribute. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
162 | * @value: The value of the attribute. |
| 10327 | 163 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
164 | void purple_xmlnode_set_attrib(PurpleXmlNode *node, const char *attr, const char *value); |
| 10327 | 165 | |
|
26393
7420fd99903a
Add xmlnode_set_attrib_full that enables you to set an attribute with both
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25911
diff
changeset
|
166 | /** |
|
7420fd99903a
Add xmlnode_set_attrib_full that enables you to set an attribute with both
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25911
diff
changeset
|
167 | * Sets a namespaced attribute for a node |
|
7420fd99903a
Add xmlnode_set_attrib_full that enables you to set an attribute with both
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25911
diff
changeset
|
168 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
169 | * @node: The node to set an attribute for. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
170 | * @attr: The name of the attribute to set |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
171 | * @xmlns: The namespace of the attribute to set |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
172 | * @prefix: The prefix of the attribute to set |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
173 | * @value: The value of the attribute |
|
26393
7420fd99903a
Add xmlnode_set_attrib_full that enables you to set an attribute with both
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25911
diff
changeset
|
174 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
175 | void purple_xmlnode_set_attrib_full(PurpleXmlNode *node, const char *attr, const char *xmlns, |
|
33889
4efe5c21db45
Doc and code formatting (use spaces not tabs to align comments after code and
Mark Doliner <mark@kingant.net>
parents:
32787
diff
changeset
|
176 | const char *prefix, const char *value); |
| 15265 | 177 | |
| 178 | /** | |
| 10327 | 179 | * Gets an attribute from a node. |
| 180 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
181 | * @node: The node to get an attribute from. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
182 | * @attr: The attribute to get. |
| 10327 | 183 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
184 | * Returns: The value of the attribute. |
| 10327 | 185 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
186 | const char *purple_xmlnode_get_attrib(const PurpleXmlNode *node, const char *attr); |
| 10327 | 187 | |
| 188 | /** | |
| 15265 | 189 | * Gets a namespaced attribute from a node |
| 190 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
191 | * @node: The node to get an attribute from. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
192 | * @attr: The attribute to get |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
193 | * @xmlns: The namespace of the attribute to get |
| 15265 | 194 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
195 | * Returns: The value of the attribute/ |
| 15265 | 196 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
197 | const char *purple_xmlnode_get_attrib_with_namespace(const PurpleXmlNode *node, const char *attr, const char *xmlns); |
| 15265 | 198 | |
| 199 | /** | |
| 10327 | 200 | * Removes an attribute from a node. |
| 201 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
202 | * @node: The node to remove an attribute from. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
203 | * @attr: The attribute to remove. |
| 10327 | 204 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
205 | void purple_xmlnode_remove_attrib(PurpleXmlNode *node, const char *attr); |
| 10327 | 206 | |
| 207 | /** | |
| 15265 | 208 | * Removes a namespaced attribute from a node |
| 209 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
210 | * @node: The node to remove an attribute from |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
211 | * @attr: The attribute to remove |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
212 | * @xmlns: The namespace of the attribute to remove |
| 15265 | 213 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
214 | void purple_xmlnode_remove_attrib_with_namespace(PurpleXmlNode *node, const char *attr, const char *xmlns); |
| 15265 | 215 | |
| 216 | /** | |
| 13808 | 217 | * Sets the namespace of a node |
| 218 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
219 | * @node: The node to qualify |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
220 | * @xmlns: The namespace of the node |
| 13808 | 221 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
222 | void purple_xmlnode_set_namespace(PurpleXmlNode *node, const char *xmlns); |
| 13808 | 223 | |
| 224 | /** | |
| 225 | * Returns the namespace of a node | |
| 226 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
227 | * @node: The node to get the namepsace from |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
228 | * Returns: The namespace of this node |
| 13808 | 229 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
230 | const char *purple_xmlnode_get_namespace(const PurpleXmlNode *node); |
|
32321
ae17a89ef666
xmlnode: Fix some brokeness in xmlnode serialization with prefixed elements.
Paul Aurich <darkrain42@pidgin.im>
parents:
32313
diff
changeset
|
231 | |
|
ae17a89ef666
xmlnode: Fix some brokeness in xmlnode serialization with prefixed elements.
Paul Aurich <darkrain42@pidgin.im>
parents:
32313
diff
changeset
|
232 | /** |
|
ae17a89ef666
xmlnode: Fix some brokeness in xmlnode serialization with prefixed elements.
Paul Aurich <darkrain42@pidgin.im>
parents:
32313
diff
changeset
|
233 | * Returns the current default namespace. The default |
|
ae17a89ef666
xmlnode: Fix some brokeness in xmlnode serialization with prefixed elements.
Paul Aurich <darkrain42@pidgin.im>
parents:
32313
diff
changeset
|
234 | * namespace is the current namespace which applies to child |
|
ae17a89ef666
xmlnode: Fix some brokeness in xmlnode serialization with prefixed elements.
Paul Aurich <darkrain42@pidgin.im>
parents:
32313
diff
changeset
|
235 | * elements which are unprefixed and which do not contain their |
|
ae17a89ef666
xmlnode: Fix some brokeness in xmlnode serialization with prefixed elements.
Paul Aurich <darkrain42@pidgin.im>
parents:
32313
diff
changeset
|
236 | * own namespace. |
|
ae17a89ef666
xmlnode: Fix some brokeness in xmlnode serialization with prefixed elements.
Paul Aurich <darkrain42@pidgin.im>
parents:
32313
diff
changeset
|
237 | * |
|
ae17a89ef666
xmlnode: Fix some brokeness in xmlnode serialization with prefixed elements.
Paul Aurich <darkrain42@pidgin.im>
parents:
32313
diff
changeset
|
238 | * For example, given: |
|
32554
0d844fac6679
Fix a bunch of tiny problems generating our doxygen documentation
Mark Doliner <markdoliner@pidgin.im>
parents:
32322
diff
changeset
|
239 | * \verbatim |
|
32321
ae17a89ef666
xmlnode: Fix some brokeness in xmlnode serialization with prefixed elements.
Paul Aurich <darkrain42@pidgin.im>
parents:
32313
diff
changeset
|
240 | * <iq type='get' xmlns='jabber:client' xmlns:ns1='http://example.org/ns1'> |
|
ae17a89ef666
xmlnode: Fix some brokeness in xmlnode serialization with prefixed elements.
Paul Aurich <darkrain42@pidgin.im>
parents:
32313
diff
changeset
|
241 | * <ns1:element><child1/></ns1:element> |
|
ae17a89ef666
xmlnode: Fix some brokeness in xmlnode serialization with prefixed elements.
Paul Aurich <darkrain42@pidgin.im>
parents:
32313
diff
changeset
|
242 | * </iq> |
|
32554
0d844fac6679
Fix a bunch of tiny problems generating our doxygen documentation
Mark Doliner <markdoliner@pidgin.im>
parents:
32322
diff
changeset
|
243 | * \endverbatim |
|
32321
ae17a89ef666
xmlnode: Fix some brokeness in xmlnode serialization with prefixed elements.
Paul Aurich <darkrain42@pidgin.im>
parents:
32313
diff
changeset
|
244 | * |
|
ae17a89ef666
xmlnode: Fix some brokeness in xmlnode serialization with prefixed elements.
Paul Aurich <darkrain42@pidgin.im>
parents:
32313
diff
changeset
|
245 | * The default namespace of all nodes (including 'child1') is "jabber:client", |
|
ae17a89ef666
xmlnode: Fix some brokeness in xmlnode serialization with prefixed elements.
Paul Aurich <darkrain42@pidgin.im>
parents:
32313
diff
changeset
|
246 | * though the namespace for 'element' is "http://example.org/ns1". |
|
ae17a89ef666
xmlnode: Fix some brokeness in xmlnode serialization with prefixed elements.
Paul Aurich <darkrain42@pidgin.im>
parents:
32313
diff
changeset
|
247 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
248 | * @node: The node for which to return the default namespace |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
249 | * Returns: The default namespace of this node |
|
32321
ae17a89ef666
xmlnode: Fix some brokeness in xmlnode serialization with prefixed elements.
Paul Aurich <darkrain42@pidgin.im>
parents:
32313
diff
changeset
|
250 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
251 | const char *purple_xmlnode_get_default_namespace(const PurpleXmlNode *node); |
| 13808 | 252 | |
| 253 | /** | |
|
32322
5c1dd6d9d57f
xmlnode: Add xmlnode_strip_prefixes
Paul Aurich <darkrain42@pidgin.im>
parents:
32321
diff
changeset
|
254 | * Returns the defined namespace for a prefix. |
|
5c1dd6d9d57f
xmlnode: Add xmlnode_strip_prefixes
Paul Aurich <darkrain42@pidgin.im>
parents:
32321
diff
changeset
|
255 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
256 | * @node: The node from which to start the search. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
257 | * @prefix: The prefix for which to return the associated namespace. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
258 | * Returns: The namespace for this prefix. |
|
32322
5c1dd6d9d57f
xmlnode: Add xmlnode_strip_prefixes
Paul Aurich <darkrain42@pidgin.im>
parents:
32321
diff
changeset
|
259 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
260 | const char *purple_xmlnode_get_prefix_namespace(const PurpleXmlNode *node, const char *prefix); |
|
32322
5c1dd6d9d57f
xmlnode: Add xmlnode_strip_prefixes
Paul Aurich <darkrain42@pidgin.im>
parents:
32321
diff
changeset
|
261 | |
|
5c1dd6d9d57f
xmlnode: Add xmlnode_strip_prefixes
Paul Aurich <darkrain42@pidgin.im>
parents:
32321
diff
changeset
|
262 | /** |
|
21454
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
263 | * Sets the prefix of a node |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
264 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
265 | * @node: The node to qualify |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
266 | * @prefix: The prefix of the node |
|
21454
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
267 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
268 | void purple_xmlnode_set_prefix(PurpleXmlNode *node, const char *prefix); |
|
21454
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
269 | |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
270 | /** |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
271 | * Returns the prefix of a node |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
272 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
273 | * @node: The node to get the prefix from |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
274 | * Returns: The prefix of this node |
|
21454
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
275 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
276 | const char *purple_xmlnode_get_prefix(const PurpleXmlNode *node); |
|
21454
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
277 | |
|
2ca06ee152ac
make our xmlnode preserve prefixes
Ka-Hing Cheung <khc@pidgin.im>
parents:
20603
diff
changeset
|
278 | /** |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
279 | * Remove all element prefixes from an PurpleXmlNode tree. The prefix's |
|
32322
5c1dd6d9d57f
xmlnode: Add xmlnode_strip_prefixes
Paul Aurich <darkrain42@pidgin.im>
parents:
32321
diff
changeset
|
280 | * namespace is transformed into the default namespace for an element. |
|
5c1dd6d9d57f
xmlnode: Add xmlnode_strip_prefixes
Paul Aurich <darkrain42@pidgin.im>
parents:
32321
diff
changeset
|
281 | * |
|
5c1dd6d9d57f
xmlnode: Add xmlnode_strip_prefixes
Paul Aurich <darkrain42@pidgin.im>
parents:
32321
diff
changeset
|
282 | * Note that this will not necessarily remove all prefixes in use |
|
5c1dd6d9d57f
xmlnode: Add xmlnode_strip_prefixes
Paul Aurich <darkrain42@pidgin.im>
parents:
32321
diff
changeset
|
283 | * (prefixed attributes may still exist), and that this usage may |
|
5c1dd6d9d57f
xmlnode: Add xmlnode_strip_prefixes
Paul Aurich <darkrain42@pidgin.im>
parents:
32321
diff
changeset
|
284 | * break some applications (SOAP / XPath apparently often rely on |
|
5c1dd6d9d57f
xmlnode: Add xmlnode_strip_prefixes
Paul Aurich <darkrain42@pidgin.im>
parents:
32321
diff
changeset
|
285 | * the prefixes having the same name. |
|
5c1dd6d9d57f
xmlnode: Add xmlnode_strip_prefixes
Paul Aurich <darkrain42@pidgin.im>
parents:
32321
diff
changeset
|
286 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
287 | * @node: The node from which to strip prefixes |
|
32322
5c1dd6d9d57f
xmlnode: Add xmlnode_strip_prefixes
Paul Aurich <darkrain42@pidgin.im>
parents:
32321
diff
changeset
|
288 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
289 | void purple_xmlnode_strip_prefixes(PurpleXmlNode *node); |
|
32322
5c1dd6d9d57f
xmlnode: Add xmlnode_strip_prefixes
Paul Aurich <darkrain42@pidgin.im>
parents:
32321
diff
changeset
|
290 | |
|
5c1dd6d9d57f
xmlnode: Add xmlnode_strip_prefixes
Paul Aurich <darkrain42@pidgin.im>
parents:
32321
diff
changeset
|
291 | /** |
|
23750
57baab09bf45
Added xmlnode_get_parent.
Michael Ruprecht <maiku@pidgin.im>
parents:
21552
diff
changeset
|
292 | * Gets the parent node. |
|
57baab09bf45
Added xmlnode_get_parent.
Michael Ruprecht <maiku@pidgin.im>
parents:
21552
diff
changeset
|
293 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
294 | * @child: The child node. |
|
23750
57baab09bf45
Added xmlnode_get_parent.
Michael Ruprecht <maiku@pidgin.im>
parents:
21552
diff
changeset
|
295 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
296 | * Returns: The parent or NULL. |
|
23750
57baab09bf45
Added xmlnode_get_parent.
Michael Ruprecht <maiku@pidgin.im>
parents:
21552
diff
changeset
|
297 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
298 | PurpleXmlNode *purple_xmlnode_get_parent(const PurpleXmlNode *child); |
|
23750
57baab09bf45
Added xmlnode_get_parent.
Michael Ruprecht <maiku@pidgin.im>
parents:
21552
diff
changeset
|
299 | |
|
57baab09bf45
Added xmlnode_get_parent.
Michael Ruprecht <maiku@pidgin.im>
parents:
21552
diff
changeset
|
300 | /** |
| 10327 | 301 | * Returns the node in a string of xml. |
| 302 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
303 | * @node: The starting node to output. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
304 | * @len: Address for the size of the string. |
| 10327 | 305 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
306 | * Returns: The node represented as a string. You must |
|
10415
faceb835eb87
[gaim-migrate @ 11665]
Mark Doliner <markdoliner@pidgin.im>
parents:
10337
diff
changeset
|
307 | * g_free this string when finished using it. |
| 10327 | 308 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
309 | char *purple_xmlnode_to_str(const PurpleXmlNode *node, int *len); |
| 10327 | 310 | |
| 311 | /** | |
| 312 | * Returns the node in a string of human readable xml. | |
| 313 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
314 | * @node: The starting node to output. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
315 | * @len: Address for the size of the string. |
| 10327 | 316 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
317 | * Returns: The node as human readable string including |
|
10415
faceb835eb87
[gaim-migrate @ 11665]
Mark Doliner <markdoliner@pidgin.im>
parents:
10337
diff
changeset
|
318 | * tab and new line characters. You must |
|
faceb835eb87
[gaim-migrate @ 11665]
Mark Doliner <markdoliner@pidgin.im>
parents:
10337
diff
changeset
|
319 | * g_free this string when finished using it. |
| 10327 | 320 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
321 | char *purple_xmlnode_to_formatted_str(const PurpleXmlNode *node, int *len); |
| 10327 | 322 | |
| 323 | /** | |
|
10337
778231f38df6
[gaim-migrate @ 11545]
Mark Doliner <markdoliner@pidgin.im>
parents:
10327
diff
changeset
|
324 | * 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
|
325 | * root node of an XML document will parse the entire document |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
326 | * into a tree of nodes, and return the PurpleXmlNode of the root. |
| 10327 | 327 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
328 | * @str: The string of xml. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
329 | * @size: The size of the string, or -1 if @a str is |
|
11707
a2c8dd795e3b
[gaim-migrate @ 13998]
Richard Laager <rlaager@pidgin.im>
parents:
10848
diff
changeset
|
330 | * NUL-terminated. |
| 10327 | 331 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
332 | * Returns: The new node. |
| 10327 | 333 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
334 | PurpleXmlNode *purple_xmlnode_from_str(const char *str, gssize size); |
| 10327 | 335 | |
| 336 | /** | |
| 337 | * Creates a new node from the source node. | |
| 338 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
339 | * @src: The node to copy. |
| 10327 | 340 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
341 | * Returns: A new copy of the src node. |
| 10327 | 342 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
343 | PurpleXmlNode *purple_xmlnode_copy(const PurpleXmlNode *src); |
| 7131 | 344 | |
| 10327 | 345 | /** |
|
17775
1df27cab581c
implemented user mood, still missing the front end interface
Andreas Monitzer <am@adiumx.com>
parents:
15884
diff
changeset
|
346 | * Frees a node and all of its children. |
| 10327 | 347 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
348 | * @node: The node to free. |
| 10327 | 349 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
350 | void purple_xmlnode_free(PurpleXmlNode *node); |
| 7131 | 351 | |
|
23643
4a68ddefa857
added a more generic function to read xml files (and made the util version into a wrapper) so it can be used by the
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
21552
diff
changeset
|
352 | /** |
|
4a68ddefa857
added a more generic function to read xml files (and made the util version into a wrapper) so it can be used by the
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
21552
diff
changeset
|
353 | * Creates a node from a XML File. Calling this on the |
|
4a68ddefa857
added a more generic function to read xml files (and made the util version into a wrapper) so it can be used by the
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
21552
diff
changeset
|
354 | * root node of an XML document will parse the entire document |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
355 | * into a tree of nodes, and return the PurpleXmlNode of the root. |
|
23643
4a68ddefa857
added a more generic function to read xml files (and made the util version into a wrapper) so it can be used by the
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
21552
diff
changeset
|
356 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
357 | * @dir: The directory where the file is located |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
358 | * @filename: The filename |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
359 | * @description: A description of the file being parsed. Displayed to |
|
33889
4efe5c21db45
Doc and code formatting (use spaces not tabs to align comments after code and
Mark Doliner <mark@kingant.net>
parents:
32787
diff
changeset
|
360 | * the user if the file cannot be read. |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
361 | * @process: The subsystem that is calling purple_xmlnode_from_file. Used as |
|
33889
4efe5c21db45
Doc and code formatting (use spaces not tabs to align comments after code and
Mark Doliner <mark@kingant.net>
parents:
32787
diff
changeset
|
362 | * the category for debugging. |
|
23643
4a68ddefa857
added a more generic function to read xml files (and made the util version into a wrapper) so it can be used by the
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
21552
diff
changeset
|
363 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
34935
diff
changeset
|
364 | * Returns: The new node or NULL if an error occurred. |
|
23643
4a68ddefa857
added a more generic function to read xml files (and made the util version into a wrapper) so it can be used by the
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
21552
diff
changeset
|
365 | */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34863
diff
changeset
|
366 | PurpleXmlNode *purple_xmlnode_from_file(const char *dir, const char *filename, |
|
33889
4efe5c21db45
Doc and code formatting (use spaces not tabs to align comments after code and
Mark Doliner <mark@kingant.net>
parents:
32787
diff
changeset
|
367 | const char *description, const char *process); |
|
23643
4a68ddefa857
added a more generic function to read xml files (and made the util version into a wrapper) so it can be used by the
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
21552
diff
changeset
|
368 | |
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32554
diff
changeset
|
369 | G_END_DECLS |
|
14988
66b34458d49e
[gaim-migrate @ 17698]
Richard Laager <rlaager@pidgin.im>
parents:
14498
diff
changeset
|
370 | |
| 15884 | 371 | #endif /* _PURPLE_XMLNODE_H_ */ |
|
32313
3f58eb41a9a8
Remove deprecated xmlnode functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32206
diff
changeset
|
372 |