OSDN Git Service

[Refactor] #39964 Moved free_text_lines() from autopick.c to autpick-util.c/h
authorHourier <hourier@users.sourceforge.jp>
Sat, 25 Apr 2020 12:47:12 +0000 (21:47 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sat, 25 Apr 2020 12:47:12 +0000 (21:47 +0900)
src/autopick/autopick-util.c
src/autopick/autopick-util.h
src/autopick/autopick.c

index 789ec2a..644494c 100644 (file)
@@ -26,3 +26,18 @@ void autopick_free_entry(autopick_type *entry)
        entry->name = NULL;
        entry->insc = NULL;
 }
+
+
+/*
+ * Free memory of lines_list.
+ */
+void free_text_lines(concptr *lines_list)
+{
+       for (int lines = 0; lines_list[lines]; lines++)
+       {
+               string_free(lines_list[lines]);
+       }
+
+       /* free list of pointers */
+       C_KILL(lines_list, MAX_LINES, concptr);
+}
index ba9ecaa..61fe36d 100644 (file)
@@ -1,15 +1,13 @@
 #pragma once
 
 #define MAX_LINELEN 1024
-
 #define MAX_AUTOPICK_DEFAULT 200
+#define MAX_YANK MAX_LINELEN
+#define MAX_LINES 3000
 
 #define PT_DEFAULT 0
 #define PT_WITH_PNAME 1
 
-#define MAX_YANK MAX_LINELEN
-#define MAX_LINES 3000
-
 #define MARK_MARK     0x01
 #define MARK_BY_SHIFT 0x02
 
@@ -90,3 +88,4 @@ extern autopick_type *autopick_list;
 extern object_type autopick_last_destroyed_object;
 
 void autopick_free_entry(autopick_type *entry);
+void free_text_lines(concptr *lines_list);
index 253ff08..1797ca1 100644 (file)
@@ -666,21 +666,6 @@ static bool write_text_lines(concptr filename, concptr *lines_list)
 
 
 /*
- * Free memory of lines_list.
- */
-static void free_text_lines(concptr *lines_list)
-{
-       for (int lines = 0; lines_list[lines]; lines++)
-       {
-               string_free(lines_list[lines]);
-       }
-
-       /* free list of pointers */
-       C_KILL(lines_list, MAX_LINES, concptr);
-}
-
-
-/*
  * Delete or insert string
  */
 static void toggle_keyword(text_body_type *tb, BIT_FLAGS flg)