diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-10-18 14:26:29 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-11-01 13:22:09 -0400 |
commit | fa02ea102e3ccc946d269788e88c6818e84ad6f8 (patch) | |
tree | 1243062264c951326ef829d5cfeca1b0a8dcdc7a /src/or/main.c | |
parent | 72b5e4a2db4282002fe50e11c2b8a79e108d30f8 (diff) | |
download | tor-fa02ea102e3ccc946d269788e88c6818e84ad6f8.tar.gz tor-fa02ea102e3ccc946d269788e88c6818e84ad6f8.zip |
Add a public tor_api.h with an implementation in tor_api.c
The main effect of this change is to commit to an extensible
long-term API.
Closes ticket 23684.
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/or/main.c b/src/or/main.c index 65b0b8f4df..5152ec10be 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -106,6 +106,8 @@ #include "shared_random.h" #include "statefile.h" #include "status.h" +#include "tor_api.h" +#include "tor_api_internal.h" #include "util_process.h" #include "ext_orport.h" #ifdef USE_DMALLOC @@ -3703,14 +3705,16 @@ sandbox_init_filter(void) return cfg; } -/** Main entry point for the Tor process. Called from main(). */ -/* This function is distinct from main() only so we can link main.c into - * the unittest binary without conflicting with the unittests' main. */ +/* Main entry point for the Tor process. Called from tor_main(), and by + * anybody embedding Tor. */ int -tor_main(int argc, char *argv[]) +tor_run_main(const tor_main_configuration_t *tor_cfg) { int result = 0; + int argc = tor_cfg->argc; + char **argv = tor_cfg->argv; + #ifdef _WIN32 #ifndef HeapEnableTerminationOnCorruption #define HeapEnableTerminationOnCorruption 1 |