diff options
author | Roger Dingledine <arma@torproject.org> | 2002-06-26 22:45:49 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2002-06-26 22:45:49 +0000 |
commit | 9a928eeb1215f0d7c9b6d0bb9e4571d0a16ed79a (patch) | |
tree | fac560bf2dce8a8d2b82e296b71ff24f59ab1a7a /src/or/config.c | |
parent | 766a465a6043ac4e643c398feb14f708fd0d863f (diff) | |
download | tor-9a928eeb1215f0d7c9b6d0bb9e4571d0a16ed79a.tar tor-9a928eeb1215f0d7c9b6d0bb9e4571d0a16ed79a.tar.gz |
Initial revision
svn:r2
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c new file mode 100644 index 000000000..535f7638d --- /dev/null +++ b/src/or/config.c @@ -0,0 +1,49 @@ +/** + * config.c + * Routines for loading the configuration file. + * + * Matej Pfajfar <mp292@cam.ac.uk> + */ + +/* + * Changes : + * $Log$ + * Revision 1.1 2002/06/26 22:45:50 arma + * Initial revision + * + * Revision 1.3 2002/04/02 14:28:24 badbytes + * Final finishes. + * + * Revision 1.2 2002/01/27 00:42:50 mp292 + * Reviewed according to Secure-Programs-HOWTO. + * + * Revision 1.1 2002/01/03 10:24:05 badbytes + * COde based on that in op. Needs to be modified. + * + */ + +#include "or.h" + +/* loads the configuration file */ +int getconfig(char *conf_filename, config_opt_t *options) +{ + FILE *cf = NULL; + int retval = 0; + + if ((!conf_filename) || (!options)) + return -1; + + /* load config file */ + cf = open_config(conf_filename); + if (!cf) + { + log(LOG_ERR,"Could not open configuration file %s.",conf_filename); + return -1; + } + retval = parse_config(cf,options); + if (retval) + return -1; + + return 0; +} + |