diff options
| author | Marius Nita <marius@cs.pdx.edu> | 2003-04-15 00:13:03 +0000 |
|---|---|---|
| committer | Marius Nita <marius@cs.pdx.edu> | 2003-04-15 00:13:03 +0000 |
| commit | 1ab607765c231924f642d27aa3ac3b9294844704 (patch) | |
| tree | 0de67f67b98f368df2bc74e943c75a387a290a87 /obcl/main.c | |
| parent | 37e2ef05d5e0ae2edec6f51a6c52f701fd0ce9fd (diff) | |
node processing code/macros, and other fixes
Diffstat (limited to 'obcl/main.c')
| -rw-r--r-- | obcl/main.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/obcl/main.c b/obcl/main.c index 9ae109a9..a38b4cf6 100644 --- a/obcl/main.c +++ b/obcl/main.c @@ -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; } |
