afs.c: Introduce client list for afs (fixes dosable bug).
[paraslash.git] / sdl_gui.c
index 08c7943..c63f9b8 100644 (file)
--- a/sdl_gui.c
+++ b/sdl_gui.c
@@ -6,8 +6,11 @@
 
 /** \file sdl_gui.c SDL-based interface for paraslash */
 
+#include <sys/types.h>
+#include <dirent.h>
+
 #include "para.h"
-#include "string.h"
+#include "gui_common.h"
 #include "fd.h"
 
 
@@ -660,17 +663,18 @@ static void do_update(int i)
  * Check if buf is a known status line. If so call do_update and return 1.
  * Return 0 otherwise.
  */
-void update_status(char *buf)
+int update_status(char *buf, __a_unused void *data)
 {
        int i;
 
        i = stat_line_valid(buf);
        if (i < 0)
-               return;
+               return 1;
        //free(stat_items[i].content);
        stat_items[i].content = para_strdup(buf +
                strlen(status_item_list[i]) + 1);
        do_update(i);
+       return 1;
 }
 
 /*
@@ -740,9 +744,16 @@ int main(int argc, char *argv[])
                        args_info.config_file_arg);
                exit(EXIT_FAILURE);
        }
-       if (ret)
-               sdl_gui_cmdline_parser_configfile(args_info.config_file_arg,
-                       &args_info, 0, 0, 0);
+       if (ret) {
+               struct sdl_gui_cmdline_parser_params params = {
+                       .override = 0,
+                       .initialize = 0,
+                       .check_required = 0,
+                       .check_ambiguity = 0
+               };
+               sdl_gui_cmdline_parser_config_file(args_info.config_file_arg,
+                       &args_info, &params);
+       }
        signal(SIGCHLD, SIG_IGN);
        width = args_info.width_arg;
        height = args_info.height_arg;