summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-05-10 17:17:13 +0200
committerHaru <haru@dotalux.com>2014-05-10 17:17:13 +0200
commit0ab52ac65bdba93be94e4149e267698d31b41d72 (patch)
treee7f0cd0d549c8a04a35693cc98b6b27c06eeb2ed /src/char
parent94657284973f4037596bae468ebfbee5c217e02b (diff)
downloadhercules-0ab52ac65bdba93be94e4149e267698d31b41d72.tar.gz
hercules-0ab52ac65bdba93be94e4149e267698d31b41d72.tar.bz2
hercules-0ab52ac65bdba93be94e4149e267698d31b41d72.tar.xz
hercules-0ab52ac65bdba93be94e4149e267698d31b41d72.zip
Re-commit of "Fixed order of includes in all source files"
This reverts commit 94657284973f4037596bae468ebfbee5c217e02b.
Diffstat (limited to 'src/char')
-rw-r--r--src/char/char.c44
-rw-r--r--src/char/char.h1
-rw-r--r--src/char/int_auction.c25
-rw-r--r--src/char/int_elemental.c22
-rw-r--r--src/char/int_elemental.h2
-rw-r--r--src/char/int_guild.c24
-rw-r--r--src/char/int_guild.h3
-rw-r--r--src/char/int_homun.c21
-rw-r--r--src/char/int_homun.h2
-rw-r--r--src/char/int_mail.c20
-rw-r--r--src/char/int_mail.h3
-rw-r--r--src/char/int_mercenary.c22
-rw-r--r--src/char/int_mercenary.h4
-rw-r--r--src/char/int_party.c25
-rw-r--r--src/char/int_party.h2
-rw-r--r--src/char/int_pet.c22
-rw-r--r--src/char/int_quest.c22
-rw-r--r--src/char/int_storage.c22
-rw-r--r--src/char/inter.c43
-rw-r--r--src/char/inter.h5
-rw-r--r--src/char/pincode.c11
21 files changed, 195 insertions, 150 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 77e393c0d..6c0902644 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -2,7 +2,30 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
+#define HERCULES_CORE
+
+#include "../config/core.h" // CONSOLE_INPUT
+#include "char.h"
+
+#include <signal.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <time.h>
+
+#include "int_elemental.h"
+#include "int_guild.h"
+#include "int_homun.h"
+#include "int_mercenary.h"
+#include "int_party.h"
+#include "int_storage.h"
+#include "inter.h"
+#include "pincode.h"
+#include "../common/HPM.h"
#include "../common/cbasetypes.h"
+#include "../common/console.h"
#include "../common/core.h"
#include "../common/db.h"
#include "../common/malloc.h"
@@ -13,25 +36,6 @@
#include "../common/strlib.h"
#include "../common/timer.h"
#include "../common/utils.h"
-#include "../common/console.h"
-#include "../common/HPM.h"
-#include "int_guild.h"
-#include "int_homun.h"
-#include "int_mercenary.h"
-#include "int_elemental.h"
-#include "int_party.h"
-#include "int_storage.h"
-#include "char.h"
-#include "inter.h"
-#include "pincode.h"
-
-#include <sys/types.h>
-#include <time.h>
-#include <signal.h>
-#include <string.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
// private declarations
#define CHAR_CONF_NAME "conf/char-server.conf"
@@ -5497,7 +5501,7 @@ int do_init(int argc, char **argv) {
Sql_HerculesUpdateCheck(sql_handle);
#ifdef CONSOLE_INPUT
- console->setSQL(sql_handle);
+ console->input->setSQL(sql_handle);
#endif
ShowStatus("The char-server is "CL_GREEN"ready"CL_RESET" (Server is listening on the port %d).\n\n", char_port);
diff --git a/src/char/char.h b/src/char/char.h
index 2928929de..09a78f6b9 100644
--- a/src/char/char.h
+++ b/src/char/char.h
@@ -5,7 +5,6 @@
#ifndef _COMMON_CHAR_H_
#define _COMMON_CHAR_H_
-#include "../config/core.h"
#include "../common/core.h" // CORE_ST_LAST
#include "../common/db.h"
diff --git a/src/char/int_auction.c b/src/char/int_auction.c
index 924930867..886b5be26 100644
--- a/src/char/int_auction.c
+++ b/src/char/int_auction.c
@@ -2,22 +2,25 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/mmo.h"
-#include "../common/malloc.h"
+#define HERCULES_CORE
+
+#include "int_auction.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "char.h"
+#include "int_mail.h"
+#include "inter.h"
#include "../common/db.h"
+#include "../common/malloc.h"
+#include "../common/mmo.h"
#include "../common/showmsg.h"
#include "../common/socket.h"
-#include "../common/strlib.h"
#include "../common/sql.h"
+#include "../common/strlib.h"
#include "../common/timer.h"
-#include "char.h"
-#include "inter.h"
-#include "int_mail.h"
-#include "int_auction.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
static DBMap* auction_db_ = NULL; // int auction_id -> struct auction_data*
diff --git a/src/char/int_elemental.c b/src/char/int_elemental.c
index ed0c2a9ed..3a36e75a2 100644
--- a/src/char/int_elemental.c
+++ b/src/char/int_elemental.c
@@ -2,20 +2,24 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/mmo.h"
-#include "../common/malloc.h"
-#include "../common/strlib.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/utils.h"
-#include "../common/sql.h"
-#include "char.h"
-#include "inter.h"
+#define HERCULES_CORE
+
+#include "int_elemental.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "char.h"
+#include "inter.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/utils.h"
+
bool mapif_elemental_save(struct s_elemental* ele) {
bool flag = true;
diff --git a/src/char/int_elemental.h b/src/char/int_elemental.h
index c90891fc4..c869e6fc2 100644
--- a/src/char/int_elemental.h
+++ b/src/char/int_elemental.h
@@ -4,7 +4,7 @@
#ifndef _CHAR_INT_ELEMENTAL_H_
#define _CHAR_INT_ELEMENTAL_H_
-struct s_elemental;
+#include "../common/cbasetypes.h"
void inter_elemental_sql_init(void);
void inter_elemental_sql_final(void);
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index 895cbbb94..ffbe48e10 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -2,21 +2,25 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
+#define HERCULES_CORE
+
+#include "../config/core.h" // DBPATH
+#include "int_guild.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "char.h"
+#include "inter.h"
#include "../common/cbasetypes.h"
-#include "../common/mmo.h"
-#include "../common/malloc.h"
-#include "../common/socket.h"
#include "../common/db.h"
+#include "../common/malloc.h"
+#include "../common/mmo.h"
#include "../common/showmsg.h"
+#include "../common/socket.h"
#include "../common/strlib.h"
#include "../common/timer.h"
-#include "char.h"
-#include "inter.h"
-#include "int_guild.h"
-
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
#define GS_MEMBER_UNMODIFIED 0x00
#define GS_MEMBER_MODIFIED 0x01
diff --git a/src/char/int_guild.h b/src/char/int_guild.h
index 4eb7d310b..5e657ff06 100644
--- a/src/char/int_guild.h
+++ b/src/char/int_guild.h
@@ -20,9 +20,6 @@ enum {
GS_REMOVE = 0x8000,
};
-struct guild;
-struct guild_castle;
-
int inter_guild_parse_frommap(int fd);
int inter_guild_sql_init(void);
void inter_guild_sql_final(void);
diff --git a/src/char/int_homun.c b/src/char/int_homun.c
index 143277f05..795a6b927 100644
--- a/src/char/int_homun.c
+++ b/src/char/int_homun.c
@@ -2,20 +2,23 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/mmo.h"
-#include "../common/malloc.h"
-#include "../common/strlib.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/utils.h"
-#include "../common/sql.h"
-#include "char.h"
-#include "inter.h"
+#define HERCULES_CORE
+
+#include "int_homun.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "char.h"
+#include "inter.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/utils.h"
int inter_homunculus_sql_init(void)
{
diff --git a/src/char/int_homun.h b/src/char/int_homun.h
index 561dc848f..9477f4f03 100644
--- a/src/char/int_homun.h
+++ b/src/char/int_homun.h
@@ -4,6 +4,8 @@
#ifndef _CHAR_INT_HOMUN_H_
#define _CHAR_INT_HOMUN_H_
+#include "../common/cbasetypes.h"
+
struct s_homunculus;
int inter_homunculus_sql_init(void);
diff --git a/src/char/int_mail.c b/src/char/int_mail.c
index 826771676..86a36d59f 100644
--- a/src/char/int_mail.c
+++ b/src/char/int_mail.c
@@ -2,19 +2,23 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/mmo.h"
+#define HERCULES_CORE
+
+#include "int_mail.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "char.h"
+#include "inter.h"
#include "../common/malloc.h"
+#include "../common/mmo.h"
#include "../common/showmsg.h"
#include "../common/socket.h"
-#include "../common/strlib.h"
#include "../common/sql.h"
+#include "../common/strlib.h"
#include "../common/timer.h"
-#include "char.h"
-#include "inter.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
static int mail_fromsql(int char_id, struct mail_data* md)
{
diff --git a/src/char/int_mail.h b/src/char/int_mail.h
index 7c06cdc1f..824ba48a3 100644
--- a/src/char/int_mail.h
+++ b/src/char/int_mail.h
@@ -4,6 +4,9 @@
#ifndef _CHAR_INT_MAIL_H_
#define _CHAR_INT_MAIL_H_
+struct item;
+struct mail_message;
+
int inter_mail_parse_frommap(int fd);
void mail_sendmail(int send_id, const char* send_name, int dest_id, const char* dest_name, const char* title, const char* body, int zeny, struct item *item);
diff --git a/src/char/int_mercenary.c b/src/char/int_mercenary.c
index aecb3844a..1dffb656c 100644
--- a/src/char/int_mercenary.c
+++ b/src/char/int_mercenary.c
@@ -2,20 +2,24 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/mmo.h"
-#include "../common/malloc.h"
-#include "../common/strlib.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/utils.h"
-#include "../common/sql.h"
-#include "char.h"
-#include "inter.h"
+#define HERCULES_CORE
+
+#include "int_mercenary.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "char.h"
+#include "inter.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/utils.h"
+
bool mercenary_owner_fromsql(int char_id, struct mmo_charstatus *status)
{
char* data;
diff --git a/src/char/int_mercenary.h b/src/char/int_mercenary.h
index b614b8cf7..195a83b34 100644
--- a/src/char/int_mercenary.h
+++ b/src/char/int_mercenary.h
@@ -4,7 +4,9 @@
#ifndef _CHAR_INT_MERCENARY_H_
#define _CHAR_INT_MERCENARY_H_
-struct s_mercenary;
+#include "../common/cbasetypes.h"
+
+struct mmo_charstatus;
int inter_mercenary_sql_init(void);
void inter_mercenary_sql_final(void);
diff --git a/src/char/int_party.c b/src/char/int_party.c
index 7c328c452..3e4a743d6 100644
--- a/src/char/int_party.c
+++ b/src/char/int_party.c
@@ -2,23 +2,26 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
-#include "../common/mmo.h"
-#include "../common/db.h"
-#include "../common/malloc.h"
-#include "../common/strlib.h"
-#include "../common/socket.h"
-#include "../common/showmsg.h"
-#include "../common/mapindex.h"
-#include "../common/sql.h"
-#include "char.h"
-#include "inter.h"
+#define HERCULES_CORE
+
#include "int_party.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "char.h"
+#include "inter.h"
+#include "../common/cbasetypes.h"
+#include "../common/db.h"
+#include "../common/malloc.h"
+#include "../common/mapindex.h"
+#include "../common/mmo.h"
+#include "../common/showmsg.h"
+#include "../common/socket.h"
+#include "../common/sql.h"
+#include "../common/strlib.h"
+
struct party_data {
struct party party;
unsigned int min_lv, max_lv;
diff --git a/src/char/int_party.h b/src/char/int_party.h
index 84f00635a..098c1e9a9 100644
--- a/src/char/int_party.h
+++ b/src/char/int_party.h
@@ -14,8 +14,6 @@ enum {
PS_BREAK = 0x20, //Specify that this party must be deleted.
};
-struct party;
-
int inter_party_parse_frommap(int fd);
int inter_party_sql_init(void);
void inter_party_sql_final(void);
diff --git a/src/char/int_pet.c b/src/char/int_pet.c
index 25f00e6f0..29c40eff9 100644
--- a/src/char/int_pet.c
+++ b/src/char/int_pet.c
@@ -2,20 +2,24 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/mmo.h"
-#include "../common/malloc.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/showmsg.h"
-#include "../common/utils.h"
-#include "../common/sql.h"
-#include "char.h"
-#include "inter.h"
+#define HERCULES_CORE
+
+#include "int_pet.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "char.h"
+#include "inter.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/utils.h"
+
struct s_pet *pet_pt;
//---------------------------------------------------------
diff --git a/src/char/int_quest.c b/src/char/int_quest.c
index 061dd89d9..61b43c57d 100644
--- a/src/char/int_quest.c
+++ b/src/char/int_quest.c
@@ -2,23 +2,25 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/mmo.h"
+#define HERCULES_CORE
+
+#include "int_quest.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "char.h"
+#include "inter.h"
#include "../common/db.h"
#include "../common/malloc.h"
+#include "../common/mmo.h"
#include "../common/showmsg.h"
#include "../common/socket.h"
-#include "../common/strlib.h"
#include "../common/sql.h"
+#include "../common/strlib.h"
#include "../common/timer.h"
-#include "char.h"
-#include "inter.h"
-#include "int_quest.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
/**
* Loads the entire questlog for a character.
*
diff --git a/src/char/int_storage.c b/src/char/int_storage.c
index 966e61bb3..bf7b76da0 100644
--- a/src/char/int_storage.c
+++ b/src/char/int_storage.c
@@ -2,19 +2,23 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/mmo.h"
-#include "../common/malloc.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h" // StringBuf
-#include "../common/sql.h"
-#include "char.h"
-#include "inter.h"
+#define HERCULES_CORE
+
+#include "../config/core.h" // GP_BOUND_ITEMS
+#include "int_storage.h"
#include <stdio.h>
-#include <string.h>
#include <stdlib.h>
+#include <string.h>
+#include "char.h"
+#include "inter.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" // StringBuf
#define STORAGE_MEMINC 16
diff --git a/src/char/inter.c b/src/char/inter.c
index 515ca0ec4..972407ef3 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -2,33 +2,34 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/mmo.h"
-#include "../common/db.h"
-#include "../common/malloc.h"
-#include "../common/strlib.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/timer.h"
-#include "char.h"
+#define HERCULES_CORE
+
#include "inter.h"
-#include "int_party.h"
-#include "int_guild.h"
-#include "int_storage.h"
-#include "int_pet.h"
-#include "int_homun.h"
-#include "int_mercenary.h"
-#include "int_mail.h"
-#include "int_auction.h"
-#include "int_quest.h"
-#include "int_elemental.h"
+#include <errno.h>
#include <stdio.h>
-#include <string.h>
#include <stdlib.h>
-#include <errno.h>
-
+#include <string.h>
#include <sys/stat.h> // for stat/lstat/fstat - [Dekamaster/Ultimate GM Tool]
+#include "char.h"
+#include "int_auction.h"
+#include "int_elemental.h"
+#include "int_guild.h"
+#include "int_homun.h"
+#include "int_mail.h"
+#include "int_mercenary.h"
+#include "int_party.h"
+#include "int_pet.h"
+#include "int_quest.h"
+#include "int_storage.h"
+#include "../common/db.h"
+#include "../common/malloc.h"
+#include "../common/mmo.h"
+#include "../common/showmsg.h"
+#include "../common/socket.h"
+#include "../common/strlib.h"
+#include "../common/timer.h"
#define WISDATA_TTL (60*1000) //Wis data Time To Live (60 seconds)
#define WISDELLIST_MAX 256 // Number of elements in the list Delete data Wis
diff --git a/src/char/inter.h b/src/char/inter.h
index 25b0c2a96..5e655237e 100644
--- a/src/char/inter.h
+++ b/src/char/inter.h
@@ -5,9 +5,10 @@
#ifndef _CHAR_INTER_H_
#define _CHAR_INTER_H_
-struct accreg;
-#include "../common/sql.h"
#include "char.h"
+#include "../common/sql.h"
+
+struct accreg;
int inter_init_sql(const char *file);
void inter_final(void);
diff --git a/src/char/pincode.c b/src/char/pincode.c
index d51953448..59182f12d 100644
--- a/src/char/pincode.c
+++ b/src/char/pincode.c
@@ -2,16 +2,19 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
+#define HERCULES_CORE
+
+#include "pincode.h"
+
+#include <stdlib.h>
+
+#include "char.h"
#include "../common/cbasetypes.h"
#include "../common/mmo.h"
#include "../common/random.h"
#include "../common/showmsg.h"
#include "../common/socket.h"
#include "../common/strlib.h"
-#include "char.h"
-#include "pincode.h"
-
-#include <stdlib.h>
int enabled = PINCODE_OK;
int changetime = 0;