diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-07-03 11:09:54 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-07-03 11:09:54 -0400 |
commit | 77e678c20daf8633ce1904dd1df28398d820f7c0 (patch) | |
tree | 411cb587ea7533b65edf60c8bc2221b072dda807 /src/or/config.h | |
parent | a01b4d7f87f2217f55f5c5113fe19a2d3081a44c (diff) | |
parent | 518ebe14dcc7568da353c4c517039d0c621deb28 (diff) | |
download | tor-77e678c20daf8633ce1904dd1df28398d820f7c0.tar.gz tor-77e678c20daf8633ce1904dd1df28398d820f7c0.zip |
Merge remote-tracking branch 'github/shrink_or_h_more'
Diffstat (limited to 'src/or/config.h')
-rw-r--r-- | src/or/config.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/or/config.h b/src/or/config.h index d2faf6c512..5fdf7862ec 100644 --- a/src/or/config.h +++ b/src/or/config.h @@ -12,6 +12,7 @@ #ifndef TOR_CONFIG_H #define TOR_CONFIG_H +#include "or/or_options_st.h" #include "lib/testsupport/testsupport.h" #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(DARWIN) @@ -42,7 +43,16 @@ void init_protocol_warning_severity_level(void); int get_protocol_warning_severity_level(void); const char *get_version(void); const char *get_short_version(void); -setopt_err_t options_trial_assign(config_line_t *list, unsigned flags, + +/** An error from options_trial_assign() or options_init_from_string(). */ +typedef enum setopt_err_t { + SETOPT_OK = 0, + SETOPT_ERR_MISC = -1, + SETOPT_ERR_PARSE = -2, + SETOPT_ERR_TRANSITION = -3, + SETOPT_ERR_SETTING = -4, +} setopt_err_t; +setopt_err_t options_trial_assign(struct config_line_t *list, unsigned flags, char **msg); uint32_t get_last_resolved_addr(void); @@ -62,7 +72,7 @@ setopt_err_t options_init_from_string(const char *cf_defaults, const char *cf, int command, const char *command_arg, char **msg); int option_is_recognized(const char *key); const char *option_get_canonical_name(const char *key); -config_line_t *option_get_assignment(const or_options_t *options, +struct config_line_t *option_get_assignment(const or_options_t *options, const char *key); int options_save_current(void); const char *get_torrc_fname(int defaults_fname); @@ -180,8 +190,8 @@ int init_cookie_authentication(const char *fname, const char *header, or_options_t *options_new(void); int config_parse_commandline(int argc, char **argv, int ignore_errors, - config_line_t **result, - config_line_t **cmdline_result); + struct config_line_t **result, + struct config_line_t **cmdline_result); void config_register_addressmaps(const or_options_t *options); /* XXXX move to connection_edge.h */ @@ -260,7 +270,7 @@ STATIC int parse_dir_fallback_line(const char *line, int validate_only); STATIC int have_enough_mem_for_dircache(const or_options_t *options, size_t total_mem, char **msg); STATIC int parse_port_config(smartlist_t *out, - const config_line_t *ports, + const struct config_line_t *ports, const char *portname, int listener_type, const char *defaultaddr, |