summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
Diffstat (limited to 'src/char')
-rw-r--r--src/char/Makefile.in (renamed from src/char/Makefile)37
-rw-r--r--src/char/char.c8
-rw-r--r--src/char/char.h3
-rw-r--r--src/char/int_guild.c8
-rw-r--r--src/char/int_guild.h3
-rw-r--r--src/char/int_homun.c8
-rw-r--r--src/char/int_homun.h1
-rw-r--r--src/char/int_party.c8
-rw-r--r--src/char/int_party.h4
-rw-r--r--src/char/int_pet.c8
-rw-r--r--src/char/int_pet.h2
-rw-r--r--src/char/int_status.c7
-rw-r--r--src/char/int_status.h6
-rw-r--r--src/char/int_storage.c9
-rw-r--r--src/char/int_storage.h4
-rw-r--r--src/char/inter.c9
-rw-r--r--src/char/inter.h2
17 files changed, 75 insertions, 52 deletions
diff --git a/src/char/Makefile b/src/char/Makefile.in
index 17b66b810..78d2cb2c8 100644
--- a/src/char/Makefile
+++ b/src/char/Makefile.in
@@ -1,5 +1,3 @@
-all txt: char-server
-
COMMON_OBJ = ../common/obj/core.o ../common/obj/socket.o ../common/obj/timer.o \
../common/obj/db.o ../common/obj/plugins.o ../common/obj/lock.o \
../common/obj/malloc.o ../common/obj/showmsg.o ../common/obj/utils.o \
@@ -7,21 +5,38 @@ COMMON_OBJ = ../common/obj/core.o ../common/obj/socket.o ../common/obj/timer.o \
../common/obj/mapindex.o ../common/obj/ers.o
COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h \
../common/version.h ../common/db.h ../common/plugins.h ../common/lock.h \
- ../common/malloc.h ../common/showmsg.h ../common/utils.h ../common/strlib.h \
- ../common/grfio.h ../common/mapindex.h
+ ../common/malloc.h ../common/showmsg.h ../common/utils.h \
+ ../common/strlib.h ../common/grfio.h \
+ ../common/mapindex.h ../common/ers.h
-%.o: %.c
- $(COMPILE.c) -DTXT_ONLY $(OUTPUT_OPTION) $<
-
-char-server: char.o inter.o int_party.o int_guild.o int_status.o int_storage.o int_pet.o int_homun.o $(COMMON_OBJ)
- $(CC) -o ../../$@ $> $(LIB_S)
+CHAR_OBJ = char.o inter.o int_party.o int_guild.o int_storage.o int_status.o int_pet.o int_homun.o
+
+#####################################################################
+.PHONY : all char-server clean help
+
+all: char-server
+
+char-server: $(CHAR_OBJ) $(COMMON_OBJ)
+ @CC@ @LDFLAGS@ -o ../../char-server@EXEEXT@ $(CHAR_OBJ) $(COMMON_OBJ) @LIBS@
clean:
- rm -f *.o ../../char-server GNUmakefile
+ rm -f *.o ../../char-server@EXEEXT@
+
+help:
+ @echo "possible targets are 'char-server' 'all' 'clean' 'help'"
+ @echo "'char-server' - char server (TXT version)"
+ @echo "'all' - builds all above targets"
+ @echo "'clean' - cleans builds and objects"
+ @echo "'help' - outputs this message"
+
+#####################################################################
+
+%.o: %.c
+ @CC@ @CFLAGS@ -DTXT_ONLY @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# DO NOT DELETE
-char.o: char.c char.h inter.h int_pet.h $(COMMON_H) ../common/version.h
+char.o: char.c char.h inter.h int_pet.h $(COMMON_H)
inter.o: inter.c inter.h int_party.h int_guild.h int_storage.h int_pet.h char.h $(COMMON_H)
int_party.o: int_party.c int_party.h inter.h char.h $(COMMON_H)
int_guild.o: int_guild.c int_guild.h int_storage.h inter.h char.h $(COMMON_H)
diff --git a/src/char/char.c b/src/char/char.c
index ba21cd68e..9ef31871d 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -11,17 +11,19 @@
#include "../common/strlib.h"
#include "../common/showmsg.h"
#include "../common/timer.h"
+#include "../common/lock.h"
+#include "../common/malloc.h"
+#include "../common/mapindex.h"
+#include "../common/showmsg.h"
+#include "../common/utils.h"
#include "../common/version.h"
-
#include "inter.h"
#include "int_guild.h"
#include "int_homun.h"
#include "int_pet.h"
#include "int_party.h"
#include "int_storage.h"
-#ifdef ENABLE_SC_SAVING
#include "int_status.h"
-#endif
#include "char.h"
#include <sys/types.h>
diff --git a/src/char/char.h b/src/char/char.h
index ded9a9b2e..72077ac09 100644
--- a/src/char/char.h
+++ b/src/char/char.h
@@ -5,7 +5,6 @@
#define _CHAR_H_
#include "../common/mmo.h"
-#include "../common/mapindex.h"
#define START_CHAR_NUM 150000
#define MAX_MAP_SERVERS 30
@@ -21,7 +20,7 @@ struct character_data {
struct mmo_charstatus* search_character(int aid, int cid);
struct mmo_charstatus* search_character_byname(char* character_name);
int search_character_index(char* character_name);
-char * search_character_name(int index);
+char* search_character_name(int index);
int search_character_online(int aid, int cid);
int mapif_sendall(unsigned char *buf, unsigned int len);
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index c4ae0a493..52514692c 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -1,10 +1,6 @@
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-
#include "../common/cbasetypes.h"
#include "../common/mmo.h"
#include "../common/malloc.h"
@@ -17,6 +13,10 @@
#include "int_storage.h"
#include "int_guild.h"
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
char guild_txt[1024] = "save/guild.txt";
char castle_txt[1024] = "save/castle.txt";
diff --git a/src/char/int_guild.h b/src/char/int_guild.h
index 6b0e9f7b5..06293eb0f 100644
--- a/src/char/int_guild.h
+++ b/src/char/int_guild.h
@@ -4,6 +4,9 @@
#ifndef _INT_GUILD_H_
#define _INT_GUILD_H_
+struct guild;
+struct guild_castle;
+
int inter_guild_init(void);
void inter_guild_final(void);
int inter_guild_save(void);
diff --git a/src/char/int_homun.c b/src/char/int_homun.c
index 684601449..35f8f9c50 100644
--- a/src/char/int_homun.c
+++ b/src/char/int_homun.c
@@ -1,10 +1,6 @@
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "../common/mmo.h"
#include "../common/malloc.h"
#include "../common/socket.h"
@@ -15,6 +11,10 @@
#include "inter.h"
#include "int_homun.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
char homun_txt[1024]="save/homun.txt";
static struct dbt *homun_db;
diff --git a/src/char/int_homun.h b/src/char/int_homun.h
index d56ab97a9..1858ed4ba 100644
--- a/src/char/int_homun.h
+++ b/src/char/int_homun.h
@@ -8,7 +8,6 @@ int inter_homun_init(void);
void inter_homun_final(void);
int inter_homun_save(void);
int inter_homun_delete(int homun_id);
-
int inter_homun_parse_frommap(int fd);
extern char homun_txt[1024];
diff --git a/src/char/int_party.c b/src/char/int_party.c
index b47a8b59c..96181cd1b 100644
--- a/src/char/int_party.c
+++ b/src/char/int_party.c
@@ -1,10 +1,6 @@
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "../common/cbasetypes.h"
#include "../common/mmo.h"
#include "../common/malloc.h"
@@ -16,6 +12,10 @@
#include "inter.h"
#include "int_party.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
char party_txt[1024] = "save/party.txt";
#ifndef TXT_SQL_CONVERT
struct party_data {
diff --git a/src/char/int_party.h b/src/char/int_party.h
index 453699617..ad724e475 100644
--- a/src/char/int_party.h
+++ b/src/char/int_party.h
@@ -4,12 +4,12 @@
#ifndef _INT_PARTY_H_
#define _INT_PARTY_H_
+struct party;
+
int inter_party_init(void);
void inter_party_final(void);
int inter_party_save(void);
-
int inter_party_parse_frommap(int fd);
-
int inter_party_leave(int party_id,int account_id, int char_id);
extern char party_txt[1024];
diff --git a/src/char/int_pet.c b/src/char/int_pet.c
index b15e8e259..e7ff2aff2 100644
--- a/src/char/int_pet.c
+++ b/src/char/int_pet.c
@@ -1,10 +1,6 @@
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "../common/mmo.h"
#include "../common/malloc.h"
#include "../common/socket.h"
@@ -15,6 +11,10 @@
#include "inter.h"
#include "int_pet.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
char pet_txt[1024]="save/pet.txt";
#ifndef TXT_SQL_CONVERT
diff --git a/src/char/int_pet.h b/src/char/int_pet.h
index 43f354798..9234af109 100644
--- a/src/char/int_pet.h
+++ b/src/char/int_pet.h
@@ -4,6 +4,8 @@
#ifndef _INT_PET_H_
#define _INT_PET_H_
+struct s_pet;
+
int inter_pet_init(void);
void inter_pet_final(void);
int inter_pet_save(void);
diff --git a/src/char/int_status.c b/src/char/int_status.c
index ea255d507..cc25b1485 100644
--- a/src/char/int_status.c
+++ b/src/char/int_status.c
@@ -1,13 +1,14 @@
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
-#include <stdio.h>
-
-#include "int_status.h"
+#include "../common/mmo.h"
#include "../common/db.h"
#include "../common/lock.h"
#include "../common/malloc.h"
#include "../common/showmsg.h"
+#include "int_status.h"
+
+#include <stdio.h>
static struct dbt * scdata_db = NULL; //Contains all the status change data in-memory. [Skotlex]
char scdata_txt[1024]="save/scdata.txt"; //By [Skotlex]
diff --git a/src/char/int_status.h b/src/char/int_status.h
index 3ddf08299..3202cd88e 100644
--- a/src/char/int_status.h
+++ b/src/char/int_status.h
@@ -4,7 +4,7 @@
#ifndef _INT_STATUS_H_
#define _INT_STATUS_H_
-#include "char.h"
+struct status_change_data;
struct scdata {
int account_id, char_id;
@@ -14,12 +14,10 @@ struct scdata {
extern char scdata_txt[1024];
-#ifdef ENABLE_SC_SAVING
-struct scdata *status_search_scdata(int aid, int cid);
+struct scdata* status_search_scdata(int aid, int cid);
void status_delete_scdata(int aid, int cid);
void inter_status_save(void);
void status_init(void);
void status_final(void);
-#endif
#endif /* _INT_STATUS_H_ */
diff --git a/src/char/int_storage.c b/src/char/int_storage.c
index 3698dc78f..4d933d257 100644
--- a/src/char/int_storage.c
+++ b/src/char/int_storage.c
@@ -1,22 +1,23 @@
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
#include "../common/mmo.h"
#include "../common/malloc.h"
#include "../common/socket.h"
#include "../common/db.h"
#include "../common/lock.h"
#include "../common/showmsg.h"
+#include "../common/utils.h"
#include "char.h"
#include "inter.h"
#include "int_storage.h"
#include "int_pet.h"
#include "int_guild.h"
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
// ファイル名のデフォルト
// inter_config_read()で再設定される
char storage_txt[1024]="save/storage.txt";
diff --git a/src/char/int_storage.h b/src/char/int_storage.h
index 976d77034..dbc487c4c 100644
--- a/src/char/int_storage.h
+++ b/src/char/int_storage.h
@@ -4,13 +4,15 @@
#ifndef _INT_STORAGE_H_
#define _INT_STORAGE_H_
+struct storage;
+struct guild_storage;
+
int inter_storage_init(void);
void inter_storage_final(void);
int inter_storage_save(void);
int inter_guild_storage_save(void);
int inter_storage_delete(int account_id);
int inter_guild_storage_delete(int guild_id);
-
int inter_storage_parse_frommap(int fd);
extern char storage_txt[1024];
diff --git a/src/char/inter.c b/src/char/inter.c
index cadb05f92..721017188 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -1,10 +1,6 @@
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
#include "../common/db.h"
#include "../common/mmo.h"
#include "../common/socket.h"
@@ -12,7 +8,6 @@
#include "../common/malloc.h"
#include "../common/lock.h"
#include "../common/showmsg.h"
-
#include "char.h"
#include "inter.h"
#include "int_party.h"
@@ -22,6 +17,10 @@
#include "int_pet.h"
#include "int_homun.h"
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
#define WISDATA_TTL (60*1000) // Existence time of Wisp/page data (60 seconds)
// that is the waiting time of answers of all map-servers
#define WISDELLIST_MAX 256 // Number of elements of Wisp/page data deletion list
diff --git a/src/char/inter.h b/src/char/inter.h
index 5a6a0edde..c9843965e 100644
--- a/src/char/inter.h
+++ b/src/char/inter.h
@@ -4,6 +4,8 @@
#ifndef _INTER_H_
#define _INTER_H_
+struct accreg;
+
int inter_init_txt(const char *file);
void inter_final(void);
int inter_save(void);