gchar *name;
if (!xmlStrcmp(n->name, (const xmlChar*)"name")) {
- name = obt_parse_node_string(n);
+ name = obt_xml_node_string(n);
desktop_names = g_list_append(desktop_names, name);
RrInstance *rrinst;
gchar *obc_config_file = NULL;
ObtPaths *paths;
-ObtParseInst *parse_i;
+ObtXmlInst *parse_i;
static gchar *obc_theme_install = NULL;
static gchar *obc_theme_archive = NULL;
}
paths = obt_paths_new();
- parse_i = obt_parse_instance_new();
+ parse_i = obt_xml_instance_new();
rrinst = RrInstanceNew(GDK_DISPLAY(), gdk_x11_get_default_screen());
if (!obc_config_file) {
}
xmlIndentTreeOutput = 1;
- if (!obt_parse_load_config_file(parse_i,
- "openbox",
- (obc_config_file ?
- obc_config_file : "rc.xml"),
- "openbox_config"))
+ if (!obt_xml_load_config_file(parse_i,
+ "openbox",
+ (obc_config_file ?
+ obc_config_file : "rc.xml"),
+ "openbox_config"))
{
obconf_error(_("Failed to load an rc.xml. You have probably failed to install Openbox properly."), TRUE);
exit_with_error = TRUE;
}
else {
- doc = obt_parse_doc(parse_i);
- root = obt_parse_root(parse_i);
+ doc = obt_xml_doc(parse_i);
+ root = obt_xml_root(parse_i);
}
/* look for parsing errors */
}
RrInstanceFree(rrinst);
- obt_parse_instance_unref(parse_i);
+ obt_xml_instance_unref(parse_i);
obt_paths_unref(paths);
xmlFreeDoc(doc);
#include <obrender/render.h>
#include <obrender/instance.h>
-#include <obt/parse.h>
+#include <obt/xml.h>
#include <obt/paths.h>
#include <gtk/gtk.h>
extern GtkWidget *mainwin;
extern gchar *obc_config_file;
extern ObtPaths *paths;
-extern ObtParseInst *parse_i;
+extern ObtXmlInst *parse_i;
#define get_widget(s) glade_xml_get_widget(glade, s)
#include "main.h"
#include "tree.h"
#include "gettext.h"
-#include <obt/parse.h>
+#include <obt/xml.h>
static gboolean mapping = FALSE;
static xmlNodePtr saved_custom = NULL;
while (n) {
if (!xmlStrcmp(n->name, (const xmlChar*)"action")) {
- if (obt_parse_attr_contains(n, "name", "ToggleMaximizeFull"))
+ if (obt_xml_attr_contains(n, "name", "ToggleMaximizeFull"))
++max;
- else if (obt_parse_attr_contains(n, "name", "ToggleShade"))
+ else if (obt_xml_attr_contains(n, "name", "ToggleShade"))
++shade;
else
++other;
#include "tree.h"
#include "main.h"
-#include <obt/parse.h>
+#include <obt/xml.h>
#include <gdk/gdkx.h>
xmlNodePtr tree_get_node(const gchar *path, const gchar *def)
gchar **nodes;
gchar **it, **next;
- n = obt_parse_root(parse_i);
+ n = obt_xml_root(parse_i);
nodes = g_strsplit(path, "/", 0);
for (it = nodes; *it; it = next) {
next = it + 1;
/* match attributes */
- c = obt_parse_find_node(n->children, attrs[0]);
+ c = obt_xml_find_node(n->children, attrs[0]);
while (c && !ok) {
gint i;
ok = TRUE;
for (i = 1; attrs[i]; ++i) {
gchar **eq = g_strsplit(attrs[i], "=", 2);
- if (eq[1] && !obt_parse_attr_contains(c, eq[0], eq[1]))
+ if (eq[1] && !obt_xml_attr_contains(c, eq[0], eq[1]))
ok = FALSE;
g_strfreev(eq);
}
if (!ok)
- c = obt_parse_find_node(c->next, attrs[0]);
+ c = obt_xml_find_node(c->next, attrs[0]);
}
if (!c) {
obt_paths_mkdir_path(d, 0700);
g_free(d);
- if (!obt_parse_save_file(parse_i, p, TRUE)) {
+ if (!obt_xml_save_file(parse_i, p, TRUE)) {
gchar *s;
s = g_strdup_printf("An error occured while saving the "
"config file '%s'", p);
xmlNodePtr n;
n = tree_get_node(node, def);
- return obt_parse_node_string(n);
+ return obt_xml_node_string(n);
}
gint tree_get_int(const gchar *node, gint def)
d = g_strdup_printf("%d", def);
n = tree_get_node(node, d);
g_free(d);
- return obt_parse_node_int(n);
+ return obt_xml_node_int(n);
}
gboolean tree_get_bool(const gchar *node, gboolean def)
xmlNodePtr n;
n = tree_get_node(node, (def ? "yes" : "no"));
- return obt_parse_node_bool(n);
+ return obt_xml_node_bool(n);
}
#ifndef obconf__tree_h
#define obconf__tree_h
-#include <obt/parse.h>
+#include <obt/xml.h>
xmlNodePtr tree_get_node(const gchar *path, const gchar *def);