aboutsummaryrefslogtreecommitdiffstats
path: root/src/conf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/conf.c')
-rw-r--r--src/conf.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/conf.c b/src/conf.c
index cf78bb29c..ab7be10a7 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -94,6 +94,7 @@ static struct config_entry config_entries[] = {
{ .name = CONF_GAPLESS_MP3_PLAYBACK, false, false },
{ .name = CONF_PLAYLIST_PLUGIN, true, true },
{ .name = CONF_AUTO_UPDATE, false, false },
+ { .name = CONF_AUTO_UPDATE_DEPTH, false, false },
{ .name = "filter", true, true },
};
@@ -504,6 +505,23 @@ config_get_path(const char *name)
}
unsigned
+config_get_unsigned(const char *name, unsigned default_value)
+{
+ const struct config_param *param = config_get_param(name);
+ long value;
+ char *endptr;
+
+ if (param == NULL)
+ return default_value;
+
+ value = strtol(param->value, &endptr, 0);
+ if (*endptr != 0 || value < 0)
+ g_error("Not a valid non-negative number in line %i", param->line);
+
+ return (unsigned)value;
+}
+
+unsigned
config_get_positive(const char *name, unsigned default_value)
{
const struct config_param *param = config_get_param(name);