summaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-09-05 11:48:46 -0400
committerDavid Goulet <dgoulet@torproject.org>2019-09-11 09:42:19 -0400
commit9b571d4729f0a6a6c1040ad9cb3e452ff0a5cee6 (patch)
treec2f9b915d0db8228af19594c8658770f19a58137 /src/app
parent1b3b6d9f2d94e659375257a5c439d250ce0075fd (diff)
downloadtor-9b571d4729f0a6a6c1040ad9cb3e452ff0a5cee6.tar.gz
tor-9b571d4729f0a6a6c1040ad9cb3e452ff0a5cee6.zip
confparse, conftypes: Replace flags with their new names.
The old names remain as #defines that cause variables to get one or more flags. Now every flag-testing function in confparse.c tests exactly one flag.
Diffstat (limited to 'src/app')
-rw-r--r--src/app/config/confparse.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/src/app/config/confparse.c b/src/app/config/confparse.c
index 7579d9ef8e..dcbad0b900 100644
--- a/src/app/config/confparse.c
+++ b/src/app/config/confparse.c
@@ -531,7 +531,7 @@ config_var_has_flag(const config_var_t *var, uint32_t flag)
static bool
config_var_is_replaced_on_set(const config_var_t *var)
{
- return ! config_var_has_flag(var, VTFLAG_CUMULATIVE);
+ return ! config_var_has_flag(var, CFLG_NOREPLACE);
}
/**
@@ -541,7 +541,7 @@ config_var_is_replaced_on_set(const config_var_t *var)
bool
config_var_is_settable(const config_var_t *var)
{
- return ! config_var_has_flag(var, CVFLAG_OBSOLETE | VTFLAG_UNSETTABLE);
+ return ! config_var_has_flag(var, CFLG_NOSET);
}
/**
@@ -562,23 +562,6 @@ config_var_is_gettable(const config_var_t *var)
}
/**
- * Return true iff this is variable is "derived" from another -- that is,
- * inspecting this variable inspects part of another, and changing this
- * variable changes part of another.
- *
- * Derived variables require special handling in several ways: they do not
- * need to be copied independently when we are copying a config object, since
- * copying the variable they are derived from copies them too. Similarly,
- * they do not need to be compared independently when listing changes, since
- * comparing the variable that they are derived from compares them too.
- **/
-static bool
-config_var_is_derived(const config_var_t *var)
-{
- return config_var_has_flag(var, VTFLAG_CONTAINED);
-}
-
-/**
* Return true iff we need to check <b>var</b> for changes when we are
* comparing config options for changes.
*
@@ -589,7 +572,7 @@ config_var_is_derived(const config_var_t *var)
static bool
config_var_should_list_changes(const config_var_t *var)
{
- return ! config_var_is_derived(var);
+ return ! config_var_has_flag(var, CFLG_NOCMP);
}
/**
@@ -603,7 +586,7 @@ config_var_should_list_changes(const config_var_t *var)
static bool
config_var_needs_copy(const config_var_t *var)
{
- return ! config_var_is_derived(var);
+ return ! config_var_has_flag(var, CFLG_NOCOPY);
}
/**h
@@ -613,7 +596,7 @@ config_var_needs_copy(const config_var_t *var)
bool
config_var_is_listable(const config_var_t *var)
{
- return ! config_var_has_flag(var, CVFLAG_INVISIBLE);
+ return ! config_var_has_flag(var, CFLG_NOLIST);
}
/**
@@ -627,7 +610,7 @@ config_var_is_listable(const config_var_t *var)
static bool
config_var_is_dumpable(const config_var_t *var)
{
- return ! config_var_has_flag(var, VTFLAG_CONTAINED | CVFLAG_NODUMP);
+ return ! config_var_has_flag(var, CFLG_NODUMP);
}
/*