aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-06-19 09:02:14 +0200
committerMax Kellermann <max@duempel.org>2009-06-25 08:41:23 +0200
commit0cbc4012e85c275c64ad551ba4484ee5f505fe4c (patch)
tree62e18b8fdcfe687614e10f64bbc30a5e676d8cc8 /src
parent8074b826530231755d7c1374eaa94802d7d24156 (diff)
downloadmpd-0cbc4012e85c275c64ad551ba4484ee5f505fe4c.tar.gz
mpd-0cbc4012e85c275c64ad551ba4484ee5f505fe4c.tar.xz
mpd-0cbc4012e85c275c64ad551ba4484ee5f505fe4c.zip
conf: added "used" flag to struct block_param
Diffstat (limited to 'src')
-rw-r--r--src/conf.c5
-rw-r--r--src/conf.h12
2 files changed, 16 insertions, 1 deletions
diff --git a/src/conf.c b/src/conf.c
index 20cf4be8e..ac08d7845 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -139,6 +139,7 @@ config_new_param(const char *value, int line)
ret->num_block_params = 0;
ret->block_params = NULL;
+ ret->used = false;
return ret;
}
@@ -210,6 +211,7 @@ config_add_block_param(struct config_param * param, const char *name,
bp->name = g_strdup(name);
bp->value = g_strdup(value);
bp->line = line;
+ bp->used = false;
}
static struct config_param *
@@ -356,7 +358,7 @@ config_get_next_param(const char *name, const struct config_param * last)
return NULL;
param = node->data;
-
+ param->used = true;
return param;
}
@@ -418,6 +420,7 @@ config_get_block_param(const struct config_param * param, const char *name)
for (unsigned i = 0; i < param->num_block_params; i++) {
if (0 == strcmp(name, param->block_params[i].name)) {
struct block_param *bp = &param->block_params[i];
+ bp->used = true;
return bp;
}
}
diff --git a/src/conf.h b/src/conf.h
index 017a8c310..1b3e074e1 100644
--- a/src/conf.h
+++ b/src/conf.h
@@ -75,6 +75,12 @@ struct block_param {
char *name;
char *value;
int line;
+
+ /**
+ * This flag is false when nobody has queried the value of
+ * this option yet.
+ */
+ bool used;
};
struct config_param {
@@ -83,6 +89,12 @@ struct config_param {
struct block_param *block_params;
unsigned num_block_params;
+
+ /**
+ * This flag is false when nobody has queried the value of
+ * this option yet.
+ */
+ bool used;
};
void config_global_init(void);