]> Dogcows Code - chaz/openbox/blobdiff - obcl/main.c
node processing code/macros, and other fixes
[chaz/openbox] / obcl / main.c
index 9ae109a900337361fd9bdcfe8162275f29cb3e6b..a38b4cf67bff0f53fbf09c6633bb31efabb9fbb1 100644 (file)
@@ -1,9 +1,32 @@
 #include "obcl.h"
 
+void process_foo(CLNode *node)
+{
+    if (CL_IS_NODE(node)) {
+        printf("foo name: %s\n"
+               "foo age: %.2f\n",
+               CL_STRVAL(CL_LIST_NTH(node,0)),
+               CL_NUMVAL(CL_LIST_NTH(node,1)));
+    }
+}
+
+void process_bah(CLNode *node)
+{
+    printf("handling bah\n");
+}
+
 int main()
 {
     GList *lst = cl_parse("foo.conf");
-    cl_tree_print(lst,0);
-    cl_tree_free(lst);
+/*     cl_tree_print(lst,0); */
+/*     cl_tree_free(lst); */
+
+    
+    CLProc *p = cl_proc_new();
+    cl_proc_add_handler_func(p, "foo", process_foo);
+    cl_proc_add_handler_func(p, "bah", process_bah);
+
+    cl_process(lst, p);
+
     return 0;
 }
This page took 0.020131 seconds and 4 git commands to generate.