summaryrefslogtreecommitdiff
path: root/src/lib/conf
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-06-20 16:26:05 -0400
committerNick Mathewson <nickm@torproject.org>2019-06-25 12:51:25 -0400
commitb6457d4c08f601c4e42e64aad47ac9c30c36306e (patch)
treee55ee7afd31ae73116e33d132618474012483333 /src/lib/conf
parent5b252d31ede521bea53c690693a2ab3d74c8fef4 (diff)
downloadtor-b6457d4c08f601c4e42e64aad47ac9c30c36306e.tar.gz
tor-b6457d4c08f601c4e42e64aad47ac9c30c36306e.zip
Extend macros to allow flag arguments.
Diffstat (limited to 'src/lib/conf')
-rw-r--r--src/lib/conf/confmacros.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/conf/confmacros.h b/src/lib/conf/confmacros.h
index 4242137c5a..ff284e681d 100644
--- a/src/lib/conf/confmacros.h
+++ b/src/lib/conf/confmacros.h
@@ -30,12 +30,14 @@
* Most modules that use this macro should wrap it in a local macro that
* sets structtype to the local configuration type.
**/
-#define CONFIG_VAR_ETYPE(structtype, varname, vartype, membername, initval) \
+#define CONFIG_VAR_ETYPE(structtype, varname, vartype, membername, \
+ varflags, initval) \
{ .member = \
{ .name = varname, \
.type = CONFIG_TYPE_ ## vartype, \
.offset = offsetof(structtype, membername), \
}, \
+ .flags = varflags, \
.initvalue = initval \
CONF_TEST_MEMBERS(structtype, vartype, membername) \
}
@@ -44,13 +46,15 @@
* As CONFIG_VAR_XTYPE, but declares a value using an extension type whose
* type definition is <b>vartype</b>_type_defn.
**/
-#define CONFIG_VAR_DEFN(structtype, varname, vartype, membername, initval) \
+#define CONFIG_VAR_DEFN(structtype, varname, vartype, membername, \
+ varflags, initval) \
{ .member = \
- { .name = varname, \
+ { .name = varname, \
.type = CONFIG_TYPE_EXTENDED, \
.type_def = &vartype ## _type_defn, \
.offset = offsetof(structtype, membername), \
}, \
+ .flags = varflags, \
.initvalue = initval \
CONF_TEST_MEMBERS(structtype, vartype, membername) \
}