diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-06-06 17:58:28 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-07-10 15:20:10 -0400 |
commit | a3e0a87d951b1323ca542c9b115d5525d0d022c9 (patch) | |
tree | cf0f810beb6960ff0e5b092a8760a707656bc097 /src/or/main.c | |
parent | f7d654b81e1a65803c22bb53fc1d3a2021d87d50 (diff) | |
download | tor-a3e0a87d951b1323ca542c9b115d5525d0d022c9.tar tor-a3e0a87d951b1323ca542c9b115d5525d0d022c9.tar.gz |
Completely refactor how FILENAME_PRIVATE works
We previously used FILENAME_PRIVATE identifiers mostly for
identifiers exposed only to the unit tests... but also for
identifiers exposed to the benchmarker, and sometimes for
identifiers exposed to a similar module, and occasionally for no
really good reason at all.
Now, we use FILENAME_PRIVATE identifiers for identifiers shared by
Tor and the unit tests. They should be defined static when we
aren't building the unit test, and globally visible otherwise. (The
STATIC macro will keep us honest here.)
For identifiers used only by the unit tests and never by Tor at all,
on the other hand, we wrap them in #ifdef TOR_UNIT_TESTS.
This is not the motivating use case for the split test/non-test
build system; it's just a test example to see how it works, and to
take a chance to clean up the code a little.
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/or/main.c b/src/or/main.c index 85aa97f5a..21133855a 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -10,7 +10,6 @@ * connections, implements main loop, and drives scheduled events. **/ -#define MAIN_PRIVATE #include "or.h" #include "addressmap.h" #include "buffers.h" @@ -1874,7 +1873,7 @@ do_hup(void) } /** Tor main loop. */ -/* static */ int +int do_main_loop(void) { int loop_result; @@ -2301,7 +2300,7 @@ handle_signals(int is_parent) /** Main entry point for the Tor command-line client. */ -/* static */ int +int tor_init(int argc, char *argv[]) { char buf[256]; @@ -2567,7 +2566,7 @@ tor_cleanup(void) } /** Read/create keys as needed, and echo our fingerprint to stdout. */ -/* static */ int +static int do_list_fingerprint(void) { char buf[FINGERPRINT_LEN+1]; @@ -2597,7 +2596,7 @@ do_list_fingerprint(void) /** Entry point for password hashing: take the desired password from * the command line, and print its salted hash to stdout. **/ -/* static */ void +static void do_hash_password(void) { |