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

[tor-commits] [tor/master] Remove all VTFLAG_* usage.



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

    Remove all VTFLAG_* usage.
---
 src/lib/conf/conftypes.h    | 16 ----------------
 src/lib/confmgt/type_defs.c | 19 ++++++++++++++-----
 2 files changed, 14 insertions(+), 21 deletions(-)

diff --git a/src/lib/conf/conftypes.h b/src/lib/conf/conftypes.h
index d5ab4e51c..d8575f364 100644
--- a/src/lib/conf/conftypes.h
+++ b/src/lib/conf/conftypes.h
@@ -171,22 +171,6 @@ typedef struct struct_magic_decl_t {
 
 /* Aliases for old individual options. These will get removed soon. */
 #define CVFLAG_NODUMP     CFLG_NODUMP
-#define VTFLAG_CUMULATIVE CFLG_NOREPLACE
-#define VTFLAG_UNSETTABLE CFLG_NOSET
-
-/**
- * Set of flags to make a variable "derived" -- so that inspecting this
- * variable inspects part of another, and changing this variable changes part
- * of another.
- *
- * Derived variables require special handling in several ways: they do not
- * need to be copied independently when we are copying a config object, since
- * copying the variable they are derived from copies them too.  Similarly,
- * they do not need to be compared independently when listing changes, since
- * comparing the variable that they are derived from compares them too.
- **/
-#define VTFLAG_CONTAINED \
-  (CFLG_NOCOPY | CFLG_NOCMP | CFLG_NODUMP)
 
 /** Set of options to make a flag invisible. */
 #define CVFLAG_INVISIBLE  \
diff --git a/src/lib/confmgt/type_defs.c b/src/lib/confmgt/type_defs.c
index e311319c0..a0431e4f8 100644
--- a/src/lib/confmgt/type_defs.c
+++ b/src/lib/confmgt/type_defs.c
@@ -725,13 +725,22 @@ static const var_type_def_t type_definitions_table[] = {
   [CONFIG_TYPE_CSV_INTERVAL] = { .name="TimeInterval",
                                  .fns=&legacy_csv_interval_fns, },
   [CONFIG_TYPE_LINELIST] = { .name="LineList", .fns=&linelist_fns,
-                             .flags=VTFLAG_CUMULATIVE },
+                             .flags=CFLG_NOREPLACE },
+  /*
+   * A "linelist_s" is a derived view of a linelist_v: inspecting
+   * it gets part of a linelist_v, and setting it adds to the linelist_v.
+   */
   [CONFIG_TYPE_LINELIST_S] = { .name="Dependent", .fns=&linelist_s_fns,
-                               .flags=VTFLAG_CUMULATIVE|VTFLAG_CONTAINED },
+                               .flags=CFLG_NOREPLACE|
+                               /* The operations we disable here are
+                                * handled by the linelist_v. */
+                               CFLG_NOCOPY|CFLG_NOCMP|CFLG_NODUMP },
   [CONFIG_TYPE_LINELIST_V] = { .name="Virtual", .fns=&linelist_v_fns,
-                               .flags=VTFLAG_CUMULATIVE|VTFLAG_UNSETTABLE },
-  [CONFIG_TYPE_OBSOLETE] = { .name="Obsolete", .fns=&ignore_fns,
-                             .flags=VTFLAG_CONTAINED|VTFLAG_UNSETTABLE }
+                               .flags=CFLG_NOREPLACE|CFLG_NOSET },
+  [CONFIG_TYPE_OBSOLETE] = {
+         .name="Obsolete", .fns=&ignore_fns,
+         .flags=CFLG_NOCOPY|CFLG_NOCMP|CFLG_NODUMP|CFLG_NOSET|CFLG_NOLIST
+  }
 };
 
 /**



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