Pārlūkot izejas kodu

Suggestion from weasel: Make tor --version --version dump the cvs Id of every file.

svn:r3019
Nick Mathewson 19 gadi atpakaļ
vecāks
revīzija
7fbd297532

+ 1 - 0
src/common/aes.c

@@ -1,6 +1,7 @@
 /* Copyright 2001,2002,2003 Roger Dingledine, Matej Pfajfar. */
 /* See LICENSE for licensing information */
 /* $Id$ */
+const char aes_c_id[] = "$Id$";
 
 /**
  * \file aes.c

+ 1 - 0
src/common/aes.h

@@ -6,6 +6,7 @@
 
 #ifndef __AES_H
 #define __AES_H
+#define AES_H_ID "$Id$"
 
 /**
  * \file aes.h

+ 1 - 0
src/common/compat.c

@@ -1,6 +1,7 @@
 /* Copyright 2003-2004 Roger Dingledine; Copyright 2004 Nick Mathewson */
 /* See LICENSE for licensing information */
 /* $Id$ */
+const char compat_c_id[] = "$Id$";
 
 /* This is required on rh7 to make strptime not complain.
  */

+ 1 - 0
src/common/compat.h

@@ -4,6 +4,7 @@
 
 #ifndef __COMPAT_H
 #define __COMPAT_H
+#define COMPAT_H_ID "$Id$"
 
 #include "orconfig.h"
 #include "torint.h"

+ 1 - 0
src/common/container.c

@@ -1,6 +1,7 @@
 /* Copyright 2003-2004 Roger Dingledine; Copyright 2004 Nick Mathewson */
 /* See LICENSE for licensing information */
 /* $Id$ */
+const char container_c_id[] = "$Id$";
 
 #include "compat.h"
 #include "util.h"

+ 1 - 0
src/common/container.h

@@ -4,6 +4,7 @@
 
 #ifndef __CONTAINER_H
 #define __CONTAINER_H
+#define CONTAINER_H_ID "$Id$"
 
 /** Generic resizeable array. */
 typedef struct smartlist_t smartlist_t;

+ 1 - 0
src/common/crypto.c

@@ -1,6 +1,7 @@
 /* Copyright 2001,2002,2003 Roger Dingledine, Matej Pfajfar. */
 /* See LICENSE for licensing information */
 /* $Id$ */
+const char crypto_c_id[] = "$Id$";
 
 /**
  * \file crypto.c

+ 1 - 0
src/common/crypto.h

@@ -10,6 +10,7 @@
 
 #ifndef __CRYPTO_H
 #define __CRYPTO_H
+#define CRYPTO_H_ID "$Id$"
 
 #include <stdio.h>
 

+ 1 - 0
src/common/fakepoll.c

@@ -1,6 +1,7 @@
 /* Copyright 2002,2003 Nick Mathewson, Roger Dingledine */
 /* See LICENSE for licensing information */
 /* $Id$ */
+const char fakepoll_c_id[] = "$Id$";
 
 /**
  * \file fakepoll.c

+ 1 - 0
src/common/fakepoll.h

@@ -4,6 +4,7 @@
 
 #ifndef __FAKEPOLL_H
 #define __FAKEPOLL_H
+#define FAKEPOLL_H_ID "$Id$"
 
 /**
  * \file fakepoll.h

+ 1 - 0
src/common/log.c

@@ -1,6 +1,7 @@
 /* Copyright 2001,2002,2003 Roger Dingledine, Matej Pfajfar. */
 /* See LICENSE for licensing information */
 /* $Id$ */
+const char log_c_id[] = "$Id$";
 
 /**
  * \file log.c

+ 1 - 5
src/common/log.h

@@ -9,11 +9,7 @@
  **/
 
 #ifndef __LOG_H
-
-/**
- * \file log.h
- * \brief Headers for log.c
- */
+#define LOG_H_ID "$Id$"
 
 #include "../common/compat.h"
 

+ 1 - 0
src/common/test.h

@@ -4,6 +4,7 @@
 
 #ifndef __TEST_H
 #define __TEST_H
+#define TEST_H_ID "$Id$"
 
 /**
  * \file test.h

+ 1 - 0
src/common/torgzip.c

@@ -1,6 +1,7 @@
 /* Copyright 2004 Roger Dingledine */
 /* See LICENSE for licensing information */
 /* $Id$ */
+const char torgzip_c_id[] = "$Id$";
 
 /**
  * \file torgzip.c

+ 1 - 0
src/common/torgzip.h

@@ -9,6 +9,7 @@
 
 #ifndef __TORGZIP_H
 #define __TORGZIP_H
+#define TORGZIP_H_ID "$Id$"
 
 typedef enum { GZIP_METHOD=1, ZLIB_METHOD=2 } compress_method_t;
 

+ 1 - 0
src/common/torint.h

@@ -9,6 +9,7 @@
 
 #ifndef __TORINT_H
 #define __TORINT_H
+#define TORINT_H_ID "$Id$"
 
 #include "orconfig.h"
 

+ 1 - 0
src/common/tortls.c

@@ -1,6 +1,7 @@
 /* Copyright 2003 Roger Dingledine. */
 /* See LICENSE for licensing information */
 /* $Id$ */
+const char tortls_c_id[] = "$Id$";
 
 /**
  * \file tortls.c

+ 1 - 0
src/common/tortls.h

@@ -4,6 +4,7 @@
 
 #ifndef _TORTLS_H
 #define _TORTLS_H
+#define TORTLS_H_ID "$Id$"
 
 /**
  * \file tortls.h

+ 1 - 0
src/common/util.c

@@ -1,6 +1,7 @@
 /* Copyright 2003 Roger Dingledine */
 /* See LICENSE for licensing information */
 /* $Id$ */
+const char util_c_id[] = "$Id$";
 
 /**
  * \file util.c

+ 1 - 0
src/common/util.h

@@ -9,6 +9,7 @@
 
 #ifndef __UTIL_H
 #define __UTIL_H
+#define UTIL_H_ID "$Id$"
 
 #include "orconfig.h"
 #include "torint.h"

+ 1 - 0
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

+ 1 - 0
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

+ 1 - 0
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

+ 1 - 0
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

+ 1 - 0
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

+ 94 - 0
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 <shlobj.h>
 #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);
+}

+ 1 - 0
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

+ 1 - 0
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

+ 1 - 0
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

+ 1 - 0
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

+ 1 - 0
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

+ 1 - 2
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"
 

+ 1 - 0
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"
 

+ 1 - 0
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

+ 1 - 0
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

+ 1 - 0
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

+ 1 - 0
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

+ 1 - 0
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

+ 1 - 0
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

+ 1 - 0
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

+ 1 - 0
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

+ 1 - 0
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

+ 1 - 0
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

+ 1 - 0
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

+ 1 - 0
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"
 

+ 1 - 0
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"
 

+ 1 - 0
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

+ 1 - 0
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 <stdio.h>
 #ifdef HAVE_FCNTL_H

+ 1 - 0
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