[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] All remaining files in src/common belong to the event loop.



commit 1e417b7275028a50227f57fb71d04c1837ec4b2c
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Thu Jul 5 15:13:44 2018 -0400

    All remaining files in src/common belong to the event loop.
---
 .gitignore                                   | 15 ++------
 Makefile.am                                  |  6 ++--
 src/common/Makefile.nmake                    | 28 ---------------
 src/common/include.am                        | 51 ----------------------------
 src/include.am                               |  2 +-
 src/lib/evloop/.may_include                  | 15 ++++++++
 src/{common => lib/evloop}/compat_libevent.c |  0
 src/{common => lib/evloop}/compat_libevent.h |  0
 src/lib/evloop/include.am                    | 26 ++++++++++++++
 src/{common => lib/evloop}/procmon.c         |  0
 src/{common => lib/evloop}/procmon.h         |  0
 src/{common => lib/evloop}/timers.c          |  0
 src/{common => lib/evloop}/timers.h          |  0
 src/{common => lib/evloop}/token_bucket.c    |  0
 src/{common => lib/evloop}/token_bucket.h    |  0
 src/{common => lib/evloop}/workqueue.c       |  0
 src/{common => lib/evloop}/workqueue.h       |  0
 src/test/include.am                          |  2 +-
 18 files changed, 47 insertions(+), 98 deletions(-)

diff --git a/.gitignore b/.gitignore
index b1de1d79d..711974450 100644
--- a/.gitignore
+++ b/.gitignore
@@ -132,19 +132,6 @@ uptime-*.json
 # /src/trace
 /src/trace/libor-trace.a
 
-# /src/common/
-/src/common/Makefile
-/src/common/Makefile.in
-/src/common/libor.a
-/src/common/libor-testing.a
-/src/common/libor.lib
-/src/common/libor-ctime.a
-/src/common/libor-ctime-testing.a
-/src/common/libor-ctime.lib
-/src/common/libor-event.a
-/src/common/libor-event-testing.a
-/src/common/libor-event.lib
-
 # /src/config/
 /src/config/Makefile
 /src/config/Makefile.in
@@ -173,6 +160,8 @@ uptime-*.json
 /src/lib/libtor-ctime-testing.a
 /src/lib/libtor-encoding.a
 /src/lib/libtor-encoding-testing.a
+/src/lib/libtor-evloop.a
+/src/lib/libtor-evloop-testing.a
 /src/lib/libtor-err.a
 /src/lib/libtor-err-testing.a
 /src/lib/libtor-fdio.a
diff --git a/Makefile.am b/Makefile.am
index fe2479a64..b2da55cda 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -40,7 +40,6 @@ endif
 
 # "Common" libraries used to link tor's utility code.
 TOR_UTIL_LIBS = \
-	src/common/libor.a \
 	src/lib/libtor-process.a \
 	src/lib/libtor-time.a \
 	src/lib/libtor-fs.a \
@@ -68,7 +67,6 @@ TOR_UTIL_LIBS = \
 # Variants of the above for linking the testing variant of tor (for coverage
 # and tests)
 TOR_UTIL_TESTING_LIBS = \
-	src/common/libor-testing.a \
 	src/lib/libtor-process-testing.a \
 	src/lib/libtor-time-testing.a \
 	src/lib/libtor-fs-testing.a \
@@ -112,9 +110,9 @@ TOR_CRYPTO_TESTING_LIBS = \
 TOR_INTERNAL_LIBS = \
 	src/or/libtor-app.a \
 	src/lib/libtor-compress.a \
+	src/lib/libtor-evloop.a \
 	$(TOR_CRYPTO_LIBS) \
 	$(TOR_UTIL_LIBS) \
-	src/common/libor-event.a \
 	src/trunnel/libor-trunnel.a \
 	src/lib/libtor-trace.a
 
@@ -123,9 +121,9 @@ TOR_INTERNAL_LIBS = \
 TOR_INTERNAL_TESTING_LIBS = \
 	src/or/libtor-app-testing.a \
 	src/lib/libtor-compress-testing.a \
+	src/lib/libtor-evloop-testing.a \
 	$(TOR_CRYPTO_TESTING_LIBS) \
 	$(TOR_UTIL_TESTING_LIBS) \
-	src/common/libor-event-testing.a \
 	src/trunnel/libor-trunnel-testing.a \
 	src/lib/libtor-trace.a
 
