aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-06-20 16:07:00 -0400
committerNick Mathewson <nickm@torproject.org>2019-06-25 12:51:25 -0400
commit5b252d31ede521bea53c690693a2ab3d74c8fef4 (patch)
treed94bb5170b846c5732d8defb9be8dae3d9bac012 /src/lib
parentc553750e32d1bf669a3e8308fa44319954a627ca (diff)
downloadtor-5b252d31ede521bea53c690693a2ab3d74c8fef4.tar.gz
tor-5b252d31ede521bea53c690693a2ab3d74c8fef4.zip
Add a "flags" member to config_var_t
Additionally, adjust the macros so that we can add new members like this more easily.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/conf/confmacros.h2
-rw-r--r--src/lib/conf/conftesting.h4
-rw-r--r--src/lib/conf/conftypes.h3
3 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/conf/confmacros.h b/src/lib/conf/confmacros.h
index 29040e1f55..4242137c5a 100644
--- a/src/lib/conf/confmacros.h
+++ b/src/lib/conf/confmacros.h
@@ -19,7 +19,7 @@
* Used to indicate the end of an array of configuration variables.
**/
#define END_OF_CONFIG_VARS \
- { { .name = NULL }, NULL DUMMY_CONF_TEST_MEMBERS }
+ { .member = { .name = NULL } DUMMY_CONF_TEST_MEMBERS }
/**
* Declare a config_var_t as a member named <b>membername</b> of the structure
diff --git a/src/lib/conf/conftesting.h b/src/lib/conf/conftesting.h
index f4aca442a2..a40c9bc97c 100644
--- a/src/lib/conf/conftesting.h
+++ b/src/lib/conf/conftesting.h
@@ -68,8 +68,8 @@ typedef union {
#define CONF_CHECK_VAR_TYPE(tp, conftype, member) \
{ . conftype = &tp ## _dummy . member }
#define CONF_TEST_MEMBERS(tp, conftype, member) \
- , CONF_CHECK_VAR_TYPE(tp, conftype, member)
-#define DUMMY_CONF_TEST_MEMBERS , { .INT=NULL }
+ , .var_ptr_dummy=CONF_CHECK_VAR_TYPE(tp, conftype, member)
+#define DUMMY_CONF_TEST_MEMBERS , .var_ptr_dummy={ .INT=NULL }
#define DUMMY_TYPECHECK_INSTANCE(tp) \
static tp tp ## _dummy
diff --git a/src/lib/conf/conftypes.h b/src/lib/conf/conftypes.h
index 72697e8ee4..028a889917 100644
--- a/src/lib/conf/conftypes.h
+++ b/src/lib/conf/conftypes.h
@@ -110,7 +110,8 @@ typedef struct config_var_t {
struct_member_t member; /** A struct member corresponding to this
* variable. */
const char *initvalue; /**< String (or null) describing initial value. */
-
+ uint32_t flags; /**< One or more flags describing special handling for this
+ * variable */
#ifdef TOR_UNIT_TESTS
/** Used for compiler-magic to typecheck the corresponding field in the
* corresponding struct. Only used in unit test mode, at compile-time. */