OSDN Git Service

[Refactor] #39964 Unified autopick-searcher.c/h into autopick-finder.c/h
authorHourier <hourier@users.sourceforge.jp>
Sun, 26 Apr 2020 04:54:34 +0000 (13:54 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sun, 26 Apr 2020 04:54:34 +0000 (13:54 +0900)
Hengband_vcs2017/Hengband/Hengband.vcxproj
Hengband_vcs2017/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/autopick/autopick-editor-command.c
src/autopick/autopick-finder.c
src/autopick/autopick-finder.h
src/autopick/autopick-searcher.c [deleted file]
src/autopick/autopick-searcher.h [deleted file]

index 0fa9185..a2f819e 100644 (file)
     <ClCompile Include="..\..\src\autopick\autopick-pref-processor.c" />\r
     <ClCompile Include="..\..\src\autopick\autopick-reader-writer.c" />\r
     <ClCompile Include="..\..\src\autopick\autopick-registry.c" />\r
-    <ClCompile Include="..\..\src\autopick\autopick-searcher.c" />\r
     <ClCompile Include="..\..\src\autopick\autopick-util.c" />\r
     <ClCompile Include="..\..\src\autopick\autopick.c" />\r
     <ClCompile Include="..\..\src\avatar.c" />\r
     <ClInclude Include="..\..\src\autopick\autopick-pref-processor.h" />\r
     <ClInclude Include="..\..\src\autopick\autopick-reader-writer.h" />\r
     <ClInclude Include="..\..\src\autopick\autopick-registry.h" />\r
-    <ClInclude Include="..\..\src\autopick\autopick-searcher.h" />\r
     <ClInclude Include="..\..\src\autopick\autopick-util.h" />\r
     <ClInclude Include="..\..\src\autopick\autopick.h" />\r
     <ClInclude Include="..\..\src\avatar.h" />\r
index 732c137..848c426 100644 (file)
     <ClCompile Include="..\..\src\autopick\autopick-drawer.c">
       <Filter>autopick</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\src\autopick\autopick-searcher.c">
-      <Filter>autopick</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\src\autopick\autopick-inserter-killer.c">
       <Filter>autopick</Filter>
     </ClCompile>
     <ClInclude Include="..\..\src\autopick\autopick-drawer.h">
       <Filter>autopick</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\src\autopick\autopick-searcher.h">
-      <Filter>autopick</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\src\autopick\autopick-inserter-killer.h">
       <Filter>autopick</Filter>
     </ClInclude>
index 6a56aef..696457b 100644 (file)
@@ -26,7 +26,6 @@ hengband_SOURCES = \
        autopick/autopick-adder.c autopick/autopick-adder.h \
        autopick/autopick-pref-processor.c autopick/autopick-pref-processor.h \
        autopick/autopick-drawer.c autopick/autopick-drawer.h \
-       autopick/autopick-searcher.c autopick/autopick-searcher.h \
        autopick/autopick-inserter-killer.c autopick/autopick-inserter-killer.h \
        autopick/autopick-registry.c autopick/autopick-registry.h \
        autopick/autopick-command-menu.c autopick/autopick-command-menu.h \
index 905aa2f..3eae72d 100644 (file)
@@ -15,7 +15,7 @@
 #include "autopick/autopick-methods-table.h"
 #include "autopick/autopick-reader-writer.h"
 #include "autopick/autopick-inserter-killer.h"
-#include "autopick/autopick-searcher.h"
+#include "autopick/autopick-finder.h"
 #include "autopick/autopick-entry.h"
 #include "autopick/autopick-drawer.h"
 #include "gameterm.h"
index 1254178..58fdfb5 100644 (file)
@@ -1,8 +1,18 @@
+/*!
+ * todo get_string_for_search() \82Í\92·\82¢\81A\97v\95ª\8a\84
+ * @brief \8e©\93®\8fE\82¢\82Ì\8c\9f\8dõ
+ * @date 2020/04/26
+ * @author Hourier
+ */
+
 #include "angband.h"
 #include "autopick/autopick-finder.h"
-#include "autopick/autopick-util.h"
+#include "autopick/autopick-dirty-flags.h"
+#include "autopick/autopick-entry.h"
 #include "autopick/autopick-matcher.h"
 #include "object-flavor.h"
+#include "gameterm.h"
+#include "player-inventory.h"
 
 /*
  * @brief \97^\82¦\82ç\82ê\82½\83A\83C\83e\83\80\82ª\8e©\93®\8fE\82¢\82Ì\83\8a\83X\83g\82É\93o\98^\82³\82ê\82Ä\82¢\82é\82©\82Ç\82¤\82©\82ð\8c\9f\8dõ\82·\82é
@@ -29,3 +39,358 @@ int find_autopick_list(player_type *player_ptr, object_type *o_ptr)
 
        return -1;
 }
+
+
+/*
+ * Choose an item for search
+ */
+bool get_object_for_search(player_type *player_ptr, object_type **o_handle, concptr *search_strp)
+{
+       concptr q = _("\82Ç\82Ì\83A\83C\83e\83\80\82ð\8c\9f\8dõ\82µ\82Ü\82·\82©? ", "Enter which item? ");
+       concptr s = _("\83A\83C\83e\83\80\82ð\8e\9d\82Á\82Ä\82¢\82È\82¢\81B", "You have nothing to enter.");
+       object_type *o_ptr;
+       o_ptr = choose_object(player_ptr, NULL, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP, 0);
+       if (!o_ptr) return FALSE;
+
+       *o_handle = o_ptr;
+       string_free(*search_strp);
+       char buf[MAX_NLEN + 20];
+       object_desc(player_ptr, buf, *o_handle, (OD_NO_FLAVOR | OD_OMIT_PREFIX | OD_NO_PLURAL));
+       *search_strp = string_make(format("<%s>", buf));
+       return TRUE;
+}
+
+
+/*
+ * Prepare for search by destroyed object
+ */
+bool get_destroyed_object_for_search(player_type *player_ptr, object_type **o_handle, concptr *search_strp)
+{
+       if (!autopick_last_destroyed_object.k_idx) return FALSE;
+
+       *o_handle = &autopick_last_destroyed_object;
+       string_free(*search_strp);
+       char buf[MAX_NLEN + 20];
+       object_desc(player_ptr, buf, *o_handle, (OD_NO_FLAVOR | OD_OMIT_PREFIX | OD_NO_PLURAL));
+       *search_strp = string_make(format("<%s>", buf));
+       return TRUE;
+}
+
+
+/*
+ * Choose an item or string for search
+ */
+byte get_string_for_search(player_type *player_ptr, object_type **o_handle, concptr *search_strp)
+{
+       /*
+        * Text color
+        * TERM_YELLOW : Overwrite mode
+        * TERM_WHITE : Insert mode
+        */
+       byte color = TERM_YELLOW;
+       char buf[MAX_NLEN + 20];
+       const int len = 80;
+       char prompt[] = _("\8c\9f\8dõ(^I:\8e\9d\82¿\95¨ ^L:\94j\89ó\82³\82ê\82½\95¨): ", "Search key(^I:inven ^L:destroyed): ");
+       int col = sizeof(prompt) - 1;
+       if (*search_strp) strcpy(buf, *search_strp);
+       else buf[0] = '\0';
+
+       if (*o_handle) color = TERM_L_GREEN;
+
+       prt(prompt, 0, 0);
+       int pos = 0;
+       while (TRUE)
+       {
+               bool back = FALSE;
+               Term_erase(col, 0, 255);
+               Term_putstr(col, 0, -1, color, buf);
+               Term_gotoxy(col + pos, 0);
+
+               int skey = inkey_special(TRUE);
+               switch (skey)
+               {
+               case SKEY_LEFT:
+               case KTRL('b'):
+               {
+                       int i = 0;
+                       color = TERM_WHITE;
+                       if (pos == 0) break;
+
+                       while (TRUE)
+                       {
+                               int next_pos = i + 1;
+
+#ifdef JP
+                               if (iskanji(buf[i])) next_pos++;
+#endif
+                               if (next_pos >= pos) break;
+
+                               i = next_pos;
+                       }
+
+                       pos = i;
+                       break;
+               }
+
+               case SKEY_RIGHT:
+               case KTRL('f'):
+                       color = TERM_WHITE;
+                       if ('\0' == buf[pos]) break;
+
+#ifdef JP
+                       if (iskanji(buf[pos])) pos += 2;
+                       else pos++;
+#else
+                       pos++;
+#endif
+                       break;
+
+               case ESCAPE:
+                       return 0;
+
+               case KTRL('r'):
+                       back = TRUE;
+                       /* Fall through */
+
+               case '\n':
+               case '\r':
+               case KTRL('s'):
+                       if (*o_handle) return (back ? -1 : 1);
+                       string_free(*search_strp);
+                       *search_strp = string_make(buf);
+                       *o_handle = NULL;
+                       return (back ? -1 : 1);
+
+               case KTRL('i'):
+                       return get_object_for_search(player_ptr, o_handle, search_strp);
+
+               case KTRL('l'):
+                       if (get_destroyed_object_for_search(player_ptr, o_handle, search_strp))
+                               return 1;
+                       break;
+
+               case '\010':
+               {
+                       int i = 0;
+                       color = TERM_WHITE;
+                       if (pos == 0) break;
+
+                       while (TRUE)
+                       {
+                               int next_pos = i + 1;
+#ifdef JP
+                               if (iskanji(buf[i])) next_pos++;
+#endif
+                               if (next_pos >= pos) break;
+
+                               i = next_pos;
+                       }
+
+                       pos = i;
+               }
+               /* Fall through */
+
+               case 0x7F:
+               case KTRL('d'):
+               {
+                       int dst, src;
+                       color = TERM_WHITE;
+                       if (buf[pos] == '\0') break;
+
+                       src = pos + 1;
+#ifdef JP
+                       if (iskanji(buf[pos])) src++;
+#endif
+                       dst = pos;
+                       while ('\0' != (buf[dst++] = buf[src++]));
+
+                       break;
+               }
+
+               default:
+               {
+                       char tmp[100];
+                       char c;
+                       if (skey & SKEY_MASK) break;
+
+                       c = (char)skey;
+                       if (color != TERM_WHITE)
+                       {
+                               if (color == TERM_L_GREEN)
+                               {
+                                       *o_handle = NULL;
+                                       string_free(*search_strp);
+                                       *search_strp = NULL;
+                               }
+
+                               buf[0] = '\0';
+                               color = TERM_WHITE;
+                       }
+
+                       strcpy(tmp, buf + pos);
+#ifdef JP
+                       if (iskanji(c))
+                       {
+                               char next;
+                               inkey_base = TRUE;
+                               next = inkey();
+
+                               if (pos + 1 < len)
+                               {
+                                       buf[pos++] = c;
+                                       buf[pos++] = next;
+                               }
+                               else
+                               {
+                                       bell();
+                               }
+                       }
+                       else
+#endif
+                       {
+#ifdef JP
+                               if (pos < len && (isprint(c) || iskana(c)))
+#else
+                               if (pos < len && isprint(c))
+#endif
+                               {
+                                       buf[pos++] = c;
+                               }
+                               else
+                               {
+                                       bell();
+                               }
+                       }
+
+                       buf[pos] = '\0';
+                       my_strcat(buf, tmp, len + 1);
+
+                       break;
+               }
+               }
+
+               if (*o_handle == NULL || color == TERM_L_GREEN) continue;
+
+               *o_handle = NULL;
+               buf[0] = '\0';
+               string_free(*search_strp);
+               *search_strp = NULL;
+       }
+}
+
+
+/*
+ * Search next line matches for o_ptr
+ */
+void search_for_object(player_type *player_ptr, text_body_type *tb, object_type *o_ptr, bool forward)
+{
+       autopick_type an_entry, *entry = &an_entry;
+       GAME_TEXT o_name[MAX_NLEN];
+       int bypassed_cy = -1;
+       int i = tb->cy;
+       object_desc(player_ptr, o_name, o_ptr, (OD_NO_FLAVOR | OD_OMIT_PREFIX | OD_NO_PLURAL));
+       str_tolower(o_name);
+
+       while (TRUE)
+       {
+               bool match;
+               if (forward)
+               {
+                       if (!tb->lines_list[++i]) break;
+               }
+               else
+               {
+                       if (--i < 0) break;
+               }
+
+               if (!autopick_new_entry(entry, tb->lines_list[i], FALSE)) continue;
+
+               match = is_autopick_match(player_ptr, o_ptr, entry, o_name);
+               autopick_free_entry(entry);
+               if (!match)     continue;
+
+               if (tb->states[i] & LSTAT_BYPASS)
+               {
+                       if (bypassed_cy == -1) bypassed_cy = i;
+                       continue;
+               }
+
+               tb->cx = 0;
+               tb->cy = i;
+               if (bypassed_cy != -1)
+               {
+                       tb->dirty_flags |= DIRTY_SKIP_INACTIVE;
+               }
+
+               return;
+       }
+
+       if (bypassed_cy == -1)
+       {
+               tb->dirty_flags |= DIRTY_NOT_FOUND;
+               return;
+       }
+
+       tb->cx = 0;
+       tb->cy = bypassed_cy;
+       tb->dirty_flags |= DIRTY_INACTIVE;
+}
+
+
+/*
+ * Search next line matches to the string
+ */
+void search_for_string(text_body_type *tb, concptr search_str, bool forward)
+{
+       int bypassed_cy = -1;
+       int bypassed_cx = 0;
+
+       int i = tb->cy;
+       while (TRUE)
+       {
+               concptr pos;
+               if (forward)
+               {
+                       if (!tb->lines_list[++i]) break;
+               }
+               else
+               {
+                       if (--i < 0) break;
+               }
+
+               pos = my_strstr(tb->lines_list[i], search_str);
+               if (!pos) continue;
+
+               if ((tb->states[i] & LSTAT_BYPASS) &&
+                       !(tb->states[i] & LSTAT_EXPRESSION))
+               {
+                       if (bypassed_cy == -1)
+                       {
+                               bypassed_cy = i;
+                               bypassed_cx = (int)(pos - tb->lines_list[i]);
+                       }
+
+                       continue;
+               }
+
+               tb->cx = (int)(pos - tb->lines_list[i]);
+               tb->cy = i;
+
+               if (bypassed_cy != -1)
+               {
+                       tb->dirty_flags |= DIRTY_SKIP_INACTIVE;
+               }
+
+               return;
+       }
+
+       if (bypassed_cy == -1)
+       {
+               tb->dirty_flags |= DIRTY_NOT_FOUND;
+               return;
+       }
+
+       tb->cx = bypassed_cx;
+       tb->cy = bypassed_cy;
+       tb->dirty_flags |= DIRTY_INACTIVE;
+}
index 28213a2..c4d05ae 100644 (file)
@@ -1,3 +1,10 @@
 #pragma once
 
+#include "autopick/autopick-util.h"
+
 int find_autopick_list(player_type *player_ptr, object_type *o_ptr);
+bool get_object_for_search(player_type *player_ptr, object_type **o_handle, concptr *search_strp);
+bool get_destroyed_object_for_search(player_type *player_ptr, object_type **o_handle, concptr *search_strp);
+byte get_string_for_search(player_type *player_ptr, object_type **o_handle, concptr *search_strp);
+void search_for_object(player_type *player_ptr, text_body_type *tb, object_type *o_ptr, bool forward);
+void search_for_string(text_body_type *tb, concptr search_str, bool forward);
diff --git a/src/autopick/autopick-searcher.c b/src/autopick/autopick-searcher.c
deleted file mode 100644 (file)
index eb1b0e9..0000000
+++ /dev/null
@@ -1,370 +0,0 @@
-/*!
- * todo get_string_for_search() は長い、要分割
- * @brief 自動拾いの検索
- * @date 2020/04/26
- * @author Hourier
- */
-
-#include "angband.h"
-#include "autopick/autopick-util.h"
-#include "autopick/autopick-searcher.h"
-#include "autopick/autopick-dirty-flags.h"
-#include "autopick/autopick-entry.h"
-#include "autopick/autopick-matcher.h"
-#include "object-flavor.h"
-#include "gameterm.h"
-#include "player-inventory.h"
-
-/*
- * Choose an item for search
- */
-bool get_object_for_search(player_type *player_ptr, object_type **o_handle, concptr *search_strp)
-{
-       concptr q = _("どのアイテムを検索しますか? ", "Enter which item? ");
-       concptr s = _("アイテムを持っていない。", "You have nothing to enter.");
-       object_type *o_ptr;
-       o_ptr = choose_object(player_ptr, NULL, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP, 0);
-       if (!o_ptr) return FALSE;
-
-       *o_handle = o_ptr;
-       string_free(*search_strp);
-       char buf[MAX_NLEN + 20];
-       object_desc(player_ptr, buf, *o_handle, (OD_NO_FLAVOR | OD_OMIT_PREFIX | OD_NO_PLURAL));
-       *search_strp = string_make(format("<%s>", buf));
-       return TRUE;
-}
-
-
-/*
- * Prepare for search by destroyed object
- */
-bool get_destroyed_object_for_search(player_type *player_ptr, object_type **o_handle, concptr *search_strp)
-{
-       if (!autopick_last_destroyed_object.k_idx) return FALSE;
-
-       *o_handle = &autopick_last_destroyed_object;
-       string_free(*search_strp);
-       char buf[MAX_NLEN + 20];
-       object_desc(player_ptr, buf, *o_handle, (OD_NO_FLAVOR | OD_OMIT_PREFIX | OD_NO_PLURAL));
-       *search_strp = string_make(format("<%s>", buf));
-       return TRUE;
-}
-
-
-/*
- * Choose an item or string for search
- */
-byte get_string_for_search(player_type *player_ptr, object_type **o_handle, concptr *search_strp)
-{
-       /*
-        * Text color
-        * TERM_YELLOW : Overwrite mode
-        * TERM_WHITE : Insert mode
-        */
-       byte color = TERM_YELLOW;
-       char buf[MAX_NLEN + 20];
-       const int len = 80;
-       char prompt[] = _("検索(^I:持ち物 ^L:破壊された物): ", "Search key(^I:inven ^L:destroyed): ");
-       int col = sizeof(prompt) - 1;
-       if (*search_strp) strcpy(buf, *search_strp);
-       else buf[0] = '\0';
-
-       if (*o_handle) color = TERM_L_GREEN;
-
-       prt(prompt, 0, 0);
-       int pos = 0;
-       while (TRUE)
-       {
-               bool back = FALSE;
-               Term_erase(col, 0, 255);
-               Term_putstr(col, 0, -1, color, buf);
-               Term_gotoxy(col + pos, 0);
-
-               int skey = inkey_special(TRUE);
-               switch (skey)
-               {
-               case SKEY_LEFT:
-               case KTRL('b'):
-               {
-                       int i = 0;
-                       color = TERM_WHITE;
-                       if (pos == 0) break;
-
-                       while (TRUE)
-                       {
-                               int next_pos = i + 1;
-
-#ifdef JP
-                               if (iskanji(buf[i])) next_pos++;
-#endif
-                               if (next_pos >= pos) break;
-
-                               i = next_pos;
-                       }
-
-                       pos = i;
-                       break;
-               }
-
-               case SKEY_RIGHT:
-               case KTRL('f'):
-                       color = TERM_WHITE;
-                       if ('\0' == buf[pos]) break;
-
-#ifdef JP
-                       if (iskanji(buf[pos])) pos += 2;
-                       else pos++;
-#else
-                       pos++;
-#endif
-                       break;
-
-               case ESCAPE:
-                       return 0;
-
-               case KTRL('r'):
-                       back = TRUE;
-                       /* Fall through */
-
-               case '\n':
-               case '\r':
-               case KTRL('s'):
-                       if (*o_handle) return (back ? -1 : 1);
-                       string_free(*search_strp);
-                       *search_strp = string_make(buf);
-                       *o_handle = NULL;
-                       return (back ? -1 : 1);
-
-               case KTRL('i'):
-                       return get_object_for_search(player_ptr, o_handle, search_strp);
-
-               case KTRL('l'):
-                       if (get_destroyed_object_for_search(player_ptr, o_handle, search_strp))
-                               return 1;
-                       break;
-
-               case '\010':
-               {
-                       int i = 0;
-                       color = TERM_WHITE;
-                       if (pos == 0) break;
-
-                       while (TRUE)
-                       {
-                               int next_pos = i + 1;
-#ifdef JP
-                               if (iskanji(buf[i])) next_pos++;
-#endif
-                               if (next_pos >= pos) break;
-
-                               i = next_pos;
-                       }
-
-                       pos = i;
-               }
-                       /* Fall through */
-
-               case 0x7F:
-               case KTRL('d'):
-               {
-                       int dst, src;
-                       color = TERM_WHITE;
-                       if (buf[pos] == '\0') break;
-
-                       src = pos + 1;
-#ifdef JP
-                       if (iskanji(buf[pos])) src++;
-#endif
-                       dst = pos;
-                       while ('\0' != (buf[dst++] = buf[src++]));
-
-                       break;
-               }
-
-               default:
-               {
-                       char tmp[100];
-                       char c;
-                       if (skey & SKEY_MASK) break;
-
-                       c = (char)skey;
-                       if (color != TERM_WHITE)
-                       {
-                               if (color == TERM_L_GREEN)
-                               {
-                                       *o_handle = NULL;
-                                       string_free(*search_strp);
-                                       *search_strp = NULL;
-                               }
-
-                               buf[0] = '\0';
-                               color = TERM_WHITE;
-                       }
-
-                       strcpy(tmp, buf + pos);
-#ifdef JP
-                       if (iskanji(c))
-                       {
-                               char next;
-                               inkey_base = TRUE;
-                               next = inkey();
-
-                               if (pos + 1 < len)
-                               {
-                                       buf[pos++] = c;
-                                       buf[pos++] = next;
-                               }
-                               else
-                               {
-                                       bell();
-                               }
-                       }
-                       else
-#endif
-                       {
-#ifdef JP
-                               if (pos < len && (isprint(c) || iskana(c)))
-#else
-                               if (pos < len && isprint(c))
-#endif
-                               {
-                                       buf[pos++] = c;
-                               }
-                               else
-                               {
-                                       bell();
-                               }
-                       }
-
-                       buf[pos] = '\0';
-                       my_strcat(buf, tmp, len + 1);
-
-                       break;
-               }
-               }
-
-               if (*o_handle == NULL || color == TERM_L_GREEN) continue;
-
-               *o_handle = NULL;
-               buf[0] = '\0';
-               string_free(*search_strp);
-               *search_strp = NULL;
-       }
-}
-
-
-/*
- * Search next line matches for o_ptr
- */
-void search_for_object(player_type *player_ptr, text_body_type *tb, object_type *o_ptr, bool forward)
-{
-       autopick_type an_entry, *entry = &an_entry;
-       GAME_TEXT o_name[MAX_NLEN];
-       int bypassed_cy = -1;
-       int i = tb->cy;
-       object_desc(player_ptr, o_name, o_ptr, (OD_NO_FLAVOR | OD_OMIT_PREFIX | OD_NO_PLURAL));
-       str_tolower(o_name);
-
-       while (TRUE)
-       {
-               bool match;
-               if (forward)
-               {
-                       if (!tb->lines_list[++i]) break;
-               }
-               else
-               {
-                       if (--i < 0) break;
-               }
-
-               if (!autopick_new_entry(entry, tb->lines_list[i], FALSE)) continue;
-
-               match = is_autopick_match(player_ptr, o_ptr, entry, o_name);
-               autopick_free_entry(entry);
-               if (!match)     continue;
-
-               if (tb->states[i] & LSTAT_BYPASS)
-               {
-                       if (bypassed_cy == -1) bypassed_cy = i;
-                       continue;
-               }
-
-               tb->cx = 0;
-               tb->cy = i;
-               if (bypassed_cy != -1)
-               {
-                       tb->dirty_flags |= DIRTY_SKIP_INACTIVE;
-               }
-
-               return;
-       }
-
-       if (bypassed_cy == -1)
-       {
-               tb->dirty_flags |= DIRTY_NOT_FOUND;
-               return;
-       }
-
-       tb->cx = 0;
-       tb->cy = bypassed_cy;
-       tb->dirty_flags |= DIRTY_INACTIVE;
-}
-
-
-/*
- * Search next line matches to the string
- */
-void search_for_string(text_body_type *tb, concptr search_str, bool forward)
-{
-       int bypassed_cy = -1;
-       int bypassed_cx = 0;
-
-       int i = tb->cy;
-       while (TRUE)
-       {
-               concptr pos;
-               if (forward)
-               {
-                       if (!tb->lines_list[++i]) break;
-               }
-               else
-               {
-                       if (--i < 0) break;
-               }
-
-               pos = my_strstr(tb->lines_list[i], search_str);
-               if (!pos) continue;
-
-               if ((tb->states[i] & LSTAT_BYPASS) &&
-                       !(tb->states[i] & LSTAT_EXPRESSION))
-               {
-                       if (bypassed_cy == -1)
-                       {
-                               bypassed_cy = i;
-                               bypassed_cx = (int)(pos - tb->lines_list[i]);
-                       }
-
-                       continue;
-               }
-
-               tb->cx = (int)(pos - tb->lines_list[i]);
-               tb->cy = i;
-
-               if (bypassed_cy != -1)
-               {
-                       tb->dirty_flags |= DIRTY_SKIP_INACTIVE;
-               }
-
-               return;
-       }
-
-       if (bypassed_cy == -1)
-       {
-               tb->dirty_flags |= DIRTY_NOT_FOUND;
-               return;
-       }
-
-       tb->cx = bypassed_cx;
-       tb->cy = bypassed_cy;
-       tb->dirty_flags |= DIRTY_INACTIVE;
-}
diff --git a/src/autopick/autopick-searcher.h b/src/autopick/autopick-searcher.h
deleted file mode 100644 (file)
index 77286a9..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#pragma once
-
-bool get_object_for_search(player_type *player_ptr, object_type **o_handle, concptr *search_strp);
-bool get_destroyed_object_for_search(player_type *player_ptr, object_type **o_handle, concptr *search_strp);
-byte get_string_for_search(player_type *player_ptr, object_type **o_handle, concptr *search_strp);
-void search_for_object(player_type *player_ptr, text_body_type *tb, object_type *o_ptr, bool forward);
-void search_for_string(text_body_type *tb, concptr search_str, bool forward);