summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/HPM.c32
-rw-r--r--src/common/HPM.h4
-rw-r--r--src/common/HPMi.h10
-rw-r--r--src/common/Makefile.in17
-rw-r--r--src/common/atomic.h4
-rw-r--r--src/common/conf.c4
-rw-r--r--src/common/conf.h4
-rw-r--r--src/common/console.c35
-rw-r--r--src/common/console.h12
-rw-r--r--src/common/core.c49
-rw-r--r--src/common/core.h6
-rw-r--r--src/common/db.c12
-rw-r--r--src/common/db.h4
-rw-r--r--src/common/des.c2
-rw-r--r--src/common/des.h2
-rw-r--r--src/common/ers.c10
-rw-r--r--src/common/ers.h2
-rw-r--r--src/common/grfio.c16
-rw-r--r--src/common/malloc.c14
-rw-r--r--src/common/malloc.h2
-rw-r--r--src/common/mapindex.c12
-rw-r--r--src/common/mapindex.h4
-rw-r--r--src/common/md5calc.c4
-rw-r--r--src/common/mmo.h8
-rw-r--r--src/common/mutex.c11
-rw-r--r--src/common/mutex.h2
-rw-r--r--src/common/nullpo.c4
-rw-r--r--src/common/nullpo.h2
-rw-r--r--src/common/random.c10
-rw-r--r--src/common/random.h2
-rw-r--r--src/common/showmsg.c14
-rw-r--r--src/common/showmsg.h10
-rw-r--r--src/common/socket.c20
-rw-r--r--src/common/socket.h6
-rw-r--r--src/common/spinlock.h8
-rw-r--r--src/common/sql.c17
-rw-r--r--src/common/sql.h4
-rw-r--r--src/common/strlib.c8
-rw-r--r--src/common/strlib.h4
-rw-r--r--src/common/sysinfo.c11
-rw-r--r--src/common/sysinfo.h2
-rw-r--r--src/common/thread.c11
-rw-r--r--src/common/thread.h2
-rw-r--r--src/common/timer.c22
-rw-r--r--src/common/timer.h2
-rw-r--r--src/common/utils.c30
-rw-r--r--src/common/utils.h4
47 files changed, 236 insertions, 239 deletions
diff --git a/src/common/HPM.c b/src/common/HPM.c
index 346748cfe..2b508e233 100644
--- a/src/common/HPM.c
+++ b/src/common/HPM.c
@@ -3,28 +3,28 @@
#define HERCULES_CORE
-#include "../config/core.h" // CONSOLE_INPUT
+#include "config/core.h" // CONSOLE_INPUT
#include "HPM.h"
+#include "common/cbasetypes.h"
+#include "common/conf.h"
+#include "common/console.h"
+#include "common/core.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/sql.h"
+#include "common/strlib.h"
+#include "common/sysinfo.h"
+#include "common/timer.h"
+#include "common/utils.h"
+#include "common/nullpo.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "../common/cbasetypes.h"
-#include "../common/conf.h"
-#include "../common/console.h"
-#include "../common/core.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/sql.h"
-#include "../common/strlib.h"
-#include "../common/sysinfo.h"
-#include "../common/timer.h"
-#include "../common/utils.h"
-#include "../common/nullpo.h"
-
#ifndef WIN32
# include <unistd.h>
#endif
diff --git a/src/common/HPM.h b/src/common/HPM.h
index e99b0f2ae..1358f19dc 100644
--- a/src/common/HPM.h
+++ b/src/common/HPM.h
@@ -8,8 +8,8 @@
#error You should never include HPM.h from a plugin.
#endif
-#include "../common/HPMi.h"
-#include "../common/cbasetypes.h"
+#include "common/HPMi.h"
+#include "common/cbasetypes.h"
#ifdef WIN32
#ifndef WIN32_LEAN_AND_MEAN
diff --git a/src/common/HPMi.h b/src/common/HPMi.h
index 10cf4fd9f..b700c1b73 100644
--- a/src/common/HPMi.h
+++ b/src/common/HPMi.h
@@ -4,10 +4,10 @@
#ifndef COMMON_HPMI_H
#define COMMON_HPMI_H
-#include "../common/cbasetypes.h"
-#include "../common/console.h"
-#include "../common/core.h"
-#include "../common/sql.h"
+#include "common/cbasetypes.h"
+#include "common/console.h"
+#include "common/core.h"
+#include "common/sql.h"
struct script_state;
struct AtCommandInfo;
@@ -21,7 +21,7 @@ struct map_session_data;
#endif
/* after */
-#include "../common/showmsg.h"
+#include "common/showmsg.h"
#define HPM_VERSION "1.0"
#define HPM_ADDCONF_LENGTH 40
diff --git a/src/common/Makefile.in b/src/common/Makefile.in
index 5dfdd35bd..f6f993165 100644
--- a/src/common/Makefile.in
+++ b/src/common/Makefile.in
@@ -6,17 +6,20 @@
CONFIG_D = ../config
CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
-LIBCONFIG_D = ../../3rdparty/libconfig
+COMMON_INCLUDE = -I..
+
+THIRDPARTY_D = ../../3rdparty
+THIRDPARTY_INCLUDE = -I$(THIRDPARTY_D)
+
+LIBCONFIG_D = $(THIRDPARTY_D)/libconfig
LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \
scanner.o strbuf.o)
LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \
scanctx.h scanner.h strbuf.h wincompat.h)
-LIBCONFIG_INCLUDE = -I$(LIBCONFIG_D)
-MT19937AR_D = ../../3rdparty/mt19937ar
+MT19937AR_D = $(THIRDPARTY_D)/mt19937ar
MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o
MT19937AR_H = $(MT19937AR_D)/mt19937ar.h
-MT19937AR_INCLUDE = -I$(MT19937AR_D)
COMMON_SHARED_C = conf.c db.c des.c ers.c grfio.c HPM.c mapindex.c md5calc.c \
mutex.c nullpo.c random.c showmsg.c strlib.c sysinfo.c \
@@ -116,15 +119,15 @@ obj_all/sysinfo.o: sysinfo.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_
obj_all/%.o: %.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_all
@echo " CC $<"
- @$(CC) @CFLAGS@ @DEFS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
obj_all/mini%.o: %.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_all
@echo " CC $<"
- @$(CC) @CFLAGS@ @DEFS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) -DMINICORE @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) -DMINICORE @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
obj_sql/%.o: %.c $(COMMON_H) $(COMMON_SQL_H) $(CONFIG_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_sql
@echo " CC $<"
- @$(CC) @CFLAGS@ @DEFS@ $(LIBCONFIG_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing object files
$(MT19937AR_OBJ):
diff --git a/src/common/atomic.h b/src/common/atomic.h
index a42dfad1c..c1ea2aa48 100644
--- a/src/common/atomic.h
+++ b/src/common/atomic.h
@@ -14,10 +14,10 @@
//
// our Abstraction is fully API-Compatible to Microsoft's implementation @ NT5.0+
//
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
#if defined(_MSC_VER)
-#include "../common/winapi.h"
+#include "common/winapi.h"
// This checks if C/C++ Compiler Version is 18.00
#if _MSC_VER < 1800
diff --git a/src/common/conf.c b/src/common/conf.c
index c974decf9..cb0194c3a 100644
--- a/src/common/conf.c
+++ b/src/common/conf.c
@@ -6,9 +6,9 @@
#include "conf.h"
-#include "../../3rdparty/libconfig/libconfig.h"
+#include "common/showmsg.h" // ShowError
-#include "../common/showmsg.h" // ShowError
+#include <libconfig/libconfig.h>
/* interface source */
struct libconfig_interface libconfig_s;
diff --git a/src/common/conf.h b/src/common/conf.h
index bd97d5c1e..771725cf4 100644
--- a/src/common/conf.h
+++ b/src/common/conf.h
@@ -5,9 +5,9 @@
#ifndef COMMON_CONF_H
#define COMMON_CONF_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
-#include "../../3rdparty/libconfig/libconfig.h"
+#include "libconfig/libconfig.h"
/**
* The libconfig interface -- specially for plugins, but we enforce it throughout the core to be consistent
diff --git a/src/common/console.c b/src/common/console.c
index 1eba48fa2..95d1e69fe 100644
--- a/src/common/console.c
+++ b/src/common/console.c
@@ -4,34 +4,33 @@
#define HERCULES_CORE
-#include "../config/core.h" // CONSOLE_INPUT, MAX_CONSOLE_INPUT
+#include "config/core.h" // CONSOLE_INPUT, MAX_CONSOLE_INPUT
#include "console.h"
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "../common/cbasetypes.h"
-#include "../common/core.h"
-#include "../common/showmsg.h"
-#include "../common/sysinfo.h"
+#include "common/cbasetypes.h"
+#include "common/core.h"
+#include "common/showmsg.h"
+#include "common/sysinfo.h"
#ifndef MINICORE
-# include "../common/atomic.h"
-# include "../common/ers.h"
-# include "../common/malloc.h"
-# include "../common/mutex.h"
-# include "../common/spinlock.h"
-# include "../common/sql.h"
-# include "../common/strlib.h"
-# include "../common/thread.h"
-# include "../common/timer.h"
+# include "common/atomic.h"
+# include "common/ers.h"
+# include "common/malloc.h"
+# include "common/mutex.h"
+# include "common/spinlock.h"
+# include "common/sql.h"
+# include "common/strlib.h"
+# include "common/thread.h"
+# include "common/timer.h"
#endif
+#include <stdio.h>
+#include <stdlib.h>
#if !defined(WIN32)
# include <sys/time.h>
# include <unistd.h>
#else
-# include "../common/winapi.h" // Console close event handling
+# include "common/winapi.h" // Console close event handling
# ifdef CONSOLE_INPUT
# include <conio.h> /* _kbhit() */
# endif
diff --git a/src/common/console.h b/src/common/console.h
index 3d3c8e9dd..643edc3d9 100644
--- a/src/common/console.h
+++ b/src/common/console.h
@@ -4,13 +4,13 @@
#ifndef COMMON_CONSOLE_H
#define COMMON_CONSOLE_H
-#include "../config/core.h" // MAX_CONSOLE_INPUT
+#include "config/core.h" // MAX_CONSOLE_INPUT
-#include "../common/cbasetypes.h"
-#include "../common/mutex.h"
-#include "../common/spinlock.h"
-#include "../common/sql.h"
-#include "../common/thread.h"
+#include "common/cbasetypes.h"
+#include "common/mutex.h"
+#include "common/spinlock.h"
+#include "common/sql.h"
+#include "common/thread.h"
/**
* Queue Max
diff --git a/src/common/core.c b/src/common/core.c
index ea028002a..5a410add1 100644
--- a/src/common/core.c
+++ b/src/common/core.c
@@ -4,41 +4,40 @@
#define HERCULES_CORE
-#include "../config/core.h"
+#include "config/core.h"
#include "core.h"
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "../common/cbasetypes.h"
-#include "../common/console.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/sysinfo.h"
-#include "../common/nullpo.h"
+#include "common/cbasetypes.h"
+#include "common/console.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/strlib.h"
+#include "common/sysinfo.h"
+#include "common/nullpo.h"
#ifndef MINICORE
-# include "../common/HPM.h"
-# include "../common/conf.h"
-# include "../common/db.h"
-# include "../common/ers.h"
-# include "../common/socket.h"
-# include "../common/sql.h"
-# include "../common/thread.h"
-# include "../common/timer.h"
-# include "../common/utils.h"
+# include "common/HPM.h"
+# include "common/conf.h"
+# include "common/db.h"
+# include "common/ers.h"
+# include "common/socket.h"
+# include "common/sql.h"
+# include "common/thread.h"
+# include "common/timer.h"
+# include "common/utils.h"
#endif
#ifndef _WIN32
# include <unistd.h>
#else
-# include "../common/winapi.h" // Console close event handling
+# include "common/winapi.h" // Console close event handling
#endif
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
/// Called when a terminate signal is received.
void (*shutdown_callback)(void) = NULL;
diff --git a/src/common/core.h b/src/common/core.h
index 827d345ba..d96e8506a 100644
--- a/src/common/core.h
+++ b/src/common/core.h
@@ -5,9 +5,9 @@
#ifndef COMMON_CORE_H
#define COMMON_CORE_H
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
-#include "../common/mmo.h"
+#include "common/cbasetypes.h"
+#include "common/db.h"
+#include "common/mmo.h"
/* so that developers with --enable-debug can raise signals from any section of the code they'd like */
#ifdef DEBUG
diff --git a/src/common/db.c b/src/common/db.c
index 69e2333a9..5063425e6 100644
--- a/src/common/db.c
+++ b/src/common/db.c
@@ -72,15 +72,15 @@
#include "db.h"
+#include "common/ers.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/showmsg.h"
+#include "common/strlib.h"
+
#include <stdio.h>
#include <stdlib.h>
-#include "../common/ers.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-
struct db_interface DB_s;
/*****************************************************************************\
diff --git a/src/common/db.h b/src/common/db.h
index 4883489d7..f75cbd8dc 100644
--- a/src/common/db.h
+++ b/src/common/db.h
@@ -42,9 +42,9 @@
#ifndef COMMON_DB_H
#define COMMON_DB_H
-#include <stdarg.h>
+#include "common/cbasetypes.h"
-#include "../common/cbasetypes.h"
+#include <stdarg.h>
/*****************************************************************************\
* (1) Section with public typedefs, enums, unions, structures and defines. *
diff --git a/src/common/des.c b/src/common/des.c
index 89a920bc9..0a702bfdf 100644
--- a/src/common/des.c
+++ b/src/common/des.c
@@ -5,7 +5,7 @@
#include "des.h"
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
/// DES (Data Encryption Standard) algorithm, modified version.
/// @see http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=5099.
diff --git a/src/common/des.h b/src/common/des.h
index 9e6aec4fd..6f54b36f2 100644
--- a/src/common/des.h
+++ b/src/common/des.h
@@ -3,7 +3,7 @@
#ifndef COMMON_DES_H
#define COMMON_DES_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
/// One 64-bit block.
typedef struct BIT64 { uint8_t b[8]; } BIT64;
diff --git a/src/common/ers.c b/src/common/ers.c
index 52cba0fe5..91fc6ccfb 100644
--- a/src/common/ers.c
+++ b/src/common/ers.c
@@ -44,14 +44,14 @@
#include "ers.h"
+#include "common/cbasetypes.h"
+#include "common/malloc.h" // CREATE, RECREATE, aMalloc, aFree
+#include "common/nullpo.h"
+#include "common/showmsg.h" // ShowMessage, ShowError, ShowFatalError, CL_BOLD, CL_NORMAL
+
#include <stdlib.h>
#include <string.h>
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h" // CREATE, RECREATE, aMalloc, aFree
-#include "../common/nullpo.h"
-#include "../common/showmsg.h" // ShowMessage, ShowError, ShowFatalError, CL_BOLD, CL_NORMAL
-
#ifndef DISABLE_ERS
#define ERS_BLOCK_ENTRIES 2048
diff --git a/src/common/ers.h b/src/common/ers.h
index 0117237d7..09290186e 100644
--- a/src/common/ers.h
+++ b/src/common/ers.h
@@ -40,7 +40,7 @@
#ifndef COMMON_ERS_H
#define COMMON_ERS_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
/*****************************************************************************\
* (1) All public parts of the Entry Reusage System. *
diff --git a/src/common/grfio.c b/src/common/grfio.c
index 41a888267..00d6ffc89 100644
--- a/src/common/grfio.c
+++ b/src/common/grfio.c
@@ -6,20 +6,20 @@
#include "grfio.h"
+#include "common/cbasetypes.h"
+#include "common/des.h"
+#include "common/malloc.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/strlib.h"
+#include "common/utils.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <zlib.h>
-#include "../common/cbasetypes.h"
-#include "../common/des.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/utils.h"
-
//----------------------------
// file entry table struct
//----------------------------
diff --git a/src/common/malloc.c b/src/common/malloc.c
index c647dc18f..008fd0930 100644
--- a/src/common/malloc.c
+++ b/src/common/malloc.c
@@ -6,15 +6,15 @@
#include "malloc.h"
+#include "common/core.h"
+#include "common/showmsg.h"
+#include "common/sysinfo.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
-#include "../common/core.h"
-#include "../common/showmsg.h"
-#include "../common/sysinfo.h"
-
struct malloc_interface iMalloc_s;
////////////// Memory Libraries //////////////////
@@ -22,7 +22,7 @@ struct malloc_interface iMalloc_s;
#if defined(MEMWATCH)
# include <string.h>
-# include "memwatch.h"
+# include <memwatch.h>
# define MALLOC(n,file,line,func) mwMalloc((n),(file),(line))
# define CALLOC(m,n,file,line,func) mwCalloc((m),(n),(file),(line))
# define REALLOC(p,n,file,line,func) mwRealloc((p),(n),(file),(line))
@@ -36,7 +36,7 @@ struct malloc_interface iMalloc_s;
# include <string.h>
# include <stdlib.h>
-# include "dmalloc.h"
+# include <dmalloc.h>
# define MALLOC(n,file,line,func) dmalloc_malloc((file),(line),(n),DMALLOC_FUNC_MALLOC,0,0)
# define CALLOC(m,n,file,line,func) dmalloc_malloc((file),(line),(m)*(n),DMALLOC_FUNC_CALLOC,0,0)
# define REALLOC(p,n,file,line,func) dmalloc_realloc((file),(line),(p),(n),DMALLOC_FUNC_REALLOC,0)
@@ -48,7 +48,7 @@ struct malloc_interface iMalloc_s;
#elif defined(GCOLLECT)
-# include "gc.h"
+# include <gc.h>
# ifdef GC_ADD_CALLER
# define RETURN_ADDR 0,
# else
diff --git a/src/common/malloc.h b/src/common/malloc.h
index 7ed2fb19c..20260de84 100644
--- a/src/common/malloc.h
+++ b/src/common/malloc.h
@@ -4,7 +4,7 @@
#ifndef COMMON_MALLOC_H
#define COMMON_MALLOC_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
#define ALC_MARK __FILE__, __LINE__, __func__
diff --git a/src/common/mapindex.c b/src/common/mapindex.c
index e07ccd679..42b46246d 100644
--- a/src/common/mapindex.c
+++ b/src/common/mapindex.c
@@ -6,16 +6,16 @@
#include "mapindex.h"
+#include "common/db.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/showmsg.h"
+#include "common/strlib.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "../common/db.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-
/* mapindex.c interface source */
struct mapindex_interface mapindex_s;
diff --git a/src/common/mapindex.h b/src/common/mapindex.h
index 87a275f57..408078ceb 100644
--- a/src/common/mapindex.h
+++ b/src/common/mapindex.h
@@ -5,8 +5,8 @@
#ifndef COMMON_MAPINDEX_H
#define COMMON_MAPINDEX_H
-#include "../common/db.h"
-#include "../common/mmo.h"
+#include "common/db.h"
+#include "common/mmo.h"
#define MAX_MAPINDEX 2000
diff --git a/src/common/md5calc.c b/src/common/md5calc.c
index 7b31a38d6..e27b64504 100644
--- a/src/common/md5calc.c
+++ b/src/common/md5calc.c
@@ -10,12 +10,12 @@
#include "md5calc.h"
+#include "common/random.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "../common/random.h"
-
#ifndef UINT_MAX
#define UINT_MAX 4294967295U
#endif
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 766ccf182..94a4b06da 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -5,11 +5,11 @@
#ifndef COMMON_MMO_H
#define COMMON_MMO_H
-#include <time.h>
+#include "config/core.h"
+#include "common/cbasetypes.h"
+#include "common/db.h"
-#include "../config/core.h"
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
+#include <time.h>
// server->client protocol version
// 0 - pre-?
diff --git a/src/common/mutex.c b/src/common/mutex.c
index 7307f5f15..59c04d4f0 100644
--- a/src/common/mutex.c
+++ b/src/common/mutex.c
@@ -5,20 +5,19 @@
#include "mutex.h"
-#include "../common/cbasetypes.h" // for WIN32
+#include "common/cbasetypes.h" // for WIN32
+#include "common/malloc.h"
+#include "common/showmsg.h"
+#include "common/timer.h"
#ifdef WIN32
-#include "../common/winapi.h"
+#include "common/winapi.h"
#else
#include <pthread.h>
#include <time.h>
#include <sys/time.h>
#endif
-#include "../common/malloc.h"
-#include "../common/showmsg.h"
-#include "../common/timer.h"
-
struct ramutex{
#ifdef WIN32
CRITICAL_SECTION hMutex;
diff --git a/src/common/mutex.h b/src/common/mutex.h
index fa8170c98..a70f0e8fd 100644
--- a/src/common/mutex.h
+++ b/src/common/mutex.h
@@ -4,7 +4,7 @@
#ifndef COMMON_MUTEX_H
#define COMMON_MUTEX_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
typedef struct ramutex ramutex; // Mutex
typedef struct racond racond; // Condition Var
diff --git a/src/common/nullpo.c b/src/common/nullpo.c
index d494822fa..a8980885f 100644
--- a/src/common/nullpo.c
+++ b/src/common/nullpo.c
@@ -6,6 +6,8 @@
#include "nullpo.h"
+#include "common/showmsg.h"
+
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
@@ -14,8 +16,6 @@
#include <execinfo.h>
#endif
-#include "../common/showmsg.h"
-
struct nullpo_interface nullpo_s;
/**
diff --git a/src/common/nullpo.h b/src/common/nullpo.h
index 573e351e0..a59c2ac2b 100644
--- a/src/common/nullpo.h
+++ b/src/common/nullpo.h
@@ -5,7 +5,7 @@
#ifndef COMMON_NULLPO_H
#define COMMON_NULLPO_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
// enabled by default on debug builds
#if defined(DEBUG) && !defined(NULLPO_CHECK)
diff --git a/src/common/random.c b/src/common/random.c
index 88d5748cf..70257fcb6 100644
--- a/src/common/random.c
+++ b/src/common/random.c
@@ -7,14 +7,14 @@
#include <time.h> // time
-#include <mt19937ar.h> // init_genrand, genrand_int32, genrand_res53
+#include "common/cbasetypes.h" // for WIN32
+#include "common/showmsg.h"
+#include "common/timer.h" // gettick
-#include "../common/cbasetypes.h" // for WIN32
-#include "../common/showmsg.h"
-#include "../common/timer.h" // gettick
+#include <mt19937ar/mt19937ar.h> // init_genrand, genrand_int32, genrand_res53
#if defined(WIN32)
-# include "../common/winapi.h"
+# include "common/winapi.h"
#elif defined(HAVE_GETPID) || defined(HAVE_GETTID)
# include <sys/types.h>
# include <unistd.h>
diff --git a/src/common/random.h b/src/common/random.h
index 0ca375d28..379e675b2 100644
--- a/src/common/random.h
+++ b/src/common/random.h
@@ -4,7 +4,7 @@
#ifndef COMMON_RANDOM_H
#define COMMON_RANDOM_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
#ifdef HERCULES_CORE
void rnd_init(void);
diff --git a/src/common/showmsg.c b/src/common/showmsg.c
index 0dd645eeb..3eb7ba0af 100644
--- a/src/common/showmsg.c
+++ b/src/common/showmsg.c
@@ -6,20 +6,20 @@
#include "showmsg.h"
+#include "common/cbasetypes.h"
+#include "common/core.h" //[Ind] - For SERVER_TYPE
+#include "common/strlib.h" // StringBuf
+
+#include <libconfig/libconfig.h>
+
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h> // atexit
#include <string.h>
#include <time.h>
-#include "../../3rdparty/libconfig/libconfig.h"
-
-#include "../common/cbasetypes.h"
-#include "../common/core.h" //[Ind] - For SERVER_TYPE
-#include "../common/strlib.h" // StringBuf
-
#ifdef WIN32
-# include "../common/winapi.h"
+# include "common/winapi.h"
#else // not WIN32
# include <unistd.h>
#endif // WIN32
diff --git a/src/common/showmsg.h b/src/common/showmsg.h
index 0624f1786..63e42ab57 100644
--- a/src/common/showmsg.h
+++ b/src/common/showmsg.h
@@ -5,16 +5,16 @@
#ifndef COMMON_SHOWMSG_H
#define COMMON_SHOWMSG_H
-#include <stdarg.h>
-
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
#ifdef HERCULES_CORE
-# include "../../3rdparty/libconfig/libconfig.h"
+# include <libconfig/libconfig.h>
#else
-# include "../common/HPMi.h"
+# include "common/HPMi.h"
#endif
+#include <stdarg.h>
+
// for help with the console colors look here:
// http://www.edoceo.com/liberum/?doc=printf-with-color
// some code explanation (used here):
diff --git a/src/common/socket.c b/src/common/socket.c
index 1b7f36f8b..aa575f1a6 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -4,26 +4,26 @@
#define HERCULES_CORE
-#include "../config/core.h" // SHOW_SERVER_STATS
+#include "config/core.h" // SHOW_SERVER_STATS
#define H_SOCKET_C
#include "socket.h"
#undef H_SOCKET_C
+#include "common/HPM.h"
+#include "common/cbasetypes.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/showmsg.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
-#include "../common/HPM.h"
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-
#ifdef WIN32
-# include "../common/winapi.h"
+# include "common/winapi.h"
#else
# include <arpa/inet.h>
# include <errno.h>
diff --git a/src/common/socket.h b/src/common/socket.h
index 6323a6862..94f86759b 100644
--- a/src/common/socket.h
+++ b/src/common/socket.h
@@ -5,12 +5,12 @@
#ifndef COMMON_SOCKET_H
#define COMMON_SOCKET_H
-#include <time.h>
+#include "common/cbasetypes.h"
-#include "../common/cbasetypes.h"
+#include <time.h>
#ifdef WIN32
-# include "../common/winapi.h"
+# include "common/winapi.h"
typedef long in_addr_t;
#else
# include <netinet/in.h>
diff --git a/src/common/spinlock.h b/src/common/spinlock.h
index 413067b68..811b239df 100644
--- a/src/common/spinlock.h
+++ b/src/common/spinlock.h
@@ -14,12 +14,12 @@
//
//
-#include "../common/atomic.h"
-#include "../common/cbasetypes.h"
-#include "../common/thread.h"
+#include "common/atomic.h"
+#include "common/cbasetypes.h"
+#include "common/thread.h"
#ifdef WIN32
-#include "../common/winapi.h"
+#include "common/winapi.h"
#endif
#ifdef WIN32
diff --git a/src/common/sql.c b/src/common/sql.c
index 4ca14d43b..9dc8144bf 100644
--- a/src/common/sql.c
+++ b/src/common/sql.c
@@ -6,19 +6,18 @@
#include "sql.h"
-#include <stdlib.h> // strtoul
-#include <string.h> // strlen/strnlen/memcpy/memset
-
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
+#include "common/cbasetypes.h"
+#include "common/malloc.h"
+#include "common/showmsg.h"
+#include "common/strlib.h"
+#include "common/timer.h"
#ifdef WIN32
-# include "../common/winapi.h" // Needed before mysql.h
+# include "common/winapi.h" // Needed before mysql.h
#endif
#include <mysql.h>
+#include <stdlib.h> // strtoul
+#include <string.h> // strlen/strnlen/memcpy/memset
void hercules_mysql_error_handler(unsigned int ecode);
diff --git a/src/common/sql.h b/src/common/sql.h
index c3598273e..d76b4f9d4 100644
--- a/src/common/sql.h
+++ b/src/common/sql.h
@@ -5,9 +5,9 @@
#ifndef COMMON_SQL_H
#define COMMON_SQL_H
-#include <stdarg.h>// va_list
+#include "common/cbasetypes.h"
-#include "../common/cbasetypes.h"
+#include <stdarg.h>// va_list
// Return codes
#define SQL_ERROR (-1)
diff --git a/src/common/strlib.c b/src/common/strlib.c
index b5fcff576..555f591e6 100644
--- a/src/common/strlib.c
+++ b/src/common/strlib.c
@@ -8,14 +8,14 @@
#include "strlib.h"
#undef H_STRLIB_C
+#include "common/cbasetypes.h"
+#include "common/malloc.h"
+#include "common/showmsg.h"
+
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h"
-#include "../common/showmsg.h"
-
#define J_MAX_MALLOC_SIZE 65535
struct strlib_interface strlib_s;
diff --git a/src/common/strlib.h b/src/common/strlib.h
index c687d9e17..a768ebff5 100644
--- a/src/common/strlib.h
+++ b/src/common/strlib.h
@@ -5,11 +5,11 @@
#ifndef COMMON_STRLIB_H
#define COMMON_STRLIB_H
+#include "common/cbasetypes.h"
+
#include <stdarg.h>
#include <string.h>
-#include "../common/cbasetypes.h"
-
#ifdef WIN32
#define HAVE_STRTOK_R
#define strtok_r(s,delim,save_ptr) strtok_r_((s),(delim),(save_ptr))
diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c
index 7edc5c72e..33ffc43f3 100644
--- a/src/common/sysinfo.c
+++ b/src/common/sysinfo.c
@@ -8,14 +8,13 @@
#include "sysinfo.h"
+#include "common/cbasetypes.h"
+#include "common/core.h"
+#include "common/malloc.h"
+#include "common/strlib.h"
+
#include <stdio.h> // fopen
#include <stdlib.h> // atoi
-
-#include "../common/cbasetypes.h"
-#include "../common/core.h"
-#include "../common/malloc.h"
-#include "../common/strlib.h"
-
#ifdef WIN32
# include <string.h> // strlen
# include <windows.h>
diff --git a/src/common/sysinfo.h b/src/common/sysinfo.h
index 8c8f6dbe6..3c0d01ca1 100644
--- a/src/common/sysinfo.h
+++ b/src/common/sysinfo.h
@@ -11,7 +11,7 @@
* cached at compile time)
*/
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
struct sysinfo_private;
diff --git a/src/common/thread.c b/src/common/thread.c
index 95212b4b0..9b9308d06 100644
--- a/src/common/thread.c
+++ b/src/common/thread.c
@@ -10,10 +10,13 @@
#include "thread.h"
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
+#include "common/malloc.h"
+#include "common/showmsg.h"
+#include "common/sysinfo.h" // sysinfo->getpagesize()
#ifdef WIN32
-# include "../common/winapi.h"
+# include "common/winapi.h"
# define __thread __declspec( thread )
#else
# include <pthread.h>
@@ -24,10 +27,6 @@
# include <unistd.h>
#endif
-#include "../common/malloc.h"
-#include "../common/showmsg.h"
-#include "../common/sysinfo.h" // sysinfo->getpagesize()
-
// When Compiling using MSC (on win32..) we know we have support in any case!
#ifdef _MSC_VER
#define HAS_TLS
diff --git a/src/common/thread.h b/src/common/thread.h
index f79eb77f9..36ea006b3 100644
--- a/src/common/thread.h
+++ b/src/common/thread.h
@@ -4,7 +4,7 @@
#ifndef COMMON_THREAD_H
#define COMMON_THREAD_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
typedef struct rAthread rAthread;
typedef void* (*rAthreadProc)(void*);
diff --git a/src/common/timer.c b/src/common/timer.c
index 45dbb9f50..42eb892ad 100644
--- a/src/common/timer.c
+++ b/src/common/timer.c
@@ -6,24 +6,24 @@
#include "timer.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
-#include "../common/malloc.h"
-#include "../common/showmsg.h"
-#include "../common/utils.h"
+#include "common/cbasetypes.h"
+#include "common/db.h"
+#include "common/malloc.h"
+#include "common/showmsg.h"
+#include "common/utils.h"
#ifdef WIN32
-# include "../common/winapi.h" // GetTickCount()
+# include "common/winapi.h" // GetTickCount()
#else
# include <sys/time.h> // struct timeval, gettimeofday()
# include <unistd.h>
#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
struct timer_interface timer_s;
// If the server can't handle processing thousands of monsters
diff --git a/src/common/timer.h b/src/common/timer.h
index 6e8a72389..46a036ec7 100644
--- a/src/common/timer.h
+++ b/src/common/timer.h
@@ -5,7 +5,7 @@
#ifndef COMMON_TIMER_H
#define COMMON_TIMER_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
#define DIFF_TICK(a,b) ((a)-(b))
#define DIFF_TICK32(a,b) ((int32)((a)-(b)))
diff --git a/src/common/utils.c b/src/common/utils.c
index ad68706ca..865b3575b 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -6,23 +6,16 @@
#include "utils.h"
-#include <math.h> // floor()
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h> // cache purposes [Ind/Hercules]
-
-#include "../common/cbasetypes.h"
-#include "../common/core.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
+#include "common/cbasetypes.h"
+#include "common/core.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
#ifdef WIN32
-# include "../common/winapi.h"
+# include "common/winapi.h"
# ifndef F_OK
# define F_OK 0x0
# endif /* F_OK */
@@ -32,6 +25,13 @@
# include <unistd.h>
#endif
+#include <math.h> // floor()
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h> // cache purposes [Ind/Hercules]
+
struct HCache_interface HCache_s;
/// Dumps given buffer into file pointed to by a handle.
diff --git a/src/common/utils.h b/src/common/utils.h
index e6102f184..57113aea0 100644
--- a/src/common/utils.h
+++ b/src/common/utils.h
@@ -5,11 +5,11 @@
#ifndef COMMON_UTILS_H
#define COMMON_UTILS_H
+#include "common/cbasetypes.h"
+
#include <stdio.h> // FILE*
#include <time.h>
-#include "../common/cbasetypes.h"
-
/* [HCache] 1-byte key to ensure our method is the latest, we can modify to ensure the method matches */
#define HCACHE_KEY 'k'