mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 22:58:50 +01:00
confparse: Add a function to check the magic of a toplevel object.
This commit is contained in:
parent
94853b4ab6
commit
aa6b4b62db
2 changed files with 13 additions and 0 deletions
|
@ -334,6 +334,17 @@ config_mgr_list_deprecated_vars(const config_mgr_t *mgr)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the magic number on <b>object</b> to make sure it's a valid toplevel
|
||||||
|
* object, created with <b>mgr</b>. Exit with an assertion if it isn't.
|
||||||
|
**/
|
||||||
|
void
|
||||||
|
config_check_toplevel_magic(const config_mgr_t *mgr,
|
||||||
|
const void *object)
|
||||||
|
{
|
||||||
|
struct_check_magic(object, &mgr->toplevel_magic);
|
||||||
|
}
|
||||||
|
|
||||||
/** Assert that the magic fields in <b>options</b> and its subsidiary
|
/** Assert that the magic fields in <b>options</b> and its subsidiary
|
||||||
* objects are all okay. */
|
* objects are all okay. */
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -232,6 +232,8 @@ void *config_dup(const config_mgr_t *mgr, const void *old);
|
||||||
char *config_dump(const config_mgr_t *mgr, const void *default_options,
|
char *config_dump(const config_mgr_t *mgr, const void *default_options,
|
||||||
const void *options, int minimal,
|
const void *options, int minimal,
|
||||||
int comment_defaults);
|
int comment_defaults);
|
||||||
|
void config_check_toplevel_magic(const config_mgr_t *mgr,
|
||||||
|
const void *object);
|
||||||
bool config_check_ok(const config_mgr_t *mgr, const void *options,
|
bool config_check_ok(const config_mgr_t *mgr, const void *options,
|
||||||
int severity);
|
int severity);
|
||||||
int config_assign(const config_mgr_t *mgr, void *options,
|
int config_assign(const config_mgr_t *mgr, void *options,
|
||||||
|
|
Loading…
Add table
Reference in a new issue