7131
|
1 /**
|
|
2 * @file xmlnode.h XML DOM functions
|
|
3 *
|
|
4 * gaim
|
|
5 *
|
8046
|
6 * Gaim is the legal property of its developers, whose names are too numerous
|
|
7 * to list here. Please refer to the COPYRIGHT file distributed with this
|
|
8 * source distribution.
|
7131
|
9 *
|
|
10 * This program is free software; you can redistribute it and/or modify
|
|
11 * it under the terms of the GNU General Public License as published by
|
|
12 * the Free Software Foundation; either version 2 of the License, or
|
|
13 * (at your option) any later version.
|
|
14 *
|
|
15 * This program is distributed in the hope that it will be useful,
|
|
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
18 * GNU General Public License for more details.
|
|
19 *
|
|
20 * You should have received a copy of the GNU General Public License
|
|
21 * along with this program; if not, write to the Free Software
|
|
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
23 */
|
|
24 #ifndef _GAIM_XMLNODE_H_
|
|
25 #define _GAIM_XMLNODE_H_
|
|
26
|
8135
|
27 typedef enum _XMLNodeType
|
7131
|
28 {
|
8135
|
29 XMLNODE_TYPE_TAG,
|
|
30 XMLNODE_TYPE_ATTRIB,
|
|
31 XMLNODE_TYPE_DATA
|
|
32 } XMLNodeType;
|
7131
|
33
|
|
34 typedef struct _xmlnode
|
|
35 {
|
|
36 char *name;
|
8135
|
37 XMLNodeType type;
|
7131
|
38 char *data;
|
|
39 size_t data_sz;
|
|
40 struct _xmlnode *parent;
|
|
41 struct _xmlnode *child;
|
|
42 struct _xmlnode *next;
|
|
43 } xmlnode;
|
|
44
|
|
45 xmlnode *xmlnode_new(const char *name);
|
|
46 xmlnode *xmlnode_new_child(xmlnode *parent, const char *name);
|
|
47 void xmlnode_insert_child(xmlnode *parent, xmlnode *child);
|
|
48 xmlnode *xmlnode_get_child(xmlnode *parent, const char *name);
|
8135
|
49 xmlnode *xmlnode_get_next_twin(xmlnode *node);
|
7131
|
50 void xmlnode_insert_data(xmlnode *parent, const char *data, size_t size);
|
|
51 char *xmlnode_get_data(xmlnode *node);
|
|
52 void xmlnode_set_attrib(xmlnode *node, const char *attr, const char *value);
|
|
53 const char *xmlnode_get_attrib(xmlnode *node, const char *attr);
|
|
54 void xmlnode_remove_attrib(xmlnode *node, const char *attr);
|
7642
|
55 char *xmlnode_to_str(xmlnode *node, int *len);
|
7131
|
56 xmlnode *xmlnode_from_str(const char *str, size_t size);
|
|
57
|
|
58 void xmlnode_free(xmlnode *node);
|
|
59
|
|
60 #endif /* _GAIM_XMLNODE_H_ */
|