OSDN Git Service

[Refactor] #40413 Moved various global variables from util.c/h to macro-util.c/h...
authorHourier <hourier@users.sourceforge.jp>
Sun, 14 Jun 2020 06:39:08 +0000 (15:39 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sun, 14 Jun 2020 06:39:08 +0000 (15:39 +0900)
src/cmd-io/macro-util.c
src/cmd-io/macro-util.h
src/core/asking-player.c
src/store/store.c
src/util/string-processor.c
src/util/string-processor.h
src/util/util.c
src/util/util.h

index dc5e35f..00097a2 100644 (file)
@@ -1,28 +1,27 @@
 #include "cmd-io/macro-util.h"
 
-/*
- * Array of macro patterns [MACRO_MAX]
- */
+/* Array of macro types [MACRO_MAX] */
+bool *macro__cmd;
+
+/* Current macro action [1024] */
+char *macro__buf;
+
+/* Array of macro patterns [MACRO_MAX] */
 concptr *macro__pat;
 
-/*
- * Array of macro actions [MACRO_MAX]
- */
+/* Array of macro actions [MACRO_MAX] */
 concptr *macro__act;
 
-/*
- * Number of active macros.
- */
+/* Number of active macros */
 s16b macro__num;
 
- /*
- * Determine if any macros have ever started with a given character.
- */
+/* Expand macros in "get_com" or not */
+bool get_com_no_macros = FALSE;
+
+/* Determine if any macros have ever started with a given character */
 static bool macro__use[256];
 
-/*
- * Find the macro (if any) which exactly matches the given pattern
- */
+/* Find the macro (if any) which exactly matches the given pattern */
 int macro_find_exact(concptr pat)
 {
     if (!macro__use[(byte)(pat[0])]) {
index 63057b9..e12640a 100644 (file)
@@ -2,6 +2,11 @@
 
 #include "system/angband.h"
 
+extern bool *macro__cmd;
+extern char *macro__buf;
+
+extern bool get_com_no_macros;
+
 extern concptr *macro__pat;
 extern concptr *macro__act;
 extern s16b macro__num;
index a5a6eac..3cc5a00 100644 (file)
@@ -1,4 +1,5 @@
 #include "core/asking-player.h"
+#include "cmd-io/macro-util.h"
 #include "core/stuff-handler.h"
 #include "game-option/input-options.h"
 #include "io/input-key-acceptor.h"
index 12a9c01..60de4d4 100644 (file)
@@ -22,6 +22,7 @@
 #include "cmd-io/cmd-lore.h"
 #include "cmd-io/cmd-macro.h"
 #include "cmd-io/cmd-process-screen.h"
+#include "cmd-io/macro-util.h"
 #include "cmd-item/cmd-item.h"
 #include "cmd-item/cmd-magiceat.h"
 #include "cmd-item/cmd-smith.h"
index ff57f7b..765f42b 100644 (file)
@@ -1,5 +1,12 @@
 #include "util/string-processor.h"
 
+int max_macrotrigger = 0; /*!< 現在登録中のマクロ(トリガー)の数 */
+concptr macro_template = NULL; /*!< Angband設定ファイルのT: タグ情報から読み込んだ長いTコードを処理するために利用する文字列ポインタ */
+concptr macro_modifier_chr; /*!< &x# で指定されるマクロトリガーに関する情報を記録する文字列ポインタ */
+concptr macro_modifier_name[MAX_MACRO_MOD]; /*!< マクロ上で取り扱う特殊キーを文字列上で表現するためのフォーマットを記録した文字列ポインタ配列 */
+concptr macro_trigger_name[MAX_MACRO_TRIG]; /*!< マクロのトリガーコード */
+concptr macro_trigger_keycode[2][MAX_MACRO_TRIG]; /*!< マクロの内容 */
+
 /*
  * Convert a decimal to a single digit octal number
  */
index 9a42e96..d1d1894 100644 (file)
@@ -2,5 +2,15 @@
 
 #include "system/angband.h"
 
+/*
+ * Automatically generated "variable" declarations
+ */
+extern int max_macrotrigger;
+extern concptr macro_template;
+extern concptr macro_modifier_chr;
+extern concptr macro_modifier_name[MAX_MACRO_MOD];
+extern concptr macro_trigger_name[MAX_MACRO_TRIG];
+extern concptr macro_trigger_keycode[2][MAX_MACRO_TRIG];
+
 void text_to_ascii(char *buf, concptr str);
 void ascii_to_text(char *buf, concptr str);
index 9f0124f..fe8a104 100644 (file)
@@ -62,29 +62,10 @@ const char hexsym[16] =
  */
 concptr keymap_act[KEYMAP_MODES][256];
 
-/*
- * Array of macro types [MACRO_MAX]
- */
-bool *macro__cmd;
-
-/*
- * Current macro action [1024]
- */
-char *macro__buf;
-
-bool get_com_no_macros = FALSE;        /* Expand macros in "get_com" or not */
-
 bool use_menu;
 
 pos_list tmp_pos;
 
-int max_macrotrigger = 0; /*!< 現在登録中のマクロ(トリガー)の数 */
-concptr macro_template = NULL; /*!< Angband設定ファイルのT: タグ情報から読み込んだ長いTコードを処理するために利用する文字列ポインタ */
-concptr macro_modifier_chr; /*!< &x# で指定されるマクロトリガーに関する情報を記録する文字列ポインタ */
-concptr macro_modifier_name[MAX_MACRO_MOD]; /*!< マクロ上で取り扱う特殊キーを文字列上で表現するためのフォーマットを記録した文字列ポインタ配列 */
-concptr macro_trigger_name[MAX_MACRO_TRIG]; /*!< マクロのトリガーコード */
-concptr macro_trigger_keycode[2][MAX_MACRO_TRIG];  /*!< マクロの内容 */
-
 s16b command_cmd;              /* Current "Angband Command" */
 COMMAND_ARG command_arg;       /*!< 各種コマンドの汎用的な引数として扱う / Gives argument of current command */
 COMMAND_NUM command_rep;       /*!< 各種コマンドの汎用的なリピート数として扱う / Gives repetition of current command */
index d7d797a..16153d5 100644 (file)
@@ -107,25 +107,10 @@ struct alloc_entry
        u16b total;             /* Unused for now */
 };
 
-extern bool *macro__cmd;
-extern char *macro__buf;
-
-extern bool get_com_no_macros;
-
 extern bool use_menu;
 
 extern pos_list tmp_pos;
 
-/*
- * Automatically generated "variable" declarations
- */
-extern int max_macrotrigger;
-extern concptr macro_template;
-extern concptr macro_modifier_chr;
-extern concptr macro_modifier_name[MAX_MACRO_MOD];
-extern concptr macro_trigger_name[MAX_MACRO_TRIG];
-extern concptr macro_trigger_keycode[2][MAX_MACRO_TRIG];
-
 extern COMMAND_CODE command_cmd;
 extern COMMAND_ARG command_arg;
 extern s16b command_rep;