[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Gavin D. Smith |
Date: |
Wed, 16 Mar 2022 16:35:34 -0400 (EDT) |
branch: master
commit 0d981efa16c4f44ee06084afb3d1bf7d6762d078
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Wed Mar 16 19:05:23 2022 +0000
Move functions
* info/info-utils.c, info/session.c
(struct info_namelist_entry, info_namelist_add, info_namelist_free):
Move to session.c as this is the only place these are used.
---
ChangeLog | 8 ++++++++
info/info-utils.c | 32 --------------------------------
info/info-utils.h | 4 ----
info/session.c | 33 +++++++++++++++++++++++++++++++++
4 files changed, 41 insertions(+), 36 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 19dc951dbb..3241b07ba9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2022-03-16 Gavin Smith <gavinsmith0123@gmail.com>
+
+ Move functions
+
+ * info/info-utils.c, info/session.c
+ (struct info_namelist_entry, info_namelist_add, info_namelist_free):
+ Move to session.c as this is the only place these are used.
+
2022-03-13 Gavin Smith <gavinsmith0123@gmail.com>
Top node ends at @part.
diff --git a/info/info-utils.c b/info/info-utils.c
index e692183020..8d52bb6006 100644
--- a/info/info-utils.c
+++ b/info/info-utils.c
@@ -2028,36 +2028,4 @@ fncmp (const char *fn1, const char *fn2)
}
#endif
-struct info_namelist_entry
-{
- struct info_namelist_entry *next;
- char name[1];
-};
-
-int
-info_namelist_add (struct info_namelist_entry **ptop, const char *name)
-{
- struct info_namelist_entry *p;
-
- for (p = *ptop; p; p = p->next)
- if (fncmp (p->name, name) == 0)
- return 1;
-
- p = xmalloc (sizeof (*p) + strlen (name));
- strcpy (p->name, name);
- p->next = *ptop;
- *ptop = p;
- return 0;
-}
-
-void
-info_namelist_free (struct info_namelist_entry *top)
-{
- while (top)
- {
- struct info_namelist_entry *next = top->next;
- free (top);
- top = next;
- }
-}
diff --git a/info/info-utils.h b/info/info-utils.h
index 75f65de704..25748ffb5f 100644
--- a/info/info-utils.h
+++ b/info/info-utils.h
@@ -132,10 +132,6 @@ size_t text_buffer_printf (struct text_buffer *buf, const
char *format, ...);
#define text_buffer_base(buf) ((buf)->base)
#define text_buffer_off(buf) ((buf)->off)
-struct info_namelist_entry;
-int info_namelist_add (struct info_namelist_entry **ptop, const char *name);
-void info_namelist_free (struct info_namelist_entry *top);
-
#if defined(__MSDOS__) || defined(__MINGW32__)
int fncmp (const char *fn1, const char *fn2);
#else
diff --git a/info/session.c b/info/session.c
index fdf5a47b7d..6cbad3ce92 100644
--- a/info/session.c
+++ b/info/session.c
@@ -3689,6 +3689,39 @@ DECLARE_INFO_COMMAND (info_view_file, _("Read the name
of a file and select it")
/* */
/* **************************************************************** */
+struct info_namelist_entry
+{
+ struct info_namelist_entry *next;
+ char name[1];
+};
+
+static int
+info_namelist_add (struct info_namelist_entry **ptop, const char *name)
+{
+ struct info_namelist_entry *p;
+
+ for (p = *ptop; p; p = p->next)
+ if (fncmp (p->name, name) == 0)
+ return 1;
+
+ p = xmalloc (sizeof (*p) + strlen (name));
+ strcpy (p->name, name);
+ p->next = *ptop;
+ *ptop = p;
+ return 0;
+}
+
+static void
+info_namelist_free (struct info_namelist_entry *top)
+{
+ while (top)
+ {
+ struct info_namelist_entry *next = top->next;
+ free (top);
+ top = next;
+ }
+}
+
enum
{
DUMP_SUCCESS,