Make config_var_is_invisible a function.

This commit is contained in:
Nick Mathewson 2019-08-24 17:32:46 -04:00
parent 65511a45ad
commit eb54fe8f97
3 changed files with 7 additions and 1 deletions

View File

@ -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)

View File

@ -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.

View File

@ -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)