Rewrite chunk queueing.
[paraslash.git] / gui.c
diff --git a/gui.c b/gui.c
index 7588f2b2ec7f7136962c4d5b4b7b086ff1648b17..a2d3e6cd5b63c5d867d793939dbae219196b6bab 100644 (file)
--- a/gui.c
+++ b/gui.c
@@ -1,25 +1,14 @@
 /*
  * Copyright (C) 1998-2007 Andre Noll <maan@systemlinux.org>
  *
- *     This program is free software; you can redistribute it and/or modify
- *     it under the terms of the GNU General Public License as published by
- *     the Free Software Foundation; either version 2 of the License, or
- *     (at your option) any later version.
- *
- *     This program is distributed in the hope that it will be useful,
- *     but WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *     GNU General Public License for more details.
- *
- *     You should have received a copy of the GNU General Public License
- *     along with this program; if not, write to the Free Software
- *     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Licensed under the GPL v2. For licencing details see COPYING.
  */
 
 /** \file gui.c ncurses-based interface for paraslash */
 
 #include "gui.cmdline.h"
 #include "para.h"
+#include "gui.h"
 #include <curses.h>
 #include "ringbuffer.h"
 #include "string.h"
@@ -875,7 +864,7 @@ static int do_select(int mode)
        fd_set rfds;
        int ret;
        int max_fileno, cp_numread = 1;
-       char command_buf[STRINGSIZE] = "";
+       char command_buf[4096] = "";
        int cbo = 0; /* command buf offset */
        struct timeval tv;
 repeat:
@@ -907,7 +896,7 @@ repeat:
        if (command_pipe >= 0 && mode == COMMAND_MODE &&
                        FD_ISSET(command_pipe, &rfds)) {
                cp_numread = read(command_pipe, command_buf + cbo,
-                       STRINGSIZE - 1 - cbo);
+                       sizeof(command_buf) - 1 - cbo);
                if (cp_numread >= 0)
                        cbo += cp_numread;
                else {
@@ -1160,6 +1149,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");
@@ -1167,7 +1162,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, &params);
        PARA_NOTICE_LOG("%s", "config file reloaded");
        if (check_key_map_args() < 0)
                finish(EXIT_FAILURE);
@@ -1342,8 +1337,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, &params);
+       }
        if (check_key_map_args() < 0) {
                fprintf(stderr, "invalid key map in config file\n");
                exit(EXIT_FAILURE);