diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-06-18 20:40:59 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-06-25 12:51:25 -0400 |
commit | 3a4d67cf45dc1c94a33479c852a3dd7cbd4ebc95 (patch) | |
tree | d8ef3c95f1a97465a09655cdf81484296b0c1752 /src/app/config/statefile.c | |
parent | 2da188667d37757ae999c8ab24ed35b64e08700c (diff) | |
download | tor-3a4d67cf45dc1c94a33479c852a3dd7cbd4ebc95.tar.gz tor-3a4d67cf45dc1c94a33479c852a3dd7cbd4ebc95.zip |
Port confparse to use struct_var in place of typed_var.
This requires changes to config_var_t, causing corresponding changes
throughout its users.
Diffstat (limited to 'src/app/config/statefile.c')
-rw-r--r-- | src/app/config/statefile.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/app/config/statefile.c b/src/app/config/statefile.c index c6c5ec14f5..358b02f602 100644 --- a/src/app/config/statefile.c +++ b/src/app/config/statefile.c @@ -71,8 +71,10 @@ static config_abbrev_t state_abbrevs_[] = { DUMMY_TYPECHECK_INSTANCE(or_state_t); /*XXXX these next two are duplicates or near-duplicates from config.c */ -#define VAR(name,conftype,member,initvalue) \ - { name, CONFIG_TYPE_ ## conftype, offsetof(or_state_t, member), \ +#define VAR(varname,conftype,member,initvalue) \ + { { .name = varname, \ + .type = CONFIG_TYPE_ ## conftype, \ + .offset = offsetof(or_state_t, member), }, \ initvalue CONF_TEST_MEMBERS(or_state_t, conftype, member) } /** As VAR, but the option name and member name are the same. */ #define V(member,conftype,initvalue) \ @@ -155,9 +157,10 @@ static void or_state_free_cb(void *state); /** "Extra" variable in the state that receives lines we can't parse. This * lets us preserve options from versions of Tor newer than us. */ -static config_var_t state_extra_var = { - "__extra", CONFIG_TYPE_LINELIST, offsetof(or_state_t, ExtraLines), NULL - CONF_TEST_MEMBERS(or_state_t, LINELIST, ExtraLines) +static struct_member_t state_extra_var = { + .name = "__extra", + .type = CONFIG_TYPE_LINELIST, + .offset = offsetof(or_state_t, ExtraLines), }; /** Configuration format for or_state_t. */ |