]> Dogcows Code - chaz/openbox/blob - parser/parse.h
save the new glist!
[chaz/openbox] / parser / parse.h
1 #ifndef __parse_h
2 #define __parse_h
3
4 #include <libxml/parser.h>
5 #include <glib.h>
6
7 typedef struct _ObParseInst ObParseInst;
8
9 typedef void (*ParseCallback)(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
10 gpointer data);
11
12 ObParseInst* parse_startup();
13 void parse_shutdown(ObParseInst *inst);
14
15 /* Loads Openbox's rc, from $HOME or $PREFIX as a fallback */
16 gboolean parse_load_rc(xmlDocPtr *doc, xmlNodePtr *root);
17
18 void parse_register(ObParseInst *inst, const char *tag,
19 ParseCallback func, gpointer data);
20 void parse_tree(ObParseInst *inst, xmlDocPtr doc, xmlNodePtr node);
21
22
23 /* open/close */
24
25 gboolean parse_load(const char *path, const char *rootname,
26 xmlDocPtr *doc, xmlNodePtr *root);
27 gboolean parse_load_mem(gpointer data, guint len, const char *rootname,
28 xmlDocPtr *doc, xmlNodePtr *root);
29 void parse_close(xmlDocPtr doc);
30
31
32 /* helpers */
33
34 xmlNodePtr parse_find_node(const char *tag, xmlNodePtr node);
35
36 char *parse_string(xmlDocPtr doc, xmlNodePtr node);
37 int parse_int(xmlDocPtr doc, xmlNodePtr node);
38 gboolean parse_bool(xmlDocPtr doc, xmlNodePtr node);
39
40 gboolean parse_contains(const char *val, xmlDocPtr doc, xmlNodePtr node);
41 gboolean parse_attr_contains(const char *val, xmlNodePtr node,
42 const char *name);
43
44 gboolean parse_attr_string(const char *name, xmlNodePtr node, char **value);
45 gboolean parse_attr_int(const char *name, xmlNodePtr node, int *value);
46
47 #endif
This page took 0.03481 seconds and 4 git commands to generate.