]> git.tue.mpg.de Git - paraslash.git/commitdiff
Don't use depricated xxx_cmdline_parser_configfile().
authorAndre Noll <maan@systemlinux.org>
Mon, 6 Aug 2007 20:38:38 +0000 (22:38 +0200)
committerAndre Noll <maan@systemlinux.org>
Mon, 6 Aug 2007 20:38:38 +0000 (22:38 +0200)
Switch to the equivalent xxx_cmdline_parser_config_file() which takes
a pointer to the parser params.

audioc.c
audiod.c
client_common.c
fade.c
filter.c
gui.c
sdl_gui.c
server.c

index e20e887eda56a79969113a875468ea25696ea3ab..31b98b5c614c89965c6d7b6cf1dc40ecdfdde8ac 100644 (file)
--- a/audioc.c
+++ b/audioc.c
@@ -75,7 +75,13 @@ int main(int argc, char *argv[])
        HANDLE_VERSION_FLAG("audioc", conf);
        cf = configfile_exists();
        if (cf) {
-               if (audioc_cmdline_parser_configfile(cf, &conf, 0, 0, 0)) {
+               struct audioc_cmdline_parser_params params = {
+                       .override = 0,
+                       .initialize = 0,
+                       .check_required = 0,
+                       .check_ambiguity = 0
+               };
+               if (audioc_cmdline_parser_config_file(cf, &conf, &params)) {
                        fprintf(stderr, "parse error in config file\n");
                        exit(EXIT_FAILURE);
                }
index 35c835ecc143fa6c2d73a1c16687f0ed8a8b8f00..c7b17b6f23067e2c8550f45078a64f6a15478f6c 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -1132,7 +1132,14 @@ int main(int argc, char *argv[])
        para_drop_privileges(conf.user_arg, conf.group_arg);
        cf = configfile_exists();
        if (cf) {
-               if (audiod_cmdline_parser_configfile(cf, &conf, 0, 0, 0)) {
+               struct audiod_cmdline_parser_params params = {
+                       .override = 0,
+                       .initialize = 0,
+                       .check_required = 0,
+                       .check_ambiguity = 0
+
+               };
+               if (audiod_cmdline_parser_config_file(cf, &conf, &params)) {
                        PARA_EMERG_LOG("%s", "parse error in config file\n");
                        exit(EXIT_FAILURE);
                }
index 88cbf51ec43757aad074468494f096d62b3c0b59..1b53f705423556040736a4e70dbd8fc7460a38f2 100644 (file)
@@ -153,9 +153,16 @@ int client_open(int argc, char *argv[], struct private_client_data **pcd_ptr)
                ret = -E_NO_CONFIG;
                goto out;
        }
-       if (!ret)
-               client_cmdline_parser_configfile(pcd->config_file,
-                       &pcd->conf, 0, 0, 0);
+       if (!ret) {
+               struct client_cmdline_parser_params params = {
+                       .override = 0,
+                       .initialize = 0,
+                       .check_required = 0,
+                       .check_ambiguity = 0
+               };
+               client_cmdline_parser_config_file(pcd->config_file,
+                       &pcd->conf, &params);
+       }
        ret = 1;
        PARA_INFO_LOG("loglevel: %d\n", pcd->conf.loglevel_arg);
        PARA_INFO_LOG("config_file: %s\n", pcd->config_file);
diff --git a/fade.c b/fade.c
index a3805187fdfbfc07b63fe5fa834f9371abcf7e70..d9834a2b173eeffc2b3bc6744e20065ea2052647 100644 (file)
--- a/fade.c
+++ b/fade.c
@@ -276,9 +276,16 @@ int main(int argc, char *argv[])
                        conf.config_file_arg);
                exit(EXIT_FAILURE);
        }
-       if (ret)
-               fade_cmdline_parser_configfile(conf.config_file_arg,
-                       &conf, 0, 0, 0);
+       if (ret) {
+               struct fade_cmdline_parser_params params = {
+                       .override = 0,
+                       .initialize = 0,
+                       .check_required = 0,
+                       .check_ambiguity = 0
+               };
+               fade_cmdline_parser_config_file(conf.config_file_arg,
+                       &conf, &params);
+       }
        ret = open_mixer();
        if (ret < 0) {
                PARA_EMERG_LOG("can not open mixer device %s.",
index 1ca416484e2f9bf9c9aaad649fd1d72fa9c88309..842e030f3eb58cf13257406154f2aeb17c650826 100644 (file)
--- a/filter.c
+++ b/filter.c
@@ -109,7 +109,13 @@ static int parse_config(int argc, char *argv[])
                free(home);
        }
        if (!stat(cf, &statbuf)) {
-               if (filter_cmdline_parser_configfile(cf, &conf, 0, 0, 0))
+               struct filter_cmdline_parser_params params = {
+                       .override = 0,
+                       .initialize = 0,
+                       .check_required = 0,
+                       .check_ambiguity = 0
+               };
+               if (filter_cmdline_parser_config_file(cf, &conf, &params))
                        return -E_FILTER_SYNTAX;
        }
        if (!conf.list_filters_given)
diff --git a/gui.c b/gui.c
index 8c0da59e704a4408322b7729a2042a7f8cc0613b..a2d3e6cd5b63c5d867d793939dbae219196b6bab 100644 (file)
--- a/gui.c
+++ b/gui.c
@@ -1149,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");
@@ -1156,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);
@@ -1331,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);
index 08c794322da472b19e1df40dece06d9dc68f88a3..6aa78546502f3359930abc4ef02113462a788db3 100644 (file)
--- a/sdl_gui.c
+++ b/sdl_gui.c
@@ -740,9 +740,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;
index dada53e57746f6f77a13eebb9b14ec97f07f7d55..b4397c8ff192f4dfd0f16e4c7a3bd39254d65b6f 100644 (file)
--- a/server.c
+++ b/server.c
@@ -232,7 +232,13 @@ static void parse_config(int override)
        }
        if (!ret) {
                int tmp = conf.daemon_given;
-               server_cmdline_parser_configfile(cf, &conf, override, 0, 0);
+               struct server_cmdline_parser_params params = {
+                       .override = override,
+                       .initialize = 0,
+                       .check_required = 0,
+                       .check_ambiguity = 0
+               };
+               server_cmdline_parser_config_file(cf, &conf, &params);
                conf.daemon_given = tmp;
        }
        /* logfile */