texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * tp/Texinfo/XS/main/utils.c (wipe_values), tp/Te


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/main/utils.c (wipe_values), tp/Texinfo/XS/parsetexi/macro.c: move wipe_values to utils.c such that it may be used by files in main.
Date: Wed, 22 May 2024 15:55:59 -0400

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 9539470edb * tp/Texinfo/XS/main/utils.c (wipe_values), 
tp/Texinfo/XS/parsetexi/macro.c: move wipe_values to utils.c such that it may 
be used by files in main.
9539470edb is described below

commit 9539470edb978037eee4090422674e7c4146a71b
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed May 22 21:55:45 2024 +0200

    * tp/Texinfo/XS/main/utils.c (wipe_values),
    tp/Texinfo/XS/parsetexi/macro.c: move wipe_values to utils.c such that
    it may be used by files in main.
---
 ChangeLog                        |  6 ++++++
 tp/Texinfo/XS/main/parser_conf.c |  1 -
 tp/Texinfo/XS/main/utils.c       | 15 +++++++++++++++
 tp/Texinfo/XS/main/utils.h       |  2 ++
 tp/Texinfo/XS/parsetexi/api.c    |  3 ++-
 tp/Texinfo/XS/parsetexi/macro.c  | 14 +-------------
 tp/Texinfo/XS/parsetexi/macro.h  |  1 -
 7 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 13873c75ad..860fb41e58 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-05-22  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/main/utils.c (wipe_values),
+       tp/Texinfo/XS/parsetexi/macro.c: move wipe_values to utils.c such that
+       it may be used by files in main.
+
 2024-05-22  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/main/get_perl_info.c (apply_sv_parser_conf),
diff --git a/tp/Texinfo/XS/main/parser_conf.c b/tp/Texinfo/XS/main/parser_conf.c
index 5924df6893..462e182de0 100644
--- a/tp/Texinfo/XS/main/parser_conf.c
+++ b/tp/Texinfo/XS/main/parser_conf.c
@@ -21,7 +21,6 @@
 #include <string.h>
 
 #include "utils.h"
-#include "macro.h"
 #include "parser_conf.h"
 
 /* Configuration values. */
diff --git a/tp/Texinfo/XS/main/utils.c b/tp/Texinfo/XS/main/utils.c
index d79d1a1741..d9e24ae75f 100644
--- a/tp/Texinfo/XS/main/utils.c
+++ b/tp/Texinfo/XS/main/utils.c
@@ -1055,6 +1055,21 @@ set_output_encoding (OPTIONS *customization_information, 
DOCUMENT *document)
 }
 
 
+/* code related to values used in files not in parsetexi */
+void
+wipe_values (VALUE_LIST *values)
+{
+  size_t i;
+  for (i = 0; i < values->number; i++)
+    {
+      free (values->list[i].name);
+      free (values->list[i].value);
+    }
+  values->number = 0;
+}
+
+
+
 /* code related to document global info used both in parser and other codes */
 void
 delete_global_info (GLOBAL_INFO *global_info_ref)
diff --git a/tp/Texinfo/XS/main/utils.h b/tp/Texinfo/XS/main/utils.h
index fa1d668d8f..e8f1a33c1a 100644
--- a/tp/Texinfo/XS/main/utils.h
+++ b/tp/Texinfo/XS/main/utils.h
@@ -175,6 +175,8 @@ char *to_upper_or_lower_multibyte (const char *text, int 
lower_or_upper);
 int width_multibyte (const char *text);
 int word_bytes_len_multibyte (const char *text);
 
+void wipe_values (VALUE_LIST *values);
+
 void delete_global_info (GLOBAL_INFO *global_info_ref);
 void delete_global_commands (GLOBAL_COMMANDS *global_commands_ref);
 
diff --git a/tp/Texinfo/XS/parsetexi/api.c b/tp/Texinfo/XS/parsetexi/api.c
index 3f5ef3c6b1..de967268d9 100644
--- a/tp/Texinfo/XS/parsetexi/api.c
+++ b/tp/Texinfo/XS/parsetexi/api.c
@@ -32,12 +32,13 @@
 #include "input.h"
 #include "source_marks.h"
 #include "errors.h"
+/* for wipe_values ... */
 #include "utils.h"
 /* for wipe_user_commands */
 #include "commands.h"
 #include "command_stack.h"
 #include "context_stack.h"
-/* for wipe_macros store_value init_values wipe_values */
+/* for wipe_macros store_value init_values */
 #include "macro.h"
 #include "document.h"
 /* for reset_conf */
diff --git a/tp/Texinfo/XS/parsetexi/macro.c b/tp/Texinfo/XS/parsetexi/macro.c
index 02cf77c1e9..400d9d129b 100644
--- a/tp/Texinfo/XS/parsetexi/macro.c
+++ b/tp/Texinfo/XS/parsetexi/macro.c
@@ -20,7 +20,7 @@
 #include <stdio.h>
 
 #include "parser.h"
-/* for isascii_alnum and whitespace_chars */
+/* for isascii_alnum whitespace_chars wipe_values */
 #include "utils.h"
 #include "tree.h"
 #include "tree_types.h"
@@ -1011,18 +1011,6 @@ handle_macro (ELEMENT *current, const char **line_inout, 
enum command_id cmd)
 
 static VALUE_LIST parser_values;
 
-void
-wipe_values (VALUE_LIST *values)
-{
-  size_t i;
-  for (i = 0; i < values->number; i++)
-    {
-      free (values->list[i].name);
-      free (values->list[i].value);
-    }
-  values->number = 0;
-}
-
 /* initialize parsing run values to the configuration values */
 void
 init_values (void)
diff --git a/tp/Texinfo/XS/parsetexi/macro.h b/tp/Texinfo/XS/parsetexi/macro.h
index 71f2900474..05d314d486 100644
--- a/tp/Texinfo/XS/parsetexi/macro.h
+++ b/tp/Texinfo/XS/parsetexi/macro.h
@@ -45,7 +45,6 @@ void wipe_macros (void);
 void store_value (VALUE_LIST *values, const char *name, const char *value);
 char *fetch_value (const char *name);
 void clear_value (const char *name);
-void wipe_values (VALUE_LIST *values);
 void init_values (void);
 void store_parser_value (const char *name, const char *value);
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]