aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-04-03 04:05:12 +0000
committerNick Mathewson <nickm@torproject.org>2004-04-03 04:05:12 +0000
commitb3c2b62a14cdc6511b148dc048463674453b52fd (patch)
treed6eae937e0cd1cd217dae34f1ccdcfc7557558d8
parentcb07e2ad2762cb2d7a4800b4b140459a0822e531 (diff)
downloadtor-b3c2b62a14cdc6511b148dc048463674453b52fd.tar
tor-b3c2b62a14cdc6511b148dc048463674453b52fd.tar.gz
Make "common" no longer depend on or.h
svn:r1466
-rw-r--r--src/common/crypto.c7
-rw-r--r--src/common/fakepoll.c3
-rw-r--r--src/common/log.c7
-rw-r--r--src/common/tortls.c1
-rw-r--r--src/common/util.c42
-rw-r--r--src/common/util.h10
-rw-r--r--src/or/dirserv.c7
-rw-r--r--src/or/or.h8
8 files changed, 73 insertions, 12 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 74f75bde3..a666d4abe 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -2,7 +2,7 @@
/* See LICENSE for licensing information */
/* $Id$ */
-#include "../or/or.h"
+#include "orconfig.h"
#include <string.h>
@@ -22,9 +22,14 @@
#include <stdio.h>
#include <limits.h>
+#ifdef HAVE_CTYPE_H
+#include <ctype.h>
+#endif
+
#include "crypto.h"
#include "log.h"
#include "aes.h"
+#include "util.h"
#ifdef MS_WINDOWS
#include <wincrypt.h>
diff --git a/src/common/fakepoll.c b/src/common/fakepoll.c
index 2f91c1b45..b60514a25 100644
--- a/src/common/fakepoll.c
+++ b/src/common/fakepoll.c
@@ -15,6 +15,9 @@
#ifdef HAVE_STRING_H
#include <string.h>
#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
#if _MSC_VER > 1300
#include <winsock2.h>
#include <ws2tcpip.h>
diff --git a/src/common/log.c b/src/common/log.c
index 4245fca5c..5e52cfff4 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -2,8 +2,13 @@
/* See LICENSE for licensing information */
/* $Id$ */
-#include "../or/or.h"
#include <stdarg.h>
+#include <assert.h>
+#include <stdlib.h>
+#include "orconfig.h"
+#include "./util.h"
+#include "./log.h"
+
#ifdef MS_WINDOWS
#define vsnprintf _vsnprintf
diff --git a/src/common/tortls.c b/src/common/tortls.c
index b3957b857..956692b83 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -11,6 +11,7 @@
#include "./tortls.h"
#include "./util.h"
#include "./log.h"
+#include <string.h>
/* Copied from or.h */
#define LEGAL_NICKNAME_CHARACTERS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
diff --git a/src/common/util.c b/src/common/util.c
index 7a9301efb..050340f18 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -2,12 +2,52 @@
/* See LICENSE for licensing information */
/* $Id$ */
-#include "../or/or.h"
+#include "orconfig.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include "util.h"
+#include "log.h"
+#include "crypto.h"
#include "../or/tree.h"
#ifdef HAVE_UNAME
#include <sys/utsname.h>
#endif
+#ifdef HAVE_CTYPE_H
+#include <ctype.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h> /* Must be included before sys/stat.h for Ultrix */
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_SYS_FCNTL_H
+#include <sys/fcntl.h>
+#endif
+#ifdef HAVE_PWD_H
+#include <pwd.h>
+#endif
+#ifdef HAVE_GRP_H
+#include <grp.h>
+#endif
/* used by inet_addr, not defined on solaris anywhere!? */
#ifndef INADDR_NONE
diff --git a/src/common/util.h b/src/common/util.h
index ceed25792..29689e64b 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -5,7 +5,12 @@
#ifndef __UTIL_H
#define __UTIL_H
-#include "../or/or.h"
+#include "orconfig.h"
+#include "torint.h"
+#include <stdio.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
#if _MSC_VER > 1300
#include <winsock2.h>
@@ -32,6 +37,9 @@
#define INLINE inline
#endif
+/* legal characters in a filename */
+#define CONFIG_LEGAL_FILENAME_CHARACTERS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_/"
+
size_t strlcat(char *dst, const char *src, size_t siz);
size_t strlcpy(char *dst, const char *src, size_t siz);
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 0f906d47a..152c1c2f3 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -494,3 +494,10 @@ size_t dirserv_get_directory(const char **directory)
return the_directory_len;
}
+/*
+ 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 0a8ecd46c..692c155a0 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -73,12 +73,6 @@
#ifdef HAVE_TIME_H
#include <time.h>
#endif
-#ifdef HAVE_PWD_H
-#include <pwd.h>
-#endif
-#ifdef HAVE_GRP_H
-#include <grp.h>
-#endif
#ifdef HAVE_WINSOCK_H
#include <winsock.h>
#endif
@@ -276,8 +270,6 @@
#define CELL_RELAY 3
#define CELL_DESTROY 4
-/* legal characters in a filename */
-#define CONFIG_LEGAL_FILENAME_CHARACTERS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_/"
/* legal characters in a nickname */
#define LEGAL_NICKNAME_CHARACTERS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"