From c217b1ca711538d5c6e49a56c1047e021eb0fb3c Mon Sep 17 00:00:00 2001
From: Nick Mathewson <nickm@torproject.org>
Date: Mon, 7 Apr 2003 02:12:02 +0000
Subject: [PATCH] Add magic to end of C files to make emacs happy; split test
 invocation into separate file.

svn:r224
---
 src/or/Makefile.am       | 19 +++++++++++--------
 src/or/buffers.c         |  7 +++++++
 src/or/circuit.c         |  7 +++++++
 src/or/command.c         |  7 +++++++
 src/or/config.c          |  7 +++++++
 src/or/connection.c      |  7 +++++++
 src/or/connection_ap.c   |  8 ++++++++
 src/or/connection_exit.c |  7 +++++++
 src/or/connection_op.c   |  7 +++++++
 src/or/connection_or.c   |  7 +++++++
 src/or/directory.c       |  7 +++++++
 src/or/dns.c             |  7 +++++++
 src/or/main.c            |  9 ++++++++-
 src/or/onion.c           |  7 +++++++
 src/or/or.h              |  8 ++++++++
 src/or/routers.c         |  7 +++++++
 src/or/test.c            | 15 +++++++++++++++
 src/or/tor_main.c        | 18 ++++++++++++++++++
 18 files changed, 152 insertions(+), 9 deletions(-)
 create mode 100644 src/or/test.c
 create mode 100644 src/or/tor_main.c

diff --git a/src/or/Makefile.am b/src/or/Makefile.am
index bb84b03522..9b7c5a38a8 100644
--- a/src/or/Makefile.am
+++ b/src/or/Makefile.am
@@ -1,19 +1,22 @@
+TESTS = test
 
-TESTS = test_config
-
-noinst_PROGRAMS = test_config
+noinst_PROGRAMS = test
 
 bin_PROGRAMS = or
 
-or_LDADD = -L../common -lor -lz
-
 or_SOURCES = buffers.c circuit.c command.c connection.c \
              connection_exit.c connection_ap.c connection_op.c connection_or.c config.c \
-             main.c onion.c routers.c directory.c dns.c
+             onion.c routers.c directory.c dns.c \
+             main.c tor_main.c
 
-test_config_SOURCES = test_config.c config.c
+or_LDADD = -L../common -lor -lz
+
+test_SOURCES = buffers.c circuit.c command.c connection.c \
+             connection_exit.c connection_ap.c connection_op.c connection_or.c config.c \
+             onion.c routers.c directory.c dns.c \
+             main.c test.c
 
-test_config_LDADD = -L../common -lor
+test_LDADD = -L../common -lor -lz
 
 noinst_HEADERS = or.h tree.h
 
diff --git a/src/or/buffers.c b/src/or/buffers.c
index 074b8be2c6..41889fc9fa 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -252,3 +252,10 @@ int find_on_inbuf(char *string, int string_len,
   return -1;
 }
 
+/*
+  Local Variables:
+  mode:c
+  indent-tabs-mode:nil
+  c-basic-offset:2
+  End:
+*/
diff --git a/src/or/circuit.c b/src/or/circuit.c
index ed22340209..4de154a93d 100644
--- a/src/or/circuit.c
+++ b/src/or/circuit.c
@@ -631,3 +631,10 @@ void circuit_dump_by_conn(connection_t *conn) {
   }
 }
 
+/*
+  Local Variables:
+  mode:c
+  indent-tabs-mode:nil
+  c-basic-offset:2
+  End:
+*/
diff --git a/src/or/command.c b/src/or/command.c
index f7876ec06e..878d26e0a0 100644
--- a/src/or/command.c
+++ b/src/or/command.c
@@ -300,3 +300,10 @@ void command_process_destroy_cell(cell_t *cell, connection_t *conn) {
   circuit_free(circ);
 }
 
+/*
+  Local Variables:
+  mode:c
+  indent-tabs-mode:nil
+  c-basic-offset:2
+  End:
+*/
diff --git a/src/or/config.c b/src/or/config.c
index 1e96ede163..d8828bdd3b 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -369,3 +369,10 @@ int getconfig(int argc, char **argv, or_options_t *options) {
   return result;
 }
 
+/*
+  Local Variables:
+  mode:c
+  indent-tabs-mode:nil
+  c-basic-offset:2
+  End:
+*/
diff --git a/src/or/connection.c b/src/or/connection.c
index 97d5e112f6..e2fc511b02 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -904,3 +904,10 @@ int connection_process_cell_from_inbuf(connection_t *conn) {
   return connection_process_inbuf(conn); /* process the remainder of the buffer */
 }
 
+/*
+  Local Variables:
+  mode:c
+  indent-tabs-mode:nil
+  c-basic-offset:2
+  End:
+*/
diff --git a/src/or/connection_ap.c b/src/or/connection_ap.c
index 787f77943b..4983af6d11 100644
--- a/src/or/connection_ap.c
+++ b/src/or/connection_ap.c
@@ -539,3 +539,11 @@ int connection_ap_handle_listener_read(connection_t *conn) {
   log(LOG_NOTICE,"AP: Received a connection request. Waiting for socksinfo.");
   return connection_handle_listener_read(conn, CONN_TYPE_AP, AP_CONN_STATE_SOCKS_WAIT);
 } 