diff --git a/src/common/Makefile.nmake b/src/common/Makefile.nmake
deleted file mode 100644
index a1c819fff..000000000
--- a/src/common/Makefile.nmake
+++ /dev/null
@@ -1,28 +0,0 @@
-all: libor.lib libor-crypto.lib libor-event.lib
-
-CFLAGS = /O2 /MT /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common \
-    /I ..\ext
-
-LIBOR_OBJECTS = address.obj backtrace.obj compat.obj container.obj di_ops.obj \
-	log.obj memarea.obj mempool.obj procmon.obj sandbox.obj util.obj \
-	util_codedigest.obj
-
-LIBOR_CRYPTO_OBJECTS = aes.obj crypto.obj crypto_format.obj compress.obj compress_zlib.obj \
-	tortls.obj crypto_curve25519.obj curve25519-donna.obj
-
-LIBOR_EVENT_OBJECTS = compat_libevent.obj
-
-curve25519-donna.obj: ..\ext\curve25519_donna\curve25519-donna.c
-	$(CC) $(CFLAGS) /D inline=_inline /c ..\ext\curve25519_donna\curve25519-donna.c
-
-libor.lib: $(LIBOR_OBJECTS)
-	lib $(LIBOR_OBJECTS) /out:libor.lib
-
-libor-crypto.lib: $(LIBOR_CRYPTO_OBJECTS)
-	lib $(LIBOR_CRYPTO_OBJECTS) /out:libor-crypto.lib
-
-libor-event.lib:  $(LIBOR_EVENT_OBJECTS)
-	lib $(LIBOR_EVENT_OBJECTS) /out:libor-event.lib
-
-clean:
-	del *.obj *.lib libor*.lib
diff --git a/src/common/include.am b/src/common/include.am
deleted file mode 100644
index 8a2d2e114..000000000
--- a/src/common/include.am
+++ /dev/null
@@ -1,51 +0,0 @@
-
-noinst_LIBRARIES += \
-	src/common/libor.a \
-	src/common/libor-event.a
-
-if UNITTESTS_ENABLED
-noinst_LIBRARIES += \
-	src/common/libor-testing.a \
-	src/common/libor-event-testing.a
-endif
-
-EXTRA_DIST += src/common/Makefile.nmake
-
-LIBOR_A_SRC = \
-  src/common/token_bucket.c				\
-  src/common/workqueue.c				\
-  $(libor_extra_source)
-
-src/common/src_common_libor_testing_a-log.$(OBJEXT) \
-  src/common/log.$(OBJEXT): micro-revision.i
-
-LIBOR_EVENT_A_SRC = \
-	src/common/compat_libevent.c \
-	src/common/procmon.c         \
-	src/common/timers.c          \
-	src/ext/timeouts/timeout.c
-
-src_common_libor_a_SOURCES = $(LIBOR_A_SRC)
-src_common_libor_event_a_SOURCES = $(LIBOR_EVENT_A_SRC)
-
-if UNITTESTS_ENABLED
-src_common_libor_testing_a_SOURCES = $(LIBOR_A_SRC)
-src_common_libor_event_testing_a_SOURCES = $(LIBOR_EVENT_A_SRC)
-else
-src_common_libor_testing_a_SOURCES =
-src_common_libor_event_testing_a_SOURCES =
-endif
-
-src_common_libor_testing_a_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
-src_common_libor_event_testing_a_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
-src_common_libor_testing_a_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
-src_common_libor_event_testing_a_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
-
-COMMONHEADERS = \
-  src/common/compat_libevent.h			\
-  src/common/procmon.h				\
-  src/common/timers.h				\
-  src/common/token_bucket.h			\
-  src/common/workqueue.h
-
-noinst_HEADERS+= $(COMMONHEADERS)
diff --git a/src/include.am b/src/include.am
index 1ed07425a..950f9cc0f 100644
--- a/src/include.am
+++ b/src/include.am
@@ -8,6 +8,7 @@ include src/lib/container/include.am
 include src/lib/crypt_ops/include.am
 include src/lib/defs/include.am
 include src/lib/encoding/include.am
+include src/lib/evloop/include.am
 include src/lib/fdio/include.am
 include src/lib/fs/include.am
 include src/lib/include.libdonna.am
@@ -31,7 +32,6 @@ include src/lib/time/include.am
 include src/lib/tls/include.am
 include src/lib/trace/include.am
 include src/lib/wallclock/include.am
-include src/common/include.am
 include src/trunnel/include.am
 include src/or/include.am
 include src/rust/include.am
