summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-03-07 16:55:40 +0100
committerBardur Arantsson <bardur@scientician.net>2015-03-07 16:55:40 +0100
commit7bdfa1a20c8921e53baecdd12b48870417f8b426 (patch)
treec1dee70b8c76b1ab50d805989a5030ac864c8a4b
parentba98790ab04de2c6fdecc7d54b7eb4c43755f105 (diff)
Split files.cc declarations into separate header files
-rw-r--r--src/birth.cc2
-rw-r--r--src/bldg.cc1
-rw-r--r--src/cmd1.cc1
-rw-r--r--src/cmd2.cc1
-rw-r--r--src/cmd3.cc1
-rw-r--r--src/cmd4.cc1
-rw-r--r--src/cmd6.cc1
-rw-r--r--src/cmd7.cc1
-rw-r--r--src/dungeon.cc2
-rw-r--r--src/externs.h29
-rw-r--r--src/files.cc3
-rw-r--r--src/files.h17
-rw-r--r--src/files.hpp26
-rw-r--r--src/help.cc1
-rw-r--r--src/init1.cc1
-rw-r--r--src/init2.cc1
-rw-r--r--src/main-gtk2.c1
-rw-r--r--src/main-win.c1
-rw-r--r--src/main.c1
-rw-r--r--src/melee2.cc1
-rw-r--r--src/modules.cc1
-rw-r--r--src/monster2.cc1
-rw-r--r--src/notes.cc1
-rw-r--r--src/object1.cc1
-rw-r--r--src/powers.cc1
-rw-r--r--src/spells1.cc1
-rw-r--r--src/spells2.cc1
-rw-r--r--src/squeltch.cc17
-rw-r--r--src/status.cc3
-rw-r--r--src/store.cc1
-rw-r--r--src/traps.cc1
-rw-r--r--src/wizard2.cc1
-rw-r--r--src/xtra1.cc1
-rw-r--r--src/xtra2.cc1
34 files changed, 87 insertions, 38 deletions
diff --git a/src/birth.cc b/src/birth.cc
index b7e10d2..04b8841 100644
--- a/src/birth.cc
+++ b/src/birth.cc
@@ -11,6 +11,8 @@
#include "corrupt.hpp"
#include "cmd4.hpp"
#include "cmd5.hpp"
+#include "files.h"
+#include "files.hpp"
#include "gods.hpp"
#include "help.hpp"
#include "hooks.h"
diff --git a/src/bldg.cc b/src/bldg.cc
index 95a5249..d139cd9 100644
--- a/src/bldg.cc
+++ b/src/bldg.cc
@@ -15,6 +15,7 @@
#include "angband.h"
#include "cmd3.hpp"
+#include "files.hpp"
#include "hooks.h"
#include "mimic.hpp"
#include "q_library.h"
diff --git a/src/cmd1.cc b/src/cmd1.cc
index 7e3cb40..8f74cc8 100644
--- a/src/cmd1.cc
+++ b/src/cmd1.cc
@@ -12,6 +12,7 @@
#include "cave.hpp"
#include "cmd4.hpp"
#include "cmd5.hpp"
+#include "files.hpp"
#include "gods.hpp"
#include "hooks.h"
#include "mimic.hpp"
diff --git a/src/cmd2.cc b/src/cmd2.cc
index 2dfd9df..2bfbcb6 100644
--- a/src/cmd2.cc
+++ b/src/cmd2.cc
@@ -12,6 +12,7 @@
#include "bldg.hpp"
#include "cave.hpp"
#include "cmd1.hpp"
+#include "files.hpp"
#include "gods.hpp"
#include "hooks.h"
#include "levels.hpp"
diff --git a/src/cmd3.cc b/src/cmd3.cc
index f4bca80..8bf20c1 100644
--- a/src/cmd3.cc
+++ b/src/cmd3.cc
@@ -9,6 +9,7 @@
#include "angband.h"
#include "cave.hpp"
+#include "files.hpp"
#include "gods.hpp"
#include "hooks.h"
#include "monster1.hpp"
diff --git a/src/cmd4.cc b/src/cmd4.cc
index cc86fd4..f38b3ed 100644
--- a/src/cmd4.cc
+++ b/src/cmd4.cc
@@ -9,6 +9,7 @@
#include "angband.h"
#include "corrupt.hpp"
+#include "files.hpp"
#include "hooks.h"
#include "levels.hpp"
#include "messages.h"
diff --git a/src/cmd6.cc b/src/cmd6.cc
index b70bdc1..a3d8c6a 100644
--- a/src/cmd6.cc
+++ b/src/cmd6.cc
@@ -13,6 +13,7 @@
#include "cmd1.hpp"
#include "cmd7.hpp"
#include "corrupt.hpp"
+#include "files.hpp"
#include "hooks.h"
#include "lua_bind.hpp"
#include "mimic.hpp"
diff --git a/src/cmd7.cc b/src/cmd7.cc
index a0868cd..80e0051 100644
--- a/src/cmd7.cc
+++ b/src/cmd7.cc
@@ -13,6 +13,7 @@
#include "cmd1.hpp"
#include "cmd5.hpp"
#include "cmd6.hpp"
+#include "files.hpp"
#include "hooks.h"
#include "mimic.hpp"
#include "monster2.hpp"
diff --git a/src/dungeon.cc b/src/dungeon.cc
index 9bf1374..ebd36f2 100644
--- a/src/dungeon.cc
+++ b/src/dungeon.cc
@@ -17,6 +17,8 @@
#include "cmd6.hpp"
#include "cmd7.hpp"
#include "corrupt.hpp"
+#include "files.h"
+#include "files.hpp"
#include "generate.hpp"
#include "gen_evol.hpp"
#include "gods.hpp"
diff --git a/src/externs.h b/src/externs.h
index 1df9e30..d79aa13 100644
--- a/src/externs.h
+++ b/src/externs.h
@@ -466,35 +466,6 @@ extern bool_ no_begin_screen;
extern void play_game(bool_ new_game);
extern void sense_inventory();
-/* files.c */
-extern void html_screenshot(cptr name);
-extern void help_file_screenshot(cptr name);
-extern void player_flags(u32b* f1, u32b* f2, u32b* f3, u32b* f4, u32b* f5, u32b* esp);
-extern void wipe_saved(void);
-extern s16b tokenize(char *buf, s16b num, char **tokens, char delim1, char delim2);
-extern void display_player(int mode);
-extern cptr describe_player_location(void);
-extern errr file_character(cptr name, bool_ full);
-extern errr process_pref_file_aux(char *buf);
-extern errr process_pref_file(cptr name);
-extern bool_ txt_to_html(cptr head, cptr food, cptr base, cptr ext, bool_ force, bool_ recur);
-extern bool_ show_file(cptr name, cptr what, int line, int mode);
-extern void do_cmd_help(void);
-extern void process_player_base(void);
-extern void process_player_name(bool_ sf);
-extern void get_name(void);
-extern void do_cmd_suicide(void);
-extern void do_cmd_save_game(void);
-extern void autosave_checkpoint();
-extern void predict_score_gui(bool_ *initialized, bool_ *game_in_progress);
-extern void close_game(void);
-extern errr get_rnd_line(const char * file_name, char * output);
-extern char *get_line(const char* fname, cptr fdir, char *linbuf, int line);
-extern void race_legends(void);
-extern void show_highclass(int building);
-extern errr get_xtra_line(const char * file_name, monster_type *m_ptr, char * output);
-
-
/* init1.c */
extern int color_char_to_attr(char c);
extern byte conv_color[16];
diff --git a/src/files.cc b/src/files.cc
index 0bdb0d4..c15dbf6 100644
--- a/src/files.cc
+++ b/src/files.cc
@@ -6,6 +6,9 @@
* included in all such copies.
*/
+#include "files.hpp"
+#include "files.h"
+
#include "angband.h"
#include "cave.hpp"
#include "corrupt.hpp"
diff --git a/src/files.h b/src/files.h
new file mode 100644
index 0000000..e3df563
--- /dev/null
+++ b/src/files.h
@@ -0,0 +1,17 @@
+#pragma once
+
+#include "h-basic.h"
+
+// C linkage required for these functions since main-* code uses them.
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern bool_ txt_to_html(cptr head, cptr food, cptr base, cptr ext, bool_ force, bool_ recur);
+extern void process_player_name(bool_ sf);
+extern void do_cmd_save_game(void);
+extern void predict_score_gui(bool_ *initialized, bool_ *game_in_progress);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/src/files.hpp b/src/files.hpp
new file mode 100644
index 0000000..b09c85b
--- /dev/null
+++ b/src/files.hpp
@@ -0,0 +1,26 @@
+#pragma once
+
+#include "angband.h"
+
+extern void html_screenshot(cptr name);
+extern void help_file_screenshot(cptr name);
+extern void player_flags(u32b* f1, u32b* f2, u32b* f3, u32b* f4, u32b* f5, u32b* esp);
+extern void wipe_saved(void);
+extern s16b tokenize(char *buf, s16b num, char **tokens, char delim1, char delim2);
+extern void display_player(int mode);
+extern cptr describe_player_location(void);
+extern errr file_character(cptr name, bool_ full);
+extern errr process_pref_file_aux(char *buf);
+extern errr process_pref_file(cptr name);
+extern bool_ show_file(cptr name, cptr what, int line, int mode);
+extern void do_cmd_help(void);
+extern void process_player_base(void);
+extern void get_name(void);
+extern void do_cmd_suicide(void);
+extern void autosave_checkpoint();
+extern void close_game(void);
+extern errr get_rnd_line(const char * file_name, char * output);
+extern char *get_line(const char* fname, cptr fdir, char *linbuf, int line);
+extern void race_legends(void);
+extern void show_highclass(int building);
+extern errr get_xtra_line(const char * file_name, monster_type *m_ptr, char * output);
diff --git a/src/help.cc b/src/help.cc
index 68c3500..fe48acc 100644
--- a/src/help.cc
+++ b/src/help.cc
@@ -10,6 +10,7 @@
#include "help.hpp"
#include "angband.h"
+#include "files.hpp"
#include "hooks.h"
#include "skills.hpp"
#include "util.hpp"
diff --git a/src/init1.cc b/src/init1.cc
index b59c4e1..42b0fb4 100644
--- a/src/init1.cc
+++ b/src/init1.cc
@@ -1,5 +1,6 @@
#include "angband.h"
#include "cave.hpp"
+#include "files.hpp"
#include "gods.hpp"
#include "monster2.hpp"
#include "skills.hpp"
diff --git a/src/init2.cc b/src/init2.cc
index 05d55e8..a96e2cf 100644
--- a/src/init2.cc
+++ b/src/init2.cc
@@ -1,5 +1,6 @@
#include "angband.h"
#include "cave.hpp"
+#include "files.hpp"
#include "generate.hpp"
#include "gen_evol.hpp"
#include "gen_maze.hpp"
diff --git a/src/main-gtk2.c b/src/main-gtk2.c
index 6fc8557..8f6be60 100644
--- a/src/main-gtk2.c
+++ b/src/main-gtk2.c
@@ -31,6 +31,7 @@
*/
#include "angband.h"
+#include "files.h"
#include "util.h"
diff --git a/src/main-win.c b/src/main-win.c
index 523e189..9dd8e3a 100644
--- a/src/main-win.c
+++ b/src/main-win.c
@@ -68,6 +68,7 @@
#include "angband.h"
+#include "files.h"
#include "util.h"
#ifdef WINDOWS
diff --git a/src/main.c b/src/main.c
index 531d0ed..897c782 100644
--- a/src/main.c
+++ b/src/main.c
@@ -9,6 +9,7 @@
*/
#include "angband.h"
+#include "files.h"
#include "util.h"
diff --git a/src/melee2.cc b/src/melee2.cc
index bc0bfb0..9ac7ff4 100644
--- a/src/melee2.cc
+++ b/src/melee2.cc
@@ -15,6 +15,7 @@
#include "cave.hpp"
#include "cmd1.hpp"
+#include "files.hpp"
#include "hooks.h"
#include "messages.h"
#include "monster2.hpp"
diff --git a/src/modules.cc b/src/modules.cc
index 24e2a1e..aa5d537 100644
--- a/src/modules.cc
+++ b/src/modules.cc
@@ -9,6 +9,7 @@
#include "angband.h"
#include "birth.hpp"
#include "corrupt.hpp"
+#include "files.hpp"
#include "hooks.h"
#include "monster2.hpp"
#include "spells2.hpp"
diff --git a/src/monster2.cc b/src/monster2.cc
index 1fb01d8..b6df530 100644
--- a/src/monster2.cc
+++ b/src/monster2.cc
@@ -9,6 +9,7 @@
#include "angband.h"
#include "cave.hpp"
+#include "files.hpp"
#include "hooks.h"
#include "levels.hpp"
#include "mimic.hpp"
diff --git a/src/notes.cc b/src/notes.cc
index 46d3251..8869ff2 100644
--- a/src/notes.cc
+++ b/src/notes.cc
@@ -10,6 +10,7 @@
#include "notes.hpp"
#include "angband.h"
+#include "files.hpp"
#include "util.hpp"
#include "util.h"
diff --git a/src/object1.cc b/src/object1.cc
index e02ad50..bf2a682 100644
--- a/src/object1.cc
+++ b/src/object1.cc
@@ -10,6 +10,7 @@
#include "cave.hpp"
#include "cmd2.hpp"
#include "cmd6.hpp"
+#include "files.hpp"
#include "hooks.h"
#include "lua_bind.hpp"
#include "mimic.hpp"
diff --git a/src/powers.cc b/src/powers.cc
index 8963e05..fce95a6 100644
--- a/src/powers.cc
+++ b/src/powers.cc
@@ -12,6 +12,7 @@
#include "cmd1.hpp"
#include "cmd2.hpp"
#include "cmd7.hpp"
+#include "files.hpp"
#include "hooks.h"
#include "mimic.hpp"
#include "monster2.hpp"
diff --git a/src/spells1.cc b/src/spells1.cc
index 10d3424..012abf0 100644
--- a/src/spells1.cc
+++ b/src/spells1.cc
@@ -12,6 +12,7 @@
#include "cmd1.hpp"
#include "cmd3.hpp"
#include "cmd5.hpp"
+#include "files.hpp"
#include "gods.hpp"
#include "monster2.hpp"
#include "monster3.hpp"
diff --git a/src/spells2.cc b/src/spells2.cc
index 2c1d0dc..f38e9f5 100644
--- a/src/spells2.cc
+++ b/src/spells2.cc
@@ -12,6 +12,7 @@
#include "cave.hpp"
#include "cmd1.hpp"
#include "cmd7.hpp"
+#include "files.hpp"
#include "hooks.h"
#include "monster2.hpp"
#include "monster3.hpp"
diff --git a/src/squeltch.cc b/src/squeltch.cc
index 90f6ae9..100a4d8 100644
--- a/src/squeltch.cc
+++ b/src/squeltch.cc
@@ -9,14 +9,7 @@
#include "squeltch.hpp"
-#include <jansson.h>
-#include <algorithm>
-#include <memory>
-#include <deque>
-#include <list>
-#include <string>
-#include <vector>
-
+#include "files.hpp"
#include "tome/squelch/tree_printer.hpp"
#include "tome/squelch/condition.hpp"
#include "tome/squelch/condition_metadata.hpp"
@@ -27,6 +20,14 @@
#include "util.hpp"
#include "util.h"
+#include <jansson.h>
+#include <algorithm>
+#include <memory>
+#include <deque>
+#include <list>
+#include <string>
+#include <vector>
+
using squelch::action_type;
using squelch::action_mapping;
diff --git a/src/status.cc b/src/status.cc
index 39c1530..2484896 100644
--- a/src/status.cc
+++ b/src/status.cc
@@ -16,10 +16,11 @@
*/
#include "angband.h"
-#include "xtra1.hpp"
+#include "files.hpp"
#include "monster2.hpp"
#include "util.hpp"
#include "util.h"
+#include "xtra1.hpp"
static void row_trival(const char*, s16b, u32b, s16b, u32b, int, u32b[INVEN_TOTAL - INVEN_WIELD + 2][7]);
static void row_bival(const char*, s16b, u32b, int, u32b[INVEN_TOTAL - INVEN_WIELD + 2][7]);
diff --git a/src/store.cc b/src/store.cc
index d5e75a9..acf23d0 100644
--- a/src/store.cc
+++ b/src/store.cc
@@ -13,6 +13,7 @@
#include "cmd3.hpp"
#include "cmd4.hpp"
#include "cmd5.hpp"
+#include "files.hpp"
#include "hooks.h"
#include "quark.h"
#include "spell_type.hpp"
diff --git a/src/traps.cc b/src/traps.cc
index da2ee89..f636866 100644
--- a/src/traps.cc
+++ b/src/traps.cc
@@ -11,6 +11,7 @@
#include "cave.hpp"
#include "cmd1.hpp"
#include "cmd2.hpp"
+#include "files.hpp"
#include "gods.hpp"
#include "monster2.hpp"
#include "spells1.hpp"
diff --git a/src/wizard2.cc b/src/wizard2.cc
index c958cc3..74f4ae9 100644
--- a/src/wizard2.cc
+++ b/src/wizard2.cc
@@ -12,6 +12,7 @@
#include "cave.hpp"
#include "cmd4.hpp"
#include "corrupt.hpp"
+#include "files.hpp"
#include "hooks.h"
#include "monster2.hpp"
#include "randart.hpp"
diff --git a/src/xtra1.cc b/src/xtra1.cc
index c38c87d..9038e22 100644
--- a/src/xtra1.cc
+++ b/src/xtra1.cc
@@ -12,6 +12,7 @@
#include "cave.hpp"
#include "corrupt.hpp"
#include "cmd7.hpp"
+#include "files.hpp"
#include "gods.hpp"
#include "hooks.h"
#include "levels.hpp"
diff --git a/src/xtra2.cc b/src/xtra2.cc
index 435a208..c76485b 100644
--- a/src/xtra2.cc
+++ b/src/xtra2.cc
@@ -11,6 +11,7 @@
#include "angband.h"
#include "cave.hpp"
#include "corrupt.hpp"
+#include "files.hpp"
#include "gods.hpp"
#include "hooks.h"
#include "mimic.hpp"