]> Dogcows Code - chaz/openbox/blob - parser/parse.h
make openbox base-dir spec compliant, and change the theme dir structure, so that...
[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 the normal paths */
16 gboolean parse_load_rc(xmlDocPtr *doc, xmlNodePtr *root);
17 /* Loads an Openbox menu, from the normal paths */
18 gboolean parse_load_menu(const gchar *file, xmlDocPtr *doc, xmlNodePtr *root);
19
20 void parse_register(ObParseInst *inst, const char *tag,
21 ParseCallback func, gpointer data);
22 void parse_tree(ObParseInst *inst, xmlDocPtr doc, xmlNodePtr node);
23
24
25 /* open/close */
26
27 gboolean parse_load(const char *path, const char *rootname,
28 xmlDocPtr *doc, xmlNodePtr *root);
29 gboolean parse_load_mem(gpointer data, guint len, const char *rootname,
30 xmlDocPtr *doc, xmlNodePtr *root);
31 void parse_close(xmlDocPtr doc);
32
33
34 /* helpers */
35
36 xmlNodePtr parse_find_node(const char *tag, xmlNodePtr node);
37
38 char *parse_string(xmlDocPtr doc, xmlNodePtr node);
39 int parse_int(xmlDocPtr doc, xmlNodePtr node);
40 gboolean parse_bool(xmlDocPtr doc, xmlNodePtr node);
41
42 gboolean parse_contains(const char *val, xmlDocPtr doc, xmlNodePtr node);
43 gboolean parse_attr_contains(const char *val, xmlNodePtr node,
44 const char *name);
45
46 gboolean parse_attr_string(const char *name, xmlNodePtr node, char **value);
47 gboolean parse_attr_int(const char *name, xmlNodePtr node, int *value);
48
49 /* paths */
50
51 void parse_paths_startup();
52 void parse_paths_shutdown();
53
54 const gchar* parse_xdg_config_home_path();
55 const gchar* parse_xdg_data_home_path();
56 GSList* parse_xdg_config_dir_paths();
57 GSList* parse_xdg_data_dir_paths();
58
59 /*! Expands the ~ character to the home directory throughout the given
60 string */
61 gchar *parse_expand_tilde(const gchar *f);
62 /*! Makes a directory and all its parents */
63 void parse_mkdir_path(const gchar *path, gint mode);
64
65 #endif
This page took 0.0372 seconds and 5 git commands to generate.