ConfigOption: rename to ConfigTemplate
This commit is contained in:
parent
c67668d6dd
commit
daa4647712
@ -148,6 +148,7 @@ src_mpd_SOURCES = \
|
|||||||
src/Idle.cxx src/Idle.hxx \
|
src/Idle.cxx src/Idle.hxx \
|
||||||
src/CommandLine.cxx src/CommandLine.hxx \
|
src/CommandLine.cxx src/CommandLine.hxx \
|
||||||
src/ConfigFile.cxx \
|
src/ConfigFile.cxx \
|
||||||
|
src/ConfigTemplates.hxx \
|
||||||
src/CrossFade.cxx src/CrossFade.hxx \
|
src/CrossFade.cxx src/CrossFade.hxx \
|
||||||
src/cue/cue_parser.c src/cue/cue_parser.h \
|
src/cue/cue_parser.c src/cue/cue_parser.h \
|
||||||
src/decoder_error.h \
|
src/decoder_error.h \
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "conf.h"
|
#include "conf.h"
|
||||||
#include "ConfigOptions.hxx"
|
#include "ConfigTemplates.hxx"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
@ -46,7 +46,7 @@ extern "C" {
|
|||||||
|
|
||||||
#define CONF_COMMENT '#'
|
#define CONF_COMMENT '#'
|
||||||
|
|
||||||
static GSList *config_params[G_N_ELEMENTS(config_options)];
|
static GSList *config_params[G_N_ELEMENTS(config_templates)];
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
get_bool(const char *value, bool *value_r)
|
get_bool(const char *value, bool *value_r)
|
||||||
@ -318,7 +318,7 @@ ReadConfigFile(const Path &path, GError **error_r)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ConfigOption &option = config_options[i];
|
const ConfigTemplate &option = config_templates[i];
|
||||||
GSList *¶ms = config_params[i];
|
GSList *¶ms = config_params[i];
|
||||||
|
|
||||||
if (params != NULL && !option.repeatable) {
|
if (params != NULL && !option.repeatable) {
|
||||||
|
@ -23,13 +23,13 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
struct ConfigOption {
|
struct ConfigTemplate {
|
||||||
const char *const name;
|
const char *const name;
|
||||||
const bool repeatable;
|
const bool repeatable;
|
||||||
const bool block;
|
const bool block;
|
||||||
};
|
};
|
||||||
|
|
||||||
static constexpr struct ConfigOption config_options[] = {
|
static constexpr struct ConfigTemplate config_templates[] = {
|
||||||
{ CONF_MUSIC_DIR, false, false },
|
{ CONF_MUSIC_DIR, false, false },
|
||||||
{ CONF_PLAYLIST_DIR, false, false },
|
{ CONF_PLAYLIST_DIR, false, false },
|
||||||
{ CONF_FOLLOW_INSIDE_SYMLINKS, false, false },
|
{ CONF_FOLLOW_INSIDE_SYMLINKS, false, false },
|
||||||
@ -90,8 +90,8 @@ gcc_pure
|
|||||||
static int
|
static int
|
||||||
ConfigFindByName(const char *name)
|
ConfigFindByName(const char *name)
|
||||||
{
|
{
|
||||||
for (unsigned i = 0; i < G_N_ELEMENTS(config_options); ++i)
|
for (unsigned i = 0; i < G_N_ELEMENTS(config_templates); ++i)
|
||||||
if (strcmp(config_options[i].name, name) == 0)
|
if (strcmp(config_templates[i].name, name) == 0)
|
||||||
return i;
|
return i;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
Loading…
Reference in New Issue
Block a user