openbox/parser/parse.h

44 lines
1.2 KiB
C
Raw Normal View History

#ifndef __parse_h
#define __parse_h
2003-05-24 15:35:26 +00:00
#include <libxml/parser.h>
#include <glib.h>
2003-05-24 15:35:26 +00:00
typedef void (*ParseCallback)(xmlDocPtr doc, xmlNodePtr node, void *data);
void parse_startup();
void parse_shutdown();
/* Loads Openbox's rc, from $HOME or $PREFIX as a fallback */
gboolean parse_load_rc(xmlDocPtr *doc, xmlNodePtr *root);
2003-05-24 15:35:26 +00:00
/* callbacks - must call parse_startup to use these */
2003-05-24 15:35:26 +00:00
void parse_register(const char *tag, ParseCallback func, void *data);
2003-05-24 15:35:26 +00:00
void parse_tree(xmlDocPtr doc, xmlNodePtr node, void *nothing);
/* open/close */
gboolean parse_load(const char *path, const char *rootname,
xmlDocPtr *doc, xmlNodePtr *root);
void parse_close(xmlDocPtr doc);
2003-05-24 15:35:26 +00:00
/* helpers */
xmlNodePtr parse_find_node(const char *tag, xmlNodePtr node);
2003-05-24 15:35:26 +00:00
char *parse_string(xmlDocPtr doc, xmlNodePtr node);
int parse_int(xmlDocPtr doc, xmlNodePtr node);
gboolean parse_bool(xmlDocPtr doc, xmlNodePtr node);
2003-05-24 15:35:26 +00:00
gboolean parse_contains(const char *val, xmlDocPtr doc, xmlNodePtr node);
gboolean parse_attr_contains(const char *val, xmlNodePtr node,
const char *name);
2003-05-24 15:35:26 +00:00
gboolean parse_attr_string(const char *name, xmlNodePtr node, char **value);
gboolean parse_attr_int(const char *name, xmlNodePtr node, int *value);
#endif