From 7bdfa1a20c8921e53baecdd12b48870417f8b426 Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Sat, 7 Mar 2015 16:55:40 +0100 Subject: Split files.cc declarations into separate header files --- src/birth.cc | 2 ++ src/bldg.cc | 1 + src/cmd1.cc | 1 + src/cmd2.cc | 1 + src/cmd3.cc | 1 + src/cmd4.cc | 1 + src/cmd6.cc | 1 + src/cmd7.cc | 1 + src/dungeon.cc | 2 ++ src/externs.h | 29 ----------------------------- src/files.cc | 3 +++ src/files.h | 17 +++++++++++++++++ src/files.hpp | 26 ++++++++++++++++++++++++++ src/help.cc | 1 + src/init1.cc | 1 + src/init2.cc | 1 + src/main-gtk2.c | 1 + src/main-win.c | 1 + src/main.c | 1 + src/melee2.cc | 1 + src/modules.cc | 1 + src/monster2.cc | 1 + src/notes.cc | 1 + src/object1.cc | 1 + src/powers.cc | 1 + src/spells1.cc | 1 + src/spells2.cc | 1 + src/squeltch.cc | 17 +++++++++-------- src/status.cc | 3 ++- src/store.cc | 1 + src/traps.cc | 1 + src/wizard2.cc | 1 + src/xtra1.cc | 1 + src/xtra2.cc | 1 + 34 files changed, 87 insertions(+), 38 deletions(-) create mode 100644 src/files.h create mode 100644 src/files.hpp (limited to 'src') diff --git a/src/birth.cc b/src/birth.cc index b7e10d2d..04b88410 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 95a52498..d139cd9b 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 7e3cb40c..8f74cc8e 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 2dfd9dfe..2bfbcb60 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 f4bca801..8bf20c14 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 cc86fd4b..f38b3eda 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 b70bdc11..a3d8c6a8 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 a0868cd0..80e00515 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 9bf13747..ebd36f29 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 1df9e301..d79aa13f 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 0bdb0d4e..c15dbf6b 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 00000000..e3df5636 --- /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 00000000..b09c85b8 --- /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 68c3500c..fe48acce 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 b59c4e18..42b0fb4d 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 05d55e84..a96e2cf2 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 6fc85570..8f6be607 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 523e189e..9dd8e3a9 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 531d0edd..897c7826 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 bc0bfb0a..9ac7ff4c 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 24e2a1e6..aa5d5377 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 1fb01d89..b6df5302 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 46d32513..8869ff2f 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 e02ad50d..bf2a682f 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 8963e05b..fce95a6d 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 10d34240..012abf00 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 2c1d0dc3..f38e9f5a 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 90f6ae95..100a4d8d 100644 --- a/src/squeltch.cc +++ b/src/squeltch.cc @@ -9,14 +9,7 @@ #include "squeltch.hpp" -#include -#include -#include -#include -#include -#include -#include - +#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 +#include +#include +#include +#include +#include +#include + using squelch::action_type; using squelch::action_mapping; diff --git a/src/status.cc b/src/status.cc index 39c1530e..2484896c 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 d5e75a97..acf23d0b 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 da2ee898..f6368663 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 c958cc38..74f4ae91 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 c38c87d6..9038e223 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 435a2082..c76485b0 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" -- cgit v1.2.3