Break overlong argument lists

This commit is contained in:
Benedikt Heine 2017-09-25 01:44:57 +02:00
parent 554c873808
commit 41defb7c85
2 changed files with 49 additions and 19 deletions

View File

@ -409,8 +409,11 @@ bool cmdline_is_set(const char *key)
return cmdline_get_value(key) != NULL; return cmdline_get_value(key) != NULL;
} }
char *option_get_path(const char *ini_section, const char *ini_key, const char *cmdline_key, char *option_get_path(const char *ini_section,
const char *def, const char *description) const char *ini_key,
const char *cmdline_key,
const char *def,
const char *description)
{ {
char *val = NULL; char *val = NULL;
@ -427,8 +430,11 @@ char *option_get_path(const char *ini_section, const char *ini_key, const char *
} }
char *option_get_string(const char *ini_section, const char *ini_key, const char *cmdline_key, char *option_get_string(const char *ini_section,
const char *def, const char *description) const char *ini_key,
const char *cmdline_key,
const char *def,
const char *description)
{ {
char *val = NULL; char *val = NULL;
@ -445,8 +451,11 @@ char *option_get_string(const char *ini_section, const char *ini_key, const char
} }
int option_get_int(const char *ini_section, const char *ini_key, const char *cmdline_key, int option_get_int(const char *ini_section,
int def, const char *description) const char *ini_key,
const char *cmdline_key,
int def,
const char *description)
{ {
/* *str is only used to check wether the cmdline option is actually set. */ /* *str is only used to check wether the cmdline option is actually set. */
const char *str = cmdline_get_value(cmdline_key); const char *str = cmdline_get_value(cmdline_key);
@ -461,8 +470,11 @@ int option_get_int(const char *ini_section, const char *ini_key, const char *cmd
return val; return val;
} }
double option_get_double(const char *ini_section, const char *ini_key, const char *cmdline_key, double option_get_double(const char *ini_section,
double def, const char *description) const char *ini_key,
const char *cmdline_key,
double def,
const char *description)
{ {
const char *str = cmdline_get_value(cmdline_key); const char *str = cmdline_get_value(cmdline_key);
double val = cmdline_get_double(cmdline_key, def, description); double val = cmdline_get_double(cmdline_key, def, description);
@ -473,8 +485,11 @@ double option_get_double(const char *ini_section, const char *ini_key, const cha
return val; return val;
} }
int option_get_bool(const char *ini_section, const char *ini_key, const char *cmdline_key, int option_get_bool(const char *ini_section,
int def, const char *description) const char *ini_key,
const char *cmdline_key,
int def,
const char *description)
{ {
int val = false; int val = false;

View File

@ -24,16 +24,31 @@ int cmdline_get_bool(const char *key, int def, const char *description);
bool cmdline_is_set(const char *key); bool cmdline_is_set(const char *key);
const char *cmdline_create_usage(void); const char *cmdline_create_usage(void);
char *option_get_string(const char *ini_section, const char *ini_key, const char *cmdline_key, char *option_get_string(const char *ini_section,
const char *def, const char *description); const char *ini_key,
char *option_get_path(const char *ini_section, const char *ini_key, const char *cmdline_key, const char *cmdline_key,
const char *def, const char *description); const char *def,
int option_get_int(const char *ini_section, const char *ini_key, const char *cmdline_key, int def, const char *description);
char *option_get_path(const char *ini_section,
const char *ini_key,
const char *cmdline_key,
const char *def,
const char *description);
int option_get_int(const char *ini_section,
const char *ini_key,
const char *cmdline_key,
int def,
const char *description);
double option_get_double(const char *ini_section,
const char *ini_key,
const char *cmdline_key,
double def,
const char *description);
int option_get_bool(const char *ini_section,
const char *ini_key,
const char *cmdline_key,
int def,
const char *description); const char *description);
double option_get_double(const char *ini_section, const char *ini_key, const char *cmdline_key,
double def, const char *description);
int option_get_bool(const char *ini_section, const char *ini_key, const char *cmdline_key,
int def, const char *description);
/* returns the next known section. /* returns the next known section.
* if section == NULL returns first section. * if section == NULL returns first section.