]> Dogcows Code - chaz/openbox/commitdiff
add obt_parse_tree_from_root and use it, cuz it's nice
authorDana Jansens <danakj@orodu.net>
Fri, 27 Jul 2007 05:40:30 +0000 (01:40 -0400)
committerDana Jansens <danakj@orodu.net>
Sun, 20 Jan 2008 06:36:55 +0000 (01:36 -0500)
obt/parse.c
obt/parse.h
openbox/menu.c
openbox/openbox.c

index 61fe5b821e3a09b02002b0a846925792a12a06aa..741b19e11fc7cdd712af1af9f97683572cf823f6 100644 (file)
@@ -304,6 +304,11 @@ void obt_parse_tree(ObtParseInst *i, xmlNodePtr node)
     }
 }
 
+void obt_parse_tree_from_root(ObtParseInst *i)
+{
+    obt_parse_tree(i, i->root->children);
+}
+
 gchar *obt_parse_node_string(xmlNodePtr node)
 {
     xmlChar *c = xmlNodeGetContent(node);
index 3a541a0d136d351b572974fca6b14516add3c437..cba7c495555decc2fb44d6e320e8bf58a9f6918c 100644 (file)
@@ -61,6 +61,7 @@ void obt_parse_close(ObtParseInst *inst);
 void obt_parse_register(ObtParseInst *inst, const gchar *tag,
                         ObtParseCallback func, gpointer data);
 void obt_parse_tree(ObtParseInst *i, xmlNodePtr node);
+void obt_parse_tree_from_root(ObtParseInst *i);
 
 
 /* helpers */
index 97af104e17dba688dc36193331585902e1237aac..f6d19d0127fdd1fe01aa9697b938e836964562e3 100644 (file)
@@ -94,8 +94,7 @@ void menu_startup(gboolean reconfig)
                                        "openbox_menu"))
         {
             loaded = TRUE;
-            obt_parse_tree(menu_parse_inst,
-                           obt_parse_instance_root(menu_parse_inst)->children);
+            obt_parse_tree_from_root(menu_parse_inst);
             obt_parse_close(menu_parse_inst);
         } else
             g_message(_("Unable to find a valid menu file '%s'"),
@@ -107,8 +106,7 @@ void menu_startup(gboolean reconfig)
                                        "menu.xml",
                                        "openbox_menu"))
         {
-            obt_parse_tree(menu_parse_inst,
-                           obt_parse_instance_root(menu_parse_inst)->children);
+            obt_parse_tree_from_root(menu_parse_inst);
             obt_parse_close(menu_parse_inst);
         } else
             g_message(_("Unable to find a valid menu file '%s'"),
index 2cab7e27e6b1b91639d7a8891e1bcfb49b1557e8..92d0bbf6334503c85426b37ffe294805f212e4fe 100644 (file)
@@ -230,7 +230,7 @@ gint main(gint argc, gchar **argv)
                 if (obt_parse_load_config_file(i, "openbox", "rc.xml",
                                                "openbox_config"))
                 {
-                    obt_parse_tree(i, obt_parse_instance_root(i)->children);
+                    obt_parse_tree_from_root(i);
                     obt_parse_close(i);
                 } else
                     g_message(_("Unable to find a valid config file, using some simple defaults"));
This page took 0.031003 seconds and 4 git commands to generate.