diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-09-10 09:51:07 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2019-09-11 09:42:19 -0400 |
commit | e61bfd0bfd1acfdd4f5d5912c5cc2c0e8ec61b75 (patch) | |
tree | c5e0029fbb3ab052d6e6a4b46b0e241509a9679c | |
parent | fe5033d3b0f618493ec8ffd4274352ed42835bdb (diff) | |
download | tor-e61bfd0bfd1acfdd4f5d5912c5cc2c0e8ec61b75.tar.gz tor-e61bfd0bfd1acfdd4f5d5912c5cc2c0e8ec61b75.zip |
Extract common list of flags to use for obsolete variables.
-rw-r--r-- | src/lib/conf/confmacros.h | 3 | ||||
-rw-r--r-- | src/lib/conf/conftypes.h | 6 | ||||
-rw-r--r-- | src/lib/confmgt/type_defs.c | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/conf/confmacros.h b/src/lib/conf/confmacros.h index a32667e1ab..68121891f1 100644 --- a/src/lib/conf/confmacros.h +++ b/src/lib/conf/confmacros.h @@ -61,8 +61,7 @@ #define CONFIG_VAR_OBSOLETE(varname) \ { .member = { .name = varname, .type = CONFIG_TYPE_OBSOLETE }, \ - .flags = CFLG_NOSET | CFLG_NOLIST | CFLG_NODUMP | CFLG_NOCOPY | \ - CFLG_NOCMP \ + .flags = CFLG_GROUP_OBSOLETE \ } #endif /* !defined(TOR_LIB_CONF_CONFMACROS_H) */ diff --git a/src/lib/conf/conftypes.h b/src/lib/conf/conftypes.h index aabdfdce7a..274065cff2 100644 --- a/src/lib/conf/conftypes.h +++ b/src/lib/conf/conftypes.h @@ -179,6 +179,12 @@ typedef struct struct_magic_decl_t { */ #define CFLG_NOREPLACE (1u<<5) +/** + * A group of flags that should be set on all obsolete options and types. + **/ +#define CFLG_GROUP_OBSOLETE \ + (CFLG_NOCOPY|CFLG_NOCMP|CFLG_NODUMP|CFLG_NOSET|CFLG_NOLIST) + /** A variable allowed in the configuration file or on the command line. */ typedef struct config_var_t { struct_member_t member; /** A struct member corresponding to this diff --git a/src/lib/confmgt/type_defs.c b/src/lib/confmgt/type_defs.c index a0431e4f88..324b62e56c 100644 --- a/src/lib/confmgt/type_defs.c +++ b/src/lib/confmgt/type_defs.c @@ -739,7 +739,7 @@ static const var_type_def_t type_definitions_table[] = { .flags=CFLG_NOREPLACE|CFLG_NOSET }, [CONFIG_TYPE_OBSOLETE] = { .name="Obsolete", .fns=&ignore_fns, - .flags=CFLG_NOCOPY|CFLG_NOCMP|CFLG_NODUMP|CFLG_NOSET|CFLG_NOLIST + .flags=CFLG_GROUP_OBSOLETE, } }; |