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

[tor-commits] [tor/master] config: Invert sense of _is_invisible, and rename to is_listable()



commit 16cf9424c1480aea2443f6995d1056e8f04ba5e3
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Thu Sep 5 11:48:25 2019 -0400

    config: Invert sense of _is_invisible, and rename to is_listable()
---
 src/app/config/config.c    |  2 +-
 src/app/config/confparse.c | 10 ++++++++--
 src/app/config/confparse.h |  2 +-
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/app/config/config.c b/src/app/config/config.c
index 0cbc223d0..9c93198a4 100644
--- a/src/app/config/config.c
+++ b/src/app/config/config.c
@@ -8128,7 +8128,7 @@ getinfo_helper_config(control_connection_t *conn,
     smartlist_t *vars = config_mgr_list_vars(get_options_mgr());
     SMARTLIST_FOREACH_BEGIN(vars, const config_var_t *, var) {
       /* don't tell controller about invisible options */
-      if (config_var_is_invisible(var))
+      if (! config_var_is_listable(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 633fc4f8b..3d3f4e1bb 100644
--- a/src/app/config/confparse.c
+++ b/src/app/config/confparse.c
@@ -534,11 +534,17 @@ config_var_is_contained(const config_var_t *var)
 {
   return struct_var_is_contained(&var->member);
 }
+
+/**
+ * Return true iff variable <b>var</b> should appear on list of variables
+ * given to the controller or the CLI.
+ **/
 bool
-config_var_is_invisible(const config_var_t *var)
+config_var_is_listable(const config_var_t *var)
 {
-  return (var->flags & CVFLAG_INVISIBLE) != 0;
+  return (var->flags & CVFLAG_INVISIBLE) == 0;
 }
+
 bool
 config_var_is_dumpable(const config_var_t *var)
 {
diff --git a/src/app/config/confparse.h b/src/app/config/confparse.h
index 7edbbe3c0..b4c32bf1b 100644
--- a/src/app/config/confparse.h
+++ b/src/app/config/confparse.h
@@ -191,7 +191,7 @@ void warn_deprecated_option(const char *what, const char *why);
 
 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);
+bool config_var_is_listable(const config_var_t *var);
 bool config_var_is_dumpable(const config_var_t *var);
 
 /* Helper macros to compare an option across two configuration objects */



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