[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Make config_var_is_invisible a function.



commit eb54fe8f97701a11e30009a94f11b7e3e5d69b4f
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Sat Aug 24 17:32:46 2019 -0400

    Make config_var_is_invisible a function.
---
 src/app/config/config.c    | 2 +-
 src/app/config/confparse.c | 5 +++++
 src/app/config/confparse.h | 1 +
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/app/config/config.c b/src/app/config/config.c
index f2e8ec820..740315f3e 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 699fc0e3d..7127e62cd 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 3633c2a80..0ae675bcd 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)



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits