-rw-r--r-- | core/pim/today/minidom.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/core/pim/today/minidom.h b/core/pim/today/minidom.h new file mode 100644 index 0000000..caa4d4a --- a/dev/null +++ b/core/pim/today/minidom.h | |||
@@ -0,0 +1,57 @@ | |||
1 | /* | ||
2 | * The GGZ Gaming Zone Metaserver Project | ||
3 | * Copyright (C) 2001 Josef Spillner, dr_maux@users.sourceforge.net | ||
4 | * Published under GNU GPL conditions. | ||
5 | */ | ||
6 | |||
7 | #ifndef MINIDOM_H | ||
8 | #define MINIDOM_H | ||
9 | |||
10 | #ifdef __cplusplus | ||
11 | extern "C" { | ||
12 | #endif | ||
13 | |||
14 | struct att_t | ||
15 | { | ||
16 | char *name; /* name of the attribute */ | ||
17 | char *value; /* value of the attribute */ | ||
18 | }; | ||
19 | |||
20 | struct ele_t | ||
21 | { | ||
22 | struct ele_t *parent;/* pointer to the parent */ | ||
23 | struct ele_t **el; /* list of child elements */ | ||
24 | struct att_t **at; /* list of attributes */ | ||
25 | char *name; /* tag identifier */ | ||
26 | char *value; /* value inside the tag*/ | ||
27 | int elnum; /* number of child elements [redundant] */ | ||
28 | int atnum; /* number of attribute pairs [redundant] */ | ||
29 | }; | ||
30 | |||
31 | struct dom_t | ||
32 | { | ||
33 | struct ele_t *el; /* the root node (may be NULL) */ | ||
34 | int valid; /* validity of the DOM */ | ||
35 | int processed; /* indicates whether you can work with it */ | ||
36 | }; | ||
37 | |||
38 | typedef struct dom_t DOM;/* Domain Object Model */ | ||
39 | typedef struct ele_t ELE;/* Elements */ | ||
40 | typedef struct att_t ATT;/* Attributes */ | ||
41 | |||
42 | DOM *minidom_load(const char *file); | ||
43 | DOM *minidom_parse(const char *stream); | ||
44 | void minidom_dump(DOM *dom); | ||
45 | void minidom_free(DOM *dom); | ||
46 | |||
47 | ELE *MD_query(ELE *parent, const char *name); | ||
48 | ELE **MD_querylist(ELE *parent, const char *name); | ||
49 | |||
50 | char *MD_att(ELE *element, const char *name); | ||
51 | |||
52 | #ifdef __cplusplus | ||
53 | } | ||
54 | #endif | ||
55 | |||
56 | #endif | ||
57 | |||