diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-12-15 15:19:28 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-12-15 15:32:46 -0500 |
commit | 376f97aaa1e3a5aed60a67cee3d71ea7ccc90623 (patch) | |
tree | 4742e7a0ff46483066da7ab5dce81d6388f0c1d4 /src/or/confparse.h | |
parent | 424572ee0a1614280ed16d99e1298bcbac262101 (diff) | |
download | tor-376f97aaa1e3a5aed60a67cee3d71ea7ccc90623.tar.gz tor-376f97aaa1e3a5aed60a67cee3d71ea7ccc90623.zip |
Simplify the very repetitious options_transition_allowed()
Diffstat (limited to 'src/or/confparse.h')
-rw-r--r-- | src/or/confparse.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/confparse.h b/src/or/confparse.h index fc4a7b2d06..f1f2030343 100644 --- a/src/or/confparse.h +++ b/src/or/confparse.h @@ -208,5 +208,13 @@ const char *config_expand_abbrev(const config_format_t *fmt, int command_line, int warn_obsolete); void warn_deprecated_option(const char *what, const char *why); +/* Helper macros to compare an option across two configuration objects */ +#define CFG_EQ_BOOL(a,b,opt) ((a)->opt == (b)->opt) +#define CFG_EQ_INT(a,b,opt) ((a)->opt == (b)->opt) +#define CFG_EQ_STRING(a,b,opt) (!strcmp_opt((a)->opt, (b)->opt)) +#define CFG_EQ_SMARTLIST(a,b,opt) smartlist_strings_eq((a)->opt, (b)->opt) +#define CFG_EQ_LINELIST(a,b,opt) config_lines_eq((a)->opt, (b)->opt) +#define CFG_EQ_ROUTERSET(a,b,opt) routerset_equal((a)->opt, (b)->opt) + #endif /* !defined(TOR_CONFPARSE_H) */ |