diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-08-24 17:32:46 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-08-24 17:32:46 -0400 |
commit | eb54fe8f97701a11e30009a94f11b7e3e5d69b4f (patch) | |
tree | 2a5c0527963533db432370c54e56eb2b06846e4c /src/app | |
parent | 65511a45adfeff258e71329b3ff98d5159f09f88 (diff) | |
download | tor-eb54fe8f97701a11e30009a94f11b7e3e5d69b4f.tar.gz tor-eb54fe8f97701a11e30009a94f11b7e3e5d69b4f.zip |
Make config_var_is_invisible a function.
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/config/config.c | 2 | ||||
-rw-r--r-- | src/app/config/confparse.c | 5 | ||||
-rw-r--r-- | src/app/config/confparse.h | 1 |
3 files changed, 7 insertions, 1 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c index f2e8ec8200..740315f3e4 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -8137,7 +8137,7 @@ getinfo_helper_config(control_connection_t *conn, for (i = 0; option_vars_[i].member.name; ++i) { const config_var_t *var = &option_vars_[i]; /* don't tell controller about invisible options */ - if (option_vars_[i].flags & CVFLAG_INVISIBLE) + if (config_var_is_invisible(var)) continue; const char *type = struct_var_get_typename(&var->member); if (!type) diff --git a/src/app/config/confparse.c b/src/app/config/confparse.c index 699fc0e3dd..7127e62cde 100644 --- a/src/app/config/confparse.c +++ b/src/app/config/confparse.c @@ -164,6 +164,11 @@ config_var_is_contained(const config_var_t *var) { return struct_var_is_contained(&var->member); } +bool +config_var_is_invisible(const config_var_t *var) +{ + return (var->flags & CVFLAG_INVISIBLE) != 0; +} /* * Functions to assign config options. diff --git a/src/app/config/confparse.h b/src/app/config/confparse.h index 3633c2a80b..0ae675bcdf 100644 --- a/src/app/config/confparse.h +++ b/src/app/config/confparse.h @@ -107,6 +107,7 @@ void warn_deprecated_option(const char *what, const char *why); bool config_var_is_cumulative(const config_var_t *var); bool config_var_is_settable(const config_var_t *var); bool config_var_is_contained(const config_var_t *var); +bool config_var_is_invisible(const config_var_t *var); /* Helper macros to compare an option across two configuration objects */ #define CFG_EQ_BOOL(a,b,opt) ((a)->opt == (b)->opt) |