diff --git a/GNUmakefile b/GNUmakefile index 3974cc7..a956cdf 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -21,6 +21,9 @@ ifeq ($(OS), Windows_NT) WINDOWS ?= YES endif + +CFLAGS += -I./src/ + ifeq ($(WINDOWS),YES) USE_BIGENDIAN := NO LDLIBS += -lws2_32 @@ -132,60 +135,60 @@ endif # Sources libuhub_SOURCES := \ - src/auth.c \ - src/commands.c \ - src/config.c \ - src/eventqueue.c \ - src/hub.c \ - src/hubevent.c \ - src/hubio.c \ - src/inf.c \ - src/ipcalc.c \ - src/list.c \ - src/log.c \ - src/memory.c \ - src/message.c \ - src/misc.c \ - src/netevent.c \ - src/network.c \ - src/rbtree.c \ - src/route.c \ - src/sid.c \ - src/tiger.c \ - src/user.c \ - src/usermanager.c + src/core/auth.c \ + src/core/commands.c \ + src/core/config.c \ + src/core/eventqueue.c \ + src/core/hub.c \ + src/core/hubevent.c \ + src/core/hubio.c \ + src/core/inf.c \ + src/util/ipcalc.c \ + src/util/list.c \ + src/util/log.c \ + src/util/memory.c \ + src/adc/message.c \ + src/util/misc.c \ + src/core/netevent.c \ + src/network/network.c \ + src/util/rbtree.c \ + src/core/route.c \ + src/adc/sid.c \ + src/util/tiger.c \ + src/core/user.c \ + src/core/usermanager.c -uhub_SOURCES := src/main.c +uhub_SOURCES := src/core/main.c adcrush_SOURCES := src/adcrush.c admin_SOURCES := src/admin.c uhub_HEADERS := \ - src/adcconst.h \ - src/auth.h \ - src/config.h \ - src/eventid.h \ - src/eventqueue.h \ - src/hub.h \ - src/hubevent.h \ - src/hubio.h \ - src/inf.h \ - src/ipcalc.h \ - src/list.h \ - src/log.h \ - src/memory.h \ - src/message.h \ - src/misc.h \ - src/netevent.h \ - src/network.h \ - src/rbtree.h \ - src/route.h \ - src/sid.h \ - src/tiger.h \ + src/adc/adcconst.h \ + src/core/auth.h \ + src/core/config.h \ + src/core/eventid.h \ + src/core/eventqueue.h \ + src/core/hub.h \ + src/core/hubevent.h \ + src/core/hubio.h \ + src/core/inf.h \ + src/util/ipcalc.h \ + src/util/list.h \ + src/util/log.h \ + src/util/memory.h \ + src/adc/message.h \ + src/util/misc.h \ + src/core/netevent.h \ + src/network/network.h \ + src/util/rbtree.h \ + src/core/route.h \ + src/adc/sid.h \ + src/util/tiger.h \ src/uhub.h \ - src/user.h \ - src/usermanager.h + src/core/user.h \ + src/core/usermanager.h autotest_SOURCES := \ autotest/test_message.tcc \ diff --git a/src/adcconst.h b/src/adc/adcconst.h similarity index 100% rename from src/adcconst.h rename to src/adc/adcconst.h diff --git a/src/message.c b/src/adc/message.c similarity index 100% rename from src/message.c rename to src/adc/message.c diff --git a/src/message.h b/src/adc/message.h similarity index 100% rename from src/message.h rename to src/adc/message.h diff --git a/src/sid.c b/src/adc/sid.c similarity index 100% rename from src/sid.c rename to src/adc/sid.c diff --git a/src/sid.h b/src/adc/sid.h similarity index 100% rename from src/sid.h rename to src/adc/sid.h diff --git a/src/auth.c b/src/core/auth.c similarity index 100% rename from src/auth.c rename to src/core/auth.c diff --git a/src/auth.h b/src/core/auth.h similarity index 100% rename from src/auth.h rename to src/core/auth.h diff --git a/src/commands.c b/src/core/commands.c similarity index 100% rename from src/commands.c rename to src/core/commands.c diff --git a/src/commands.h b/src/core/commands.h similarity index 100% rename from src/commands.h rename to src/core/commands.h diff --git a/src/config.c b/src/core/config.c similarity index 100% rename from src/config.c rename to src/core/config.c diff --git a/src/config.h b/src/core/config.h similarity index 100% rename from src/config.h rename to src/core/config.h diff --git a/src/eventid.h b/src/core/eventid.h similarity index 100% rename from src/eventid.h rename to src/core/eventid.h diff --git a/src/eventqueue.c b/src/core/eventqueue.c similarity index 100% rename from src/eventqueue.c rename to src/core/eventqueue.c diff --git a/src/eventqueue.h b/src/core/eventqueue.h similarity index 100% rename from src/eventqueue.h rename to src/core/eventqueue.h diff --git a/src/hub.c b/src/core/hub.c similarity index 100% rename from src/hub.c rename to src/core/hub.c diff --git a/src/hub.h b/src/core/hub.h similarity index 100% rename from src/hub.h rename to src/core/hub.h diff --git a/src/hubevent.c b/src/core/hubevent.c similarity index 100% rename from src/hubevent.c rename to src/core/hubevent.c diff --git a/src/hubevent.h b/src/core/hubevent.h similarity index 100% rename from src/hubevent.h rename to src/core/hubevent.h diff --git a/src/hubio.c b/src/core/hubio.c similarity index 100% rename from src/hubio.c rename to src/core/hubio.c diff --git a/src/hubio.h b/src/core/hubio.h similarity index 100% rename from src/hubio.h rename to src/core/hubio.h diff --git a/src/inf.c b/src/core/inf.c similarity index 100% rename from src/inf.c rename to src/core/inf.c diff --git a/src/inf.h b/src/core/inf.h similarity index 100% rename from src/inf.h rename to src/core/inf.h diff --git a/src/main.c b/src/core/main.c similarity index 100% rename from src/main.c rename to src/core/main.c diff --git a/src/netevent.c b/src/core/netevent.c similarity index 100% rename from src/netevent.c rename to src/core/netevent.c diff --git a/src/netevent.h b/src/core/netevent.h similarity index 100% rename from src/netevent.h rename to src/core/netevent.h diff --git a/src/route.c b/src/core/route.c similarity index 100% rename from src/route.c rename to src/core/route.c diff --git a/src/route.h b/src/core/route.h similarity index 100% rename from src/route.h rename to src/core/route.h diff --git a/src/user.c b/src/core/user.c similarity index 100% rename from src/user.c rename to src/core/user.c diff --git a/src/user.h b/src/core/user.h similarity index 100% rename from src/user.h rename to src/core/user.h diff --git a/src/usermanager.c b/src/core/usermanager.c similarity index 100% rename from src/usermanager.c rename to src/core/usermanager.c diff --git a/src/usermanager.h b/src/core/usermanager.h similarity index 100% rename from src/usermanager.h rename to src/core/usermanager.h diff --git a/src/network-epoll.c b/src/network/network-epoll.c similarity index 100% rename from src/network-epoll.c rename to src/network/network-epoll.c diff --git a/src/network-kqueue.c b/src/network/network-kqueue.c similarity index 100% rename from src/network-kqueue.c rename to src/network/network-kqueue.c diff --git a/src/network.c b/src/network/network.c similarity index 100% rename from src/network.c rename to src/network/network.c diff --git a/src/network.h b/src/network/network.h similarity index 100% rename from src/network.h rename to src/network/network.h diff --git a/src/adcrush.c b/src/tools/adcrush.c similarity index 100% rename from src/adcrush.c rename to src/tools/adcrush.c diff --git a/src/uhub.h b/src/uhub.h index fd812e8..60ae0e1 100644 --- a/src/uhub.h +++ b/src/uhub.h @@ -148,7 +148,7 @@ #define INET6_ADDRSTRLEN 46 #endif -#include "adcconst.h" +#include "adc/adcconst.h" #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MAX(a, b) ((a) > (b) ? (a) : (b)) @@ -157,28 +157,28 @@ extern "C" { #endif -#include "memory.h" -#include "misc.h" -#include "eventid.h" -#include "eventqueue.h" -#include "ipcalc.h" -#include "list.h" -#include "sid.h" -#include "network.h" -#include "netevent.h" -#include "hubio.h" -#include "auth.h" -#include "tiger.h" -#include "config.h" -#include "log.h" -#include "user.h" -#include "usermanager.h" -#include "message.h" -#include "route.h" -#include "hub.h" -#include "commands.h" -#include "inf.h" -#include "hubevent.h" +#include "util/memory.h" +#include "util/misc.h" +#include "core/eventid.h" +#include "core/eventqueue.h" +#include "util/ipcalc.h" +#include "util/list.h" +#include "adc/sid.h" +#include "network/network.h" +#include "core/netevent.h" +#include "core/hubio.h" +#include "core/auth.h" +#include "util/tiger.h" +#include "core/config.h" +#include "util/log.h" +#include "core/user.h" +#include "core/usermanager.h" +#include "adc/message.h" +#include "core/route.h" +#include "core/hub.h" +#include "core/commands.h" +#include "core/inf.h" +#include "core/hubevent.h" #ifdef __cplusplus } diff --git a/src/ipcalc.c b/src/util/ipcalc.c similarity index 100% rename from src/ipcalc.c rename to src/util/ipcalc.c diff --git a/src/ipcalc.h b/src/util/ipcalc.h similarity index 100% rename from src/ipcalc.h rename to src/util/ipcalc.h diff --git a/src/list.c b/src/util/list.c similarity index 100% rename from src/list.c rename to src/util/list.c diff --git a/src/list.h b/src/util/list.h similarity index 100% rename from src/list.h rename to src/util/list.h diff --git a/src/log.c b/src/util/log.c similarity index 100% rename from src/log.c rename to src/util/log.c diff --git a/src/log.h b/src/util/log.h similarity index 100% rename from src/log.h rename to src/util/log.h diff --git a/src/memory.c b/src/util/memory.c similarity index 100% rename from src/memory.c rename to src/util/memory.c diff --git a/src/memory.h b/src/util/memory.h similarity index 100% rename from src/memory.h rename to src/util/memory.h diff --git a/src/misc.c b/src/util/misc.c similarity index 100% rename from src/misc.c rename to src/util/misc.c diff --git a/src/misc.h b/src/util/misc.h similarity index 100% rename from src/misc.h rename to src/util/misc.h diff --git a/src/rbtree.c b/src/util/rbtree.c similarity index 100% rename from src/rbtree.c rename to src/util/rbtree.c diff --git a/src/rbtree.h b/src/util/rbtree.h similarity index 100% rename from src/rbtree.h rename to src/util/rbtree.h diff --git a/src/tiger.c b/src/util/tiger.c similarity index 100% rename from src/tiger.c rename to src/util/tiger.c diff --git a/src/tiger.h b/src/util/tiger.h similarity index 100% rename from src/tiger.h rename to src/util/tiger.h