-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathxml.h
62 lines (40 loc) · 910 Bytes
/
xml.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/**
* @file xml.h
*
*/
#ifndef _XML_H_
#define _XML_H_
/*
* if letter <= 0 then list is an array of matching elements;
* else, it is a compressed trie array
*/
struct trie_node {
int letter;
void* list;
int len;
};
struct xml_element {
char* name;
char* value;
char status;
struct xml_element* father;
struct xml_element* next;
struct xml_element* prev;
struct xml_element* son; // first son
struct xml_attribute* attr; // first attribute
struct trie_node* sons_trie;
struct trie_node* attr_trie;
};
struct xml_attribute {
char* name;
char* value;
char status;
struct xml_element* father;
struct xml_attribute* next;
struct xml_attribute* prev;
};
struct xml_element* load_xml( const char* name );
void free_xml( struct xml_element* elem );
void** xml_get( struct xml_element* element, const char* query );
void free_xml_list( void** list );
#endif /* _XML_H_ */