mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-23 20:03:31 +01:00
confparse: Add a function to check the magic of a toplevel object.
This commit is contained in:
parent
94853b4ab6
commit
aa6b4b62db
@ -334,6 +334,17 @@ config_mgr_list_deprecated_vars(const config_mgr_t *mgr)
|
||||
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
|
||||
* objects are all okay. */
|
||||
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,
|
||||
const void *options, int minimal,
|
||||
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,
|
||||
int severity);
|
||||
int config_assign(const config_mgr_t *mgr, void *options,
|
||||
|
Loading…
Reference in New Issue
Block a user