3 void cl_tree_free(GList *tree)
9 for (; tree; tree = tree->next) {
10 tmp = (CLNode*)tree->data;
20 cl_tree_free(tmp->u.lb.list);
21 cl_tree_free(tmp->u.lb.block);
31 GList *cl_parse(gchar *file)
33 FILE *fh = fopen(file, "r");
37 ret = cl_parse_fh(fh);
46 void cl_tree_print(GList *tree, int depth)
51 for (; tree; tree = tree->next) {
52 tmp = (CLNode*)tree->data;
60 printf("[ID] '%s'\n", tmp->u.str);
63 printf("[STR] '%s'\n", tmp->u.str);
66 printf("[NUM] %.2f\n", tmp->u.num);
69 printf("[LIST] '%s'\n", tmp->u.lb.id);
70 cl_tree_print(tmp->u.lb.list, depth+2);
73 printf("[BLOCK] '%s'\n", tmp->u.lb.id);
74 cl_tree_print(tmp->u.lb.block, depth+2);
77 printf("[LISTBLOCK] %s\n", tmp->u.lb.id);
78 cl_tree_print(tmp->u.lb.list, depth+2);
80 cl_tree_print(tmp->u.lb.block, depth+2);