diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-11-05 10:18:47 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-11-07 07:28:43 -0500 |
commit | 0f0a9bdf332002bb0542dae6bb00e922af5dcf63 (patch) | |
tree | 4a25bc3928f62bd08c49c55ff1345db5fa8b91f6 /src/lib/conf | |
parent | 0d8504e70b0c6ff92f38fc7f4b4c38037d121e69 (diff) | |
download | tor-0f0a9bdf332002bb0542dae6bb00e922af5dcf63.tar.gz tor-0f0a9bdf332002bb0542dae6bb00e922af5dcf63.zip |
Stop using "config_suite_offset=-1" to indicate "no config suite."
Instead, create a separate "has_config_suite" boolean, so that only
top-level formats with config_suites need to declare an offset at
all.
Diffstat (limited to 'src/lib/conf')
-rw-r--r-- | src/lib/conf/conftypes.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/conf/conftypes.h b/src/lib/conf/conftypes.h index d4e2ea218a..dfe51cfba1 100644 --- a/src/lib/conf/conftypes.h +++ b/src/lib/conf/conftypes.h @@ -335,8 +335,14 @@ typedef struct config_format_t { /** If present, extra denotes a LINELIST variable for unrecognized * lines. Otherwise, unrecognized lines are an error. */ const struct_member_t *extra; - /** The position of a config_suite_t pointer within the toplevel object, - * or -1 if there is no such pointer. */ + /** + * If true, this format describes a top-level configuration, with + * a suite containing multiple sub-configuration objects. + */ + bool has_config_suite; + /** The position of a config_suite_t pointer within the toplevel object. + * Ignored unless have_config_suite is true. + */ ptrdiff_t config_suite_offset; } config_format_t; |