void db_initialize(MEM_POOL* mem_pool) { struct db_conf* config = config_parser("docserver.conf",mem_pool); g_running_flag = 1; config->row_limit = 10; ASSERT_EQ(MILE_RETURN_SUCCESS,db_init(config)); }
int main(void) { char *cmd; t_node *tree; int exit; global.status = 0; global.env = creat_env(); global.config = config_parser(".42shrc"); global.hist = NULL; global.data = NULL; termcap_init(global.env); stop_signal(); while (!global.status) { tree = NULL; global.prompt = edit_prompt(global.config, global.env); if ((cmd = edit_cmd(&global, global.prompt)) == NULL && !global.status) global.status = !global.status; if (!global.status) if (is_singlestr(' ', cmd) && (tree = parsing_func(cmd, &global))) if ((exit = exec_course_tree(tree, global.env, &global)) == EXIT_CHILD) return (exit); (cmd) ? free(cmd) : (cmd = NULL); (global.prompt) ? free(global.prompt) : (global.prompt = NULL); } return (exit); }
static void init_global(void) { global.echo = 0; global.status = 0; global.env = creat_env(); global.config = config_parser(".mshrc"); global.hist = NULL; global.hist = history_create_list(global.config, &global.hist); global.data = NULL; global.ctrlc = 0; termcap_init(global.env); global.exit = 0; stop_signal(); }