more processor bummy
This commit is contained in:
parent
b72a3853fc
commit
70f63e4c9e
4 changed files with 18 additions and 0 deletions
|
@ -2,3 +2,8 @@ foo "marius", 23;
|
|||
foo "kyle", 15;
|
||||
foo "soren", 7;
|
||||
bah "blef","bummy";
|
||||
meh {
|
||||
foo "marius", 24;
|
||||
foo "blef", 542;
|
||||
bah "hi";
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ int main()
|
|||
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);
|
||||
|
||||
|
|
|
@ -90,6 +90,8 @@ void cl_proc_add_handler(CLProc *proc, gchar *str,
|
|||
CLProcHandler *handler);
|
||||
void cl_proc_add_handler_func(CLProc *proc, gchar *str,
|
||||
CLProcFunc func);
|
||||
void cl_proc_add_handler_proc(CLProc *proc, gchar *str,
|
||||
CLProc *hproc);
|
||||
void cl_proc_set_default(CLProc *proc, CLProcHandler *pf);
|
||||
void cl_proc_register_keywords(CLProc *proc, ...);
|
||||
void cl_process(GList *tree, CLProc *proc);
|
||||
|
|
|
@ -61,6 +61,16 @@ void cl_proc_add_handler_func(CLProc *proc, gchar *str,
|
|||
cl_proc_add_handler(proc, str, ph);
|
||||
}
|
||||
|
||||
void cl_proc_add_handler_proc(CLProc *proc, gchar *str,
|
||||
CLProc *hproc)
|
||||
{
|
||||
CLProcHandler *ph;
|
||||
|
||||
g_assert(proc != NULL);
|
||||
ph = cl_proc_handler_new_proc(hproc);
|
||||
cl_proc_add_handler(proc, str, ph);
|
||||
}
|
||||
|
||||
void cl_proc_set_default(CLProc *proc, CLProcHandler *ph)
|
||||
{
|
||||
g_assert(proc != NULL);
|
||||
|
|
Loading…
Reference in a new issue