aboutsummaryrefslogtreecommitdiff
path: root/src/lib/confmgt/structvar.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-06-21 09:58:40 -0400
committerNick Mathewson <nickm@torproject.org>2019-06-25 12:51:25 -0400
commita7835202cf871f68854494df904058a6e644c0b0 (patch)
tree0da40c2c861d44374de01f58902e17a913326993 /src/lib/confmgt/structvar.h
parentb6457d4c08f601c4e42e64aad47ac9c30c36306e (diff)
downloadtor-a7835202cf871f68854494df904058a6e644c0b0.tar.gz
tor-a7835202cf871f68854494df904058a6e644c0b0.zip
Turn several properties of types or variables into flags.
"unsettable" is a property of types. LINELIST_V and OBSOLETE are unsettable, meaning that they cannot be set by name. "contained" is a property of types. I'm hoping to find a better name here. LINELIST_S is "contained" because it always appears within a LINELIST_V, and as such doesn't need to be dumped ore copied independently. "cumulative" is a property of types. Cumulative types can appear more than once in a torrc without causing a warning, because they add to each other rather than replacing each other. "obsolete" is a property of variables. "marking fragile" is now a command that struct members can accept. With these changes, confparse and config no longer ever need to mention CONFIG_TYPE_XYZ values by name.
Diffstat (limited to 'src/lib/confmgt/structvar.h')
-rw-r--r--src/lib/confmgt/structvar.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/confmgt/structvar.h b/src/lib/confmgt/structvar.h
index 92b9b6fc71..e6dbc6d6ec 100644
--- a/src/lib/confmgt/structvar.h
+++ b/src/lib/confmgt/structvar.h
@@ -40,9 +40,14 @@ bool struct_var_eq(const void *a, const void *b,
const struct struct_member_t *member);
bool struct_var_ok(const void *object,
const struct struct_member_t *member);
+void struct_var_mark_fragile(void *object,
+ const struct struct_member_t *member);
const char *struct_var_get_name(const struct struct_member_t *member);
const char *struct_var_get_typename(const struct struct_member_t *member);
+bool struct_var_is_cumulative(const struct struct_member_t *member);
+bool struct_var_is_settable(const struct struct_member_t *member);
+bool struct_var_is_contained(const struct struct_member_t *member);
int struct_var_kvassign(void *object, const struct config_line_t *line,
char **errmsg,