summaryrefslogtreecommitdiff
path: root/src/app/config/confparse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-06-21 11:20:21 -0400
committerNick Mathewson <nickm@torproject.org>2019-07-24 15:21:56 -0400
commitf8b193a74a3967d23bf55c8dcfb5bb2a16692c97 (patch)
tree0fc3d313039069cd4377e57c39c5a4852b51e606 /src/app/config/confparse.c
parentf306d12b58a9447076b961da072061f65830692c (diff)
downloadtor-f8b193a74a3967d23bf55c8dcfb5bb2a16692c97.tar.gz
tor-f8b193a74a3967d23bf55c8dcfb5bb2a16692c97.zip
Make config_var and config_fmt const.
Now that we have a reasonable implementation for overriding the default options for TestingTorNetwork, we don't need to modify config_var_t structs any more. And therefore, we can have constant format options, like reasonable people.
Diffstat (limited to 'src/app/config/confparse.c')
-rw-r--r--src/app/config/confparse.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/app/config/confparse.c b/src/app/config/confparse.c
index 450ff5e083..9bc0b1dc75 100644
--- a/src/app/config/confparse.c
+++ b/src/app/config/confparse.c
@@ -100,9 +100,13 @@ config_find_deprecation(const config_format_t *fmt, const char *key)
return NULL;
}
-/** As config_find_option, but return a non-const pointer. */
-config_var_t *
-config_find_option_mutable(config_format_t *fmt, const char *key)
+/** If <b>key</b> is a configuration option, return the corresponding const
+ * config_var_t. Otherwise, if <b>key</b> is a non-standard abbreviation,
+ * warn, and return the corresponding const config_var_t. Otherwise return
+ * NULL.
+ */
+const config_var_t *
+config_find_option(const config_format_t *fmt, const char *key)
{
int i;
size_t keylen = strlen(key);
@@ -127,17 +131,6 @@ config_find_option_mutable(config_format_t *fmt, const char *key)
return NULL;
}
-/** If <b>key</b> is a configuration option, return the corresponding const
- * config_var_t. Otherwise, if <b>key</b> is a non-standard abbreviation,
- * warn, and return the corresponding const config_var_t. Otherwise return
- * NULL.
- */
-const config_var_t *
-config_find_option(const config_format_t *fmt, const char *key)
-{
- return config_find_option_mutable((config_format_t*)fmt, key);
-}
-
/** Return the number of option entries in <b>fmt</b>. */
static int
config_count_options(const config_format_t *fmt)