X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=gui.c;h=28291a867fd99aea2f6d4abeb96c7e671abc8fc3;hp=8c0da59e704a4408322b7729a2042a7f8cc0613b;hb=4a262fc2d915538dd5ebaa58fa5ec7403de650cd;hpb=471684761a2039bbc89aa1e3c33c62de6bef86cf diff --git a/gui.c b/gui.c index 8c0da59e..28291a86 100644 --- a/gui.c +++ b/gui.c @@ -11,9 +11,11 @@ #include "gui.h" #include #include "ringbuffer.h" -#include "string.h" +#include "gui_common.h" #include "fd.h" #include "error.h" +#include "list.h" +#include "sched.h" #include "signal.h" /** define the array of error lists needed by para_gui */ @@ -447,11 +449,12 @@ __printf_2_3 static void outputf(int color, const char* fmt,...) wrefresh(bot.win); } -static void add_output_line(char *line) +static int add_output_line(char *line, __a_unused void *data) { if (!curses_active) - return; + return 1; rb_add_entry(COLOR_OUTPUT, para_strdup(line)); + return 1; } void para_log(int ll, const char *fmt,...) @@ -735,7 +738,7 @@ reap_next_child: /* * print status line if line starts with known command. */ -static void check_stat_line(char *line) +static int check_stat_line(char *line, __a_unused void *data) { int i; @@ -747,7 +750,7 @@ static void check_stat_line(char *line) stat_content[i] = para_strdup(line); print_stat_item(i); } - return; + return 1; } /* @@ -922,7 +925,8 @@ check_return: if (cp_numread <= 0 && !cbo) /* command complete */ return 0; if (cbo) - cbo = for_each_line(command_buf, cbo, &add_output_line); + cbo = for_each_line(command_buf, cbo, + &add_output_line, NULL); if (cp_numread <= 0) cbo = 0; wrefresh(bot.win); @@ -1149,6 +1153,12 @@ static void com_ll_incr(void) static void com_reread_conf(void) { char *cf =configfile_exists(); + struct gui_cmdline_parser_params params = { + .override = 1, + .initialize = 1, + .check_required = 0, + .check_ambiguity = 0 + }; if (!cf) { PARA_WARNING_LOG("%s", "there is no configuration to read"); @@ -1156,7 +1166,7 @@ static void com_reread_conf(void) } PARA_INFO_LOG("%s", "rereading command line options and config file"); gui_cmdline_parser(_argc, _argv, &conf); - gui_cmdline_parser_configfile(cf, &conf, 1, 1, 0); + gui_cmdline_parser_config_file(cf, &conf, ¶ms); PARA_NOTICE_LOG("%s", "config file reloaded"); if (check_key_map_args() < 0) finish(EXIT_FAILURE); @@ -1331,8 +1341,15 @@ int main(int argc, char *argv[]) conf.config_file_arg); exit(EXIT_FAILURE); } - if (cf) - gui_cmdline_parser_configfile(cf, &conf, 0, 0, 0); + if (cf) { + struct gui_cmdline_parser_params params = { + .override = 0, + .initialize = 0, + .check_required = 0, + .check_ambiguity = 0 + }; + gui_cmdline_parser_config_file(cf, &conf, ¶ms); + } if (check_key_map_args() < 0) { fprintf(stderr, "invalid key map in config file\n"); exit(EXIT_FAILURE);