diff --git a/src/lib/evloop/.may_include b/src/lib/evloop/.may_include
new file mode 100644
index 000000000..205f41b38
--- /dev/null
+++ b/src/lib/evloop/.may_include
@@ -0,0 +1,15 @@
+orconfig.h
+
+lib/cc/*.h
+lib/crypt_ops/*.h
+lib/evloop/*.h
+lib/intmath/*.h
+lib/log/*.h
+lib/malloc/*.h
+lib/net/*.h
+lib/string/*.h
+lib/testsupport/*.h
+lib/thread/*.h
+lib/time/*.h
+
+src/ext/timeouts/timeout.c
diff --git a/src/common/compat_libevent.c b/src/lib/evloop/compat_libevent.c
similarity index 100%
rename from src/common/compat_libevent.c
rename to src/lib/evloop/compat_libevent.c
diff --git a/src/common/compat_libevent.h b/src/lib/evloop/compat_libevent.h
similarity index 100%
rename from src/common/compat_libevent.h
rename to src/lib/evloop/compat_libevent.h
diff --git a/src/lib/evloop/include.am b/src/lib/evloop/include.am
new file mode 100644
index 000000000..6b0076272
--- /dev/null
+++ b/src/lib/evloop/include.am
@@ -0,0 +1,26 @@
+
+noinst_LIBRARIES += src/lib/libtor-evloop.a
+
+if UNITTESTS_ENABLED
+noinst_LIBRARIES += src/lib/libtor-evloop-testing.a
+endif
+
+src_lib_libtor_evloop_a_SOURCES =			\
+	src/lib/evloop/compat_libevent.c		\
+	src/lib/evloop/procmon.c			\
+	src/lib/evloop/timers.c				\
+	src/lib/evloop/token_bucket.c			\
+	src/lib/evloop/workqueue.c
+
+
+src_lib_libtor_evloop_testing_a_SOURCES = \
+	$(src_lib_libtor_evloop_a_SOURCES)
+src_lib_libtor_evloop_testing_a_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
+src_lib_libtor_evloop_testing_a_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
+
+noinst_HEADERS +=					\
+	src/lib/evloop/compat_libevent.h		\
+	src/lib/evloop/procmon.h			\
+	src/lib/evloop/timers.h				\
+	src/lib/evloop/token_bucket.h			\
+	src/lib/evloop/workqueue.h
diff --git a/src/common/procmon.c b/src/lib/evloop/procmon.c
similarity index 100%
rename from src/common/procmon.c
rename to src/lib/evloop/procmon.c
diff --git a/src/common/procmon.h b/src/lib/evloop/procmon.h
similarity index 100%
rename from src/common/procmon.h
rename to src/lib/evloop/procmon.h
diff --git a/src/common/timers.c b/src/lib/evloop/timers.c
similarity index 100%
rename from src/common/timers.c
rename to src/lib/evloop/timers.c
diff --git a/src/common/timers.h b/src/lib/evloop/timers.h
similarity index 100%
rename from src/common/timers.h
rename to src/lib/evloop/timers.h
diff --git a/src/common/token_bucket.c b/src/lib/evloop/token_bucket.c
similarity index 100%
rename from src/common/token_bucket.c
rename to src/lib/evloop/token_bucket.c
diff --git a/src/common/token_bucket.h b/src/lib/evloop/token_bucket.h
similarity index 100%
rename from src/common/token_bucket.h
rename to src/lib/evloop/token_bucket.h
diff --git a/src/common/workqueue.c b/src/lib/evloop/workqueue.c
similarity index 100%
rename from src/common/workqueue.c
rename to src/lib/evloop/workqueue.c
diff --git a/src/common/workqueue.h b/src/lib/evloop/workqueue.h
similarity index 100%
rename from src/common/workqueue.h
rename to src/lib/evloop/workqueue.h
diff --git a/src/test/include.am b/src/test/include.am
index 827b780ce..a749ff143 100644
--- a/src/test/include.am
+++ b/src/test/include.am
@@ -271,7 +271,7 @@ src_test_test_workqueue_LDADD = \
 src_test_test_timers_CPPFLAGS = $(src_test_test_CPPFLAGS)
 src_test_test_timers_CFLAGS = $(src_test_test_CFLAGS)
 src_test_test_timers_LDADD = \
-	src/common/libor-event-testing.a \
+	src/lib/libtor-evloop-testing.a \
 	$(TOR_CRYPTO_TESTING_LIBS) \
 	$(TOR_UTIL_TESTING_LIBS) \
 	$(rust_ldadd) \



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits