all repos — openbox @ d1ceea89bd811d776050d2f6a04370d30a0932b3

openbox fork - make it a bit more like ryudo

obcl/main.c (raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#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); */

    
    CLProc *p = cl_proc_new();
    cl_proc_add_handler_func(p, "foo", process_foo);
    cl_proc_add_handler_func(p, "bah", process_bah);
    cl_proc_add_handler_proc(p,"meh",p);

    cl_process(lst, p);

    return 0;
}