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 e20e887..31b98b5 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) {
        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);
                }
                        fprintf(stderr, "parse error in config file\n");
                        exit(EXIT_FAILURE);
                }
index 35c835e..c7b17b6 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) {
        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);
                }
                        PARA_EMERG_LOG("%s", "parse error in config file\n");
                        exit(EXIT_FAILURE);
                }
index 88cbf51..1b53f70 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;
        }
                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);
        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 a380518..d9834a2 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);
        }
                        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.",
        ret = open_mixer();
        if (ret < 0) {
                PARA_EMERG_LOG("can not open mixer device %s.",
index 1ca4164..842e030 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)) {
                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)
                        return -E_FILTER_SYNTAX;
        }
        if (!conf.list_filters_given)
diff --git a/gui.c b/gui.c
index 8c0da59..a2d3e6c 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();
 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");
 
        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);
        }
        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);
        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);
        }
                        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);
        if (check_key_map_args() < 0) {
                fprintf(stderr, "invalid key map in config file\n");
                exit(EXIT_FAILURE);
index 08c7943..6aa7854 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);
        }
                        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;
        signal(SIGCHLD, SIG_IGN);
        width = args_info.width_arg;
        height = args_info.height_arg;
index dada53e..b4397c8 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;
        }
        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 */
                conf.daemon_given = tmp;
        }
        /* logfile */