commit 4a248bafba0136ded8370de672c0b27b912bbede
parent 24ee44df90d12eb98ba5a39638963696ce2f8012
Author: Nick Mathewson <nickm@torproject.org>
Date: Wed, 23 Oct 2019 14:39:20 -0400
Rename validate_fn{,_t} to start with "legacy_".
The current API of this callback mixes responsibilities, including:
* validation
* transition checking
* processing (modifying) the configuration object.
These will have to be disentangled piece by piece, so for now, we'll
have "legacy" validate functions as well.
This is an automated commit, generated by this command:
./scripts/maint/rename_c_identifier.py \
validate_fn_t legacy_validate_fn_t \
validate_fn legacy_validate_fn
Diffstat:
6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/app/config/config.c b/src/app/config/config.c
@@ -873,7 +873,7 @@ static const config_format_t options_format = {
.abbrevs = option_abbrevs_,
.deprecations = option_deprecation_notes_,
.vars = option_vars_,
- .validate_fn = options_validate_cb,
+ .legacy_validate_fn = options_validate_cb,
.clear_fn = options_clear_cb,
.config_suite_offset = offsetof(or_options_t, subconfigs_),
};
diff --git a/src/app/config/statefile.c b/src/app/config/statefile.c
@@ -165,7 +165,7 @@ static const config_format_t state_format = {
},
.abbrevs = state_abbrevs_,
.vars = state_vars_,
- .validate_fn = or_state_validate_cb,
+ .legacy_validate_fn = or_state_validate_cb,
.extra = &state_extra_var,
.config_suite_offset = offsetof(or_state_t, substates_),
};
diff --git a/src/feature/dirauth/shared_random_state.c b/src/feature/dirauth/shared_random_state.c
@@ -94,7 +94,7 @@ static const config_format_t state_format = {
offsetof(sr_disk_state_t, magic_),
},
.vars = state_vars,
- .validate_fn = disk_state_validate_cb,
+ .legacy_validate_fn = disk_state_validate_cb,
.extra = &state_extra_var,
.config_suite_offset = -1,
};
diff --git a/src/lib/confmgt/confparse.c b/src/lib/confmgt/confparse.c
@@ -1166,7 +1166,7 @@ config_dump(const config_mgr_t *mgr, const void *default_options,
/* XXX use a 1 here so we don't add a new log line while dumping */
if (default_options == NULL) {
- if (fmt->validate_fn(NULL, defaults_tmp, &msg) < 0) {
+ if (fmt->legacy_validate_fn(NULL, defaults_tmp, &msg) < 0) {
// LCOV_EXCL_START
log_err(LD_BUG, "Failed to validate default config: %s", msg);
tor_free(msg);
diff --git a/src/lib/confmgt/confparse.h b/src/lib/confmgt/confparse.h
@@ -68,7 +68,7 @@ typedef struct config_deprecation_t {
* config_dump(); later in our refactoring, it will be cleaned up and used
* more generally.
*/
-typedef int (*validate_fn_t)(const void *oldval,
+typedef int (*legacy_validate_fn_t)(const void *oldval,
void *newval,
char **msg_out);
@@ -98,7 +98,7 @@ typedef struct config_format_t {
const config_var_t *vars; /**< List of variables we recognize, their default
* values, and where we stick them in the
* structure. */
- validate_fn_t validate_fn; /**< Function to validate config. */
+ legacy_validate_fn_t legacy_validate_fn; /**< Function to validate config. */
clear_cfg_fn_t clear_fn; /**< Function to clear the configuration. */
/** If present, extra denotes a LINELIST variable for unrecognized
* lines. Otherwise, unrecognized lines are an error. */
diff --git a/src/test/test_confparse.c b/src/test/test_confparse.c
@@ -128,7 +128,7 @@ static const config_format_t test_fmt = {
.abbrevs = test_abbrevs,
.deprecations = test_deprecation_notes,
.vars = test_vars,
- .validate_fn = test_validate_cb,
+ .legacy_validate_fn = test_validate_cb,
.config_suite_offset = -1,
};
@@ -822,7 +822,7 @@ static config_format_t etest_fmt = {
.abbrevs = test_abbrevs,
.deprecations = test_deprecation_notes,
.vars = test_vars,
- .validate_fn = test_validate_cb,
+ .legacy_validate_fn = test_validate_cb,
.extra = &extra,
.config_suite_offset = -1,
};