diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-06-20 15:55:59 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-06-25 12:51:25 -0400 |
commit | c553750e32d1bf669a3e8308fa44319954a627ca (patch) | |
tree | f6e7ef8bb77e5be7022ddfbb8f348f97ea437fc4 /src/feature/dirauth/shared_random_state.c | |
parent | 4d101b39d74fb467d7fb4ad8ddb27e07c3074a69 (diff) | |
download | tor-c553750e32d1bf669a3e8308fa44319954a627ca.tar.gz tor-c553750e32d1bf669a3e8308fa44319954a627ca.zip |
Move responsibility for config var macros
The testing-only parts now live in a conftesting.h; the shared parts
of the macros live in confmacros.h
Diffstat (limited to 'src/feature/dirauth/shared_random_state.c')
-rw-r--r-- | src/feature/dirauth/shared_random_state.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/feature/dirauth/shared_random_state.c b/src/feature/dirauth/shared_random_state.c index da4187b38a..3cdb223d25 100644 --- a/src/feature/dirauth/shared_random_state.c +++ b/src/feature/dirauth/shared_random_state.c @@ -51,15 +51,11 @@ static const char dstate_cur_srv_key[] = "SharedRandCurrentValue"; * members with CONF_CHECK_VAR_TYPE. */ DUMMY_TYPECHECK_INSTANCE(sr_disk_state_t); -/* These next two are duplicates or near-duplicates from config.c */ -#define VAR(varname, conftype, member, initvalue) \ - { { .name = varname, \ - .type = CONFIG_TYPE_ ## conftype, \ - .offset = offsetof(sr_disk_state_t, member), }, \ - initvalue CONF_TEST_MEMBERS(sr_disk_state_t, conftype, member) } -/* As VAR, but the option name and member name are the same. */ -#define V(member, conftype, initvalue) \ +#define VAR(varname,conftype,member,initvalue) \ + CONFIG_VAR_ETYPE(sr_disk_state_t, varname, conftype, member, initvalue) +#define V(member,conftype,initvalue) \ VAR(#member, conftype, member, initvalue) + /* Our persistent state magic number. */ #define SR_DISK_STATE_MAGIC 0x98AB1254 |