+
+/*
+  Local Variables:
+  mode:c
+  indent-tabs-mode:nil
+  c-basic-offset:2
+  End:
+*/
diff --git a/src/or/connection_exit.c b/src/or/connection_exit.c
index 2c2ffe1b66..45f8c6de7f 100644
--- a/src/or/connection_exit.c
+++ b/src/or/connection_exit.c
@@ -389,3 +389,10 @@ int connection_exit_connect(connection_t *conn) {
   return connection_exit_send_connected(conn);
 }
 
+/*
+  Local Variables:
+  mode:c
+  indent-tabs-mode:nil
+  c-basic-offset:2
+  End:
+*/
diff --git a/src/or/connection_op.c b/src/or/connection_op.c
index 08ccb3da0f..5a32c9ef32 100644
--- a/src/or/connection_op.c
+++ b/src/or/connection_op.c
@@ -121,3 +121,10 @@ int connection_op_handle_listener_read(connection_t *conn) {
   return connection_handle_listener_read(conn, CONN_TYPE_OP, OP_CONN_STATE_AWAITING_KEYS);
 } 
 
+/*
+  Local Variables:
+  mode:c
+  indent-tabs-mode:nil
+  c-basic-offset:2
+  End:
+*/
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index ed3bd8be9d..8a7fd9a90a 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -740,3 +740,10 @@ int connection_or_handle_listener_read(connection_t *conn) {
   return connection_handle_listener_read(conn, CONN_TYPE_OR, OR_CONN_STATE_SERVER_AUTH_WAIT);
 }
 
+/*
+  Local Variables:
+  mode:c
+  indent-tabs-mode:nil
+  c-basic-offset:2
+  End:
+*/
diff --git a/src/or/directory.c b/src/or/directory.c
index 28344934b3..e604445fec 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -293,3 +293,10 @@ int connection_dir_handle_listener_read(connection_t *conn) {
   return connection_handle_listener_read(conn, CONN_TYPE_DIR, DIR_CONN_STATE_COMMAND_WAIT);
 } 
 
+/*
+  Local Variables:
+  mode:c
+  indent-tabs-mode:nil
+  c-basic-offset:2
+  End:
+*/
diff --git a/src/or/dns.c b/src/or/dns.c
index 0de83775f5..22c36adee6 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -568,3 +568,10 @@ static int dns_found_answer(char *question, uint32_t answer, uint32_t valid) {
   return 0;
 }
 
+/*
+  Local Variables:
+  mode:c
+  indent-tabs-mode:nil
+  c-basic-offset:2
+  End:
+*/
diff --git a/src/or/main.c b/src/or/main.c
index 2421a804f7..3aaeb5b595 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -626,7 +626,7 @@ void daemonize() {
   fclose(stderr);
 }
 
-int main(int argc, char *argv[]) {
+int tor_main(int argc, char *argv[]) {
   int retval = 0;
 
   if(getconfig(argc,argv,&options))
@@ -657,3 +657,10 @@ int main(int argc, char *argv[]) {
   return retval;
 }
 
+/*
+  Local Variables:
+  mode:c
+  indent-tabs-mode:nil
+  c-basic-offset:2
+  End:
+*/
diff --git a/src/or/onion.c b/src/or/onion.c
index 514473b7bf..e865533110 100644
--- a/src/or/onion.c
+++ b/src/or/onion.c
@@ -809,3 +809,10 @@ static int find_tracked_onion(unsigned char *onion, uint32_t onionlen) {
   return 0;
 }
 
+/*
+  Local Variables:
+  mode:c
+  indent-tabs-mode:nil
+  c-basic-offset:2
+  End:
+*/
diff --git a/src/or/or.h b/src/or/or.h
index 2c1a2e008f..eebac263ba 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -775,3 +775,11 @@ int router_get_list_from_file(char *routerfile);
 int router_get_list_from_string(char *s);
 
 #endif
+
+/*
+  Local Variables:
+  mode:c
+  indent-tabs-mode:nil
+  c-basic-offset:2
+  End:
+*/
diff --git a/src/or/routers.c b/src/or/routers.c
index 9a31b5d9ed..486e8046a7 100644
--- a/src/or/routers.c
+++ b/src/or/routers.c
@@ -532,3 +532,10 @@ void test_write_pkey(crypto_pk_env_t *pkey) {
 }
 #endif
 
+/*
+  Local Variables:
+  mode:c
+  indent-tabs-mode:nil
+  c-basic-offset:2
+  End:
+*/
diff --git a/src/or/test.c b/src/or/test.c
new file mode 100644
index 0000000000..294dfddea2
--- /dev/null
+++ b/src/or/test.c
@@ -0,0 +1,15 @@
+/* Copyright 2001,2002 Roger Dingledine, Matej Pfajfar. */
+/* See LICENSE for licensing information */
+/* $Id$ */
+
+int main(int c, char**v) {
+  return 0;
+}
+
+/*
+  Local Variables:
+  mode:c
+  indent-tabs-mode:nil
+  c-basic-offset:2
+  End:
+*/
diff --git a/src/or/tor_main.c b/src/or/tor_main.c
new file mode 100644
index 0000000000..aee77b9956
--- /dev/null
+++ b/src/or/tor_main.c
@@ -0,0 +1,18 @@
+/* Copyright 2001,2002 Roger Dingledine, Matej Pfajfar. */
+/* See LICENSE for licensing information */
+/* $Id$ */
+
+int tor_main(int argc, char *argv[]);
+
+int main(int argc, char *argv[]) 
+{
+  return tor_main(argc, argv);
+}
+
+/*
+  Local Variables:
+  mode:c
+  indent-tabs-mode:nil
+  c-basic-offset:2
+  End:
+*/
-- 
GitLab