From 7fbd2975326eb5d2816a303b621942a72b5d57ca Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 29 Nov 2004 22:25:31 +0000 Subject: Suggestion from weasel: Make tor --version --version dump the cvs Id of every file. svn:r3019 --- src/or/buffers.c | 1 + src/or/circuitbuild.c | 1 + src/or/circuitlist.c | 1 + src/or/circuituse.c | 1 + src/or/command.c | 1 + src/or/config.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++++ src/or/connection.c | 1 + src/or/connection_edge.c | 1 + src/or/connection_or.c | 1 + src/or/control.c | 1 + src/or/cpuworker.c | 1 + src/or/directory.c | 3 +- src/or/dirserv.c | 1 + src/or/dns.c | 1 + src/or/hibernate.c | 1 + src/or/main.c | 1 + src/or/onion.c | 1 + src/or/or.h | 1 + src/or/relay.c | 1 + src/or/rendclient.c | 1 + src/or/rendcommon.c | 1 + src/or/rendmid.c | 1 + src/or/rendservice.c | 1 + src/or/rephist.c | 1 + src/or/router.c | 1 + src/or/routerlist.c | 1 + src/or/routerparse.c | 1 + src/or/test.c | 1 + src/or/tor_main.c | 1 + 29 files changed, 122 insertions(+), 2 deletions(-) (limited to 'src/or') diff --git a/src/or/buffers.c b/src/or/buffers.c index feac6d043..3bdd7982e 100644 --- a/src/or/buffers.c +++ b/src/or/buffers.c @@ -3,6 +3,7 @@ * Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char buffers_c_id[] = "$Id$"; /** * \file buffers.c diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 10c7bf0d3..65ffc3b36 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -3,6 +3,7 @@ * Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char circuitbuild_c_id[] = "$Id$"; /** * \file circuitbuild.c diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c index ac7a810da..11c7be3e8 100644 --- a/src/or/circuitlist.c +++ b/src/or/circuitlist.c @@ -3,6 +3,7 @@ * Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char circuitlist_c_id[] = "$Id$"; /** * \file circuitlist.c diff --git a/src/or/circuituse.c b/src/or/circuituse.c index 1c753ec54..702a50b2f 100644 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@ -3,6 +3,7 @@ * Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char circuituse_c_id[] = "$Id$"; /** * \file circuituse.c diff --git a/src/or/command.c b/src/or/command.c index 27d556d01..0e1e6f207 100644 --- a/src/or/command.c +++ b/src/or/command.c @@ -3,6 +3,7 @@ * Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char command_c_id[] = "$Id$"; /** * \file command.c diff --git a/src/or/config.c b/src/or/config.c index ff0797d8e..18ce5d39e 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -3,6 +3,7 @@ * Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char config_c_id[] = "$Id$"; /** * /file config.c @@ -15,6 +16,7 @@ #ifdef MS_WINDOWS #include #endif +#include "../common/aes.h" /** Enumeration of types which option values can take */ typedef enum config_type_t { @@ -193,6 +195,7 @@ static int write_configuration_file(const char *fname, or_options_t *options); static uint64_t config_parse_memunit(const char *s, int *ok); static int config_parse_interval(const char *s, int *ok); +static void print_cvs_version(void); /* * Functions to read and write the global options pointer. @@ -1578,6 +1581,9 @@ init_from_config(int argc, char **argv) if (argc > 1 && (!strcmp(argv[1],"--version"))) { printf("Tor version %s.\n",VERSION); + if (argc > 2 && (!strcmp(argv[2],"--version"))) { + print_cvs_version(); + } exit(0); } @@ -2334,3 +2340,91 @@ config_parse_interval(const char *s, int *ok) { return (int)r; } +static void +print_cvs_version(void) +{ + extern const char aes_c_id[]; + extern const char compat_c_id[]; + extern const char container_c_id[]; + extern const char crypto_c_id[]; + extern const char fakepoll_c_id[]; + extern const char log_c_id[]; + extern const char torgzip_c_id[]; + extern const char tortls_c_id[]; + extern const char util_c_id[]; + + extern const char buffers_c_id[]; + extern const char circuitbuild_c_id[]; + extern const char circuitlist_c_id[]; + extern const char circuituse_c_id[]; + extern const char command_c_id[]; + extern const char config_c_id[]; + extern const char connection_c_id[]; + extern const char connection_edge_c_id[]; + extern const char connection_or_c_id[]; + extern const char control_c_id[]; + extern const char cpuworker_c_id[]; + extern const char directory_c_id[]; + extern const char dirserv_c_id[]; + extern const char dns_c_id[]; + extern const char hibernate_c_id[]; + extern const char main_c_id[]; + extern const char onion_c_id[]; + extern const char relay_c_id[]; + extern const char rendclient_c_id[]; + extern const char rendcommon_c_id[]; + extern const char rendmid_c_id[]; + extern const char rendservice_c_id[]; + extern const char rephist_c_id[]; + extern const char router_c_id[]; + extern const char routerlist_c_id[]; + extern const char routerparse_c_id[]; + + puts(AES_H_ID); + puts(COMPAT_H_ID); + puts(CONTAINER_H_ID); + puts(CRYPTO_H_ID); + puts(FAKEPOLL_H_ID); + puts(LOG_H_ID); + puts(TORGZIP_H_ID); + puts(TORINT_H_ID); + puts(TORTLS_H_ID); + puts(UTIL_H_ID); + puts(aes_c_id); + puts(compat_c_id); + puts(container_c_id); + puts(crypto_c_id); + puts(fakepoll_c_id); + puts(log_c_id); + puts(torgzip_c_id); + puts(tortls_c_id); + puts(util_c_id); + + puts(OR_H_ID); + puts(buffers_c_id); + puts(circuitbuild_c_id); + puts(circuitlist_c_id); + puts(circuituse_c_id); + puts(command_c_id); + puts(config_c_id); + puts(connection_c_id); + puts(connection_edge_c_id); + puts(connection_or_c_id); + puts(control_c_id); + puts(cpuworker_c_id); + puts(directory_c_id); + puts(dirserv_c_id); + puts(dns_c_id); + puts(hibernate_c_id); + puts(main_c_id); + puts(onion_c_id); + puts(relay_c_id); + puts(rendclient_c_id); + puts(rendcommon_c_id); + puts(rendmid_c_id); + puts(rendservice_c_id); + puts(rephist_c_id); + puts(router_c_id); + puts(routerlist_c_id); + puts(routerparse_c_id); +} diff --git a/src/or/connection.c b/src/or/connection.c index 4c893692a..ab5197cf2 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -3,6 +3,7 @@ * Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char connection_c_id[] = "$Id$"; /** * \file connection.c diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 2c2111251..e92b9f096 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -3,6 +3,7 @@ * Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char connection_edge_c_id[] = "$Id$"; /** * \file connection_edge.c diff --git a/src/or/connection_or.c b/src/or/connection_or.c index 719cf20c8..4770f5d31 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -3,6 +3,7 @@ * Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char connection_or_c_id[] = "$Id$"; /** * \file connection_or.c diff --git a/src/or/control.c b/src/or/control.c index e8da7e3b1..38d80b8a5 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -1,6 +1,7 @@ /* Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char control_c_id[] = "$Id$"; /** * /file control.c diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c index c91665c1e..dbe0f74a3 100644 --- a/src/or/cpuworker.c +++ b/src/or/cpuworker.c @@ -2,6 +2,7 @@ * Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char cpuworker_c_id[] = "$Id$"; /** * \file cpuworker.c diff --git a/src/or/directory.c b/src/or/directory.c index 441798e24..0492f9190 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -1,9 +1,8 @@ /* Copyright 2001-2004 Roger Dingledine. * Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ - -/* See LICENSE for licensing information */ /* $Id$ */ +const char directory_c_id[] = "$Id$"; #include "or.h" diff --git a/src/or/dirserv.c b/src/or/dirserv.c index f49df40ff..c3aa0b969 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -2,6 +2,7 @@ * Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char dirserv_c_id[] = "$Id$"; #include "or.h" diff --git a/src/or/dns.c b/src/or/dns.c index 2991dcd72..7fb7f6b50 100644 --- a/src/or/dns.c +++ b/src/or/dns.c @@ -2,6 +2,7 @@ * Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char dns_c_id[] = "$Id$"; /** * \file dns.c diff --git a/src/or/hibernate.c b/src/or/hibernate.c index 582b0d450..c14db675e 100644 --- a/src/or/hibernate.c +++ b/src/or/hibernate.c @@ -1,6 +1,7 @@ /* Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char hibernate_c_id[] = "$Id$"; /** * \file hibernate.c diff --git a/src/or/main.c b/src/or/main.c index 8c7cef413..a594a23c1 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -3,6 +3,7 @@ * Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char main_c_id[] = "$Id$"; /** * \file main.c diff --git a/src/or/onion.c b/src/or/onion.c index a5abf3a9a..9e40ca579 100644 --- a/src/or/onion.c +++ b/src/or/onion.c @@ -3,6 +3,7 @@ * Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char onion_c_id[] = "$Id$"; /** * \file onion.c diff --git a/src/or/or.h b/src/or/or.h index 1d725065f..87fab798c 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -12,6 +12,7 @@ #ifndef __OR_H #define __OR_H +#define OR_H_ID "$Id$" #include "orconfig.h" #ifdef MS_WINDOWS diff --git a/src/or/relay.c b/src/or/relay.c index fd77a92f6..39b636993 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -3,6 +3,7 @@ * Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char relay_c_id[] = "$Id$"; /** * \file relay.c diff --git a/src/or/rendclient.c b/src/or/rendclient.c index c4fe53fb7..53689ad03 100644 --- a/src/or/rendclient.c +++ b/src/or/rendclient.c @@ -1,6 +1,7 @@ /* Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char rendclient_c_id[] = "$Id$"; /** * \file rendclient.c diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c index a50262ecc..7b47667bc 100644 --- a/src/or/rendcommon.c +++ b/src/or/rendcommon.c @@ -1,6 +1,7 @@ /* Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char rendcommon_c_id[] = "$Id$"; /** * \file rendcommon.c diff --git a/src/or/rendmid.c b/src/or/rendmid.c index f37e19e53..f8bc5005a 100644 --- a/src/or/rendmid.c +++ b/src/or/rendmid.c @@ -1,6 +1,7 @@ /* Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char rendmid_c_id[] = "$Id$"; /** * \file rendmid.c diff --git a/src/or/rendservice.c b/src/or/rendservice.c index 000e23563..d9ec3f574 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -1,6 +1,7 @@ /* Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char rendservice_c_id[] = "$Id$"; /** * \file rendservice.c diff --git a/src/or/rephist.c b/src/or/rephist.c index 97ef823e0..769f6439f 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -1,6 +1,7 @@ /* Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char rephist_c_id[] = "$Id$"; /** * \file rephist.c diff --git a/src/or/router.c b/src/or/router.c index e10b2658d..74f1473f7 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -3,6 +3,7 @@ * Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char router_c_id[] = "$Id$"; #include "or.h" diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 2520a4988..4fdaaf51b 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -3,6 +3,7 @@ * Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char routerlist_c_id[] = "$Id$"; #include "or.h" diff --git a/src/or/routerparse.c b/src/or/routerparse.c index 8b0e590aa..21d69cbbb 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -3,6 +3,7 @@ * Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char routerparse_c_id[] = "$Id$"; /** * \file routerparse.c diff --git a/src/or/test.c b/src/or/test.c index ac98b589f..e1e89c75b 100644 --- a/src/or/test.c +++ b/src/or/test.c @@ -2,6 +2,7 @@ * Copyright 2004 Roger Dingledine, Nick Mathewson. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char test_c_id[] = "$Id$"; #include #ifdef HAVE_FCNTL_H diff --git a/src/or/tor_main.c b/src/or/tor_main.c index bcdfbc40e..0b4462531 100644 --- a/src/or/tor_main.c +++ b/src/or/tor_main.c @@ -1,6 +1,7 @@ /* Copyright 2001-2004 Roger Dingledine. */ /* See LICENSE for licensing information */ /* $Id$ */ +const char tor_main_c_id[] = "$Id$"; /** * \file tor_main.c -- cgit v1.2.3