static int dbops_fixup_func(void** param, int init_act) { struct dbops_action **p, *a; char *c; int res; /* check if is it a declare_no that references to declare_xxxx */ c = *param; eat_spaces(c); *param = c; eat_alphanum(c); if (*c == 0) { a = find_action_by_name(*param, -1); if (!a) { ERR(MODULE_NAME": fixup_func: query (%s) not declared\n", (char*) *param); return -1; } *param = (void*) a; return 0; } for (p = &dbops_actions; *p; p=&(*p)->next); /* add at the end of list */ res = parse_ops(*param, p, init_act == 0 /* declare query has name */); if (res < 0) return res; /* pkg_free(*param); do not free it!*/ *param = (void*) *p; if (init_act) return init_action(*p); /* fixup is acquired after init_mod() therefore initialize new action */ else return 0; }
int main(int argc, char ** argv) { chain_options * ops = parse_ops(argc, argv); corpus_root * root = generate_chain(ops); output_chain(root); free_options(ops); free_chain(root); return EXIT_SUCCESS; }
int main(int argc, char **argv) { int i; pacc = pci_alloc(); pacc->error = die; i = parse_options(argc, argv); pci_init(pacc); pci_scan_bus(pacc); parse_ops(argc, argv, i); scan_ops(first_op); execute(first_op); return 0; }