summaryrefslogtreecommitdiff
path: root/src/app/config/confparse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-07-22 16:02:32 -0400
committerNick Mathewson <nickm@torproject.org>2019-07-24 15:21:56 -0400
commit627ab9dba32d590830ff4da908ee8f98f768b5e1 (patch)
treec7598b89148967259eb70f1c7ea5461647d3d4be /src/app/config/confparse.c
parent89a3051365a9a089397e64a18053d80337034ff8 (diff)
downloadtor-627ab9dba32d590830ff4da908ee8f98f768b5e1.tar.gz
tor-627ab9dba32d590830ff4da908ee8f98f768b5e1.zip
Fix every place in config.c that knew about option_vars_.
Iterating over this array was once a good idea, but now that we are going to have a separate structure for each submodule's configuration variables, we should indirect through the config_mgr_t object.
Diffstat (limited to 'src/app/config/confparse.c')
-rw-r--r--src/app/config/confparse.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/app/config/confparse.c b/src/app/config/confparse.c
index 32899a5591..0f0950dd85 100644
--- a/src/app/config/confparse.c
+++ b/src/app/config/confparse.c
@@ -175,6 +175,31 @@ config_mgr_free_(config_mgr_t *mgr)
tor_free(mgr);
}
+/** Return a new smartlist_t containing a config_var_t for every variable that
+ * <b>mgr</b> knows about. The elements of this smartlist do not need
+ * to be freed. */
+smartlist_t *
+config_mgr_list_vars(const config_mgr_t *mgr)
+{
+ smartlist_t *result = smartlist_new();
+ tor_assert(mgr);
+ SMARTLIST_FOREACH(mgr->all_vars, managed_var_t *, mv,
+ smartlist_add(result, (void*) mv->cvar));
+ return result;
+}
+
+/** Return a new smartlist_t containing the names of all deprecated variables.
+ * The elements of this smartlist do not need to be freed. */
+smartlist_t *
+config_mgr_list_deprecated_vars(const config_mgr_t *mgr)
+{
+ smartlist_t *result = smartlist_new();
+ tor_assert(mgr);
+ SMARTLIST_FOREACH(mgr->all_deprecations, config_deprecation_t *, d,
+ smartlist_add(result, &d->name));
+ return result;
+}
+
/** Allocate an empty configuration object of a given format type. */
void *
config_new(const config_mgr_t *mgr)