diff options
author | Roger Dingledine <arma@torproject.org> | 2004-11-06 05:18:11 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-11-06 05:18:11 +0000 |
commit | 6c61ed4fb5d33a8c51ff342165a26ac70765dd26 (patch) | |
tree | 6a767b637d976bf392a275e99386798bbf094e74 /src/or/or.h | |
parent | f490e5cdb6a60779ddadfba3dd022ba904c00b43 (diff) | |
download | tor-6c61ed4fb5d33a8c51ff342165a26ac70765dd26.tar tor-6c61ed4fb5d33a8c51ff342165a26ac70765dd26.tar.gz |
Make options no longer a global variable.
Now we can try setting an option but back out if it fails to parse, or
if it's disallowed (e.g. changing RunAsDaemon from 1 to 0).
Use parse_line_from_str rather than parse_line_from_file.
svn:r2692
Diffstat (limited to 'src/or/or.h')
-rw-r--r-- | src/or/or.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/or/or.h b/src/or/or.h index ae6620c46..35fb477c4 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -1089,14 +1089,20 @@ struct config_line_t { struct config_line_t *next; }; -int config_assign_default_dirservers(void); +or_options_t *get_options(void); +void set_options(or_options_t *new); + +int config_get_lines(char *string, struct config_line_t **result); +void config_free_lines(struct config_line_t *front); +int config_trial_assign(or_options_t **options, struct config_line_t *list, int reset); int resolve_my_address(const char *address, uint32_t *addr); -int getconfig(int argc, char **argv, or_options_t *options); +void options_init(or_options_t *options); +int getconfig(int argc, char **argv); int config_init_logs(or_options_t *options); void config_parse_exit_policy(struct config_line_t *cfg, struct exit_policy_t **dest); void exit_policy_free(struct exit_policy_t *p); -const char *get_data_directory(or_options_t *options); +const char *get_data_directory(void); struct config_line_t *config_get_assigned_option(or_options_t *options, const char *key); struct config_line_t *config_line_prepend(struct config_line_t *front, @@ -1330,11 +1336,11 @@ void connection_stop_writing(connection_t *conn); void connection_start_writing(connection_t *conn); void directory_has_arrived(time_t now); -int authdir_mode(void); -int clique_mode(void); -int server_mode(void); +int authdir_mode(or_options_t *options); +int clique_mode(or_options_t *options); +int server_mode(or_options_t *options); int advertised_server_mode(void); -int proxy_mode(void); +int proxy_mode(or_options_t *options); void handle_signals(int is_parent); void tor_cleanup(void); |