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/manipulate_tree.c (protect_c


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/main/manipulate_tree.c (protect_colon) (protect_colon_in_tree, protect_comma, protect_comma_in_tree) (protect_node_after_label, protect_node_after_label_in_tree), tp/Texinfo/XS/structuring_transfo/structuring.c, tp/Texinfo/XS/structuring_transfo/transformations.c: move functions calling protect_text and modify_tree out of structuring.c and transformations.c to manipulate_tree.c.
Date: Sat, 13 Apr 2024 17:03:07 -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 cb27d87e79 * tp/Texinfo/XS/main/manipulate_tree.c (protect_colon) 
(protect_colon_in_tree, protect_comma, protect_comma_in_tree) 
(protect_node_after_label, protect_node_after_label_in_tree), 
tp/Texinfo/XS/structuring_transfo/structuring.c, 
tp/Texinfo/XS/structuring_transfo/transformations.c: move functions calling 
protect_text and modify_tree out of structuring.c and transformations.c to 
manipulate_tree.c.
cb27d87e79 is described below

commit cb27d87e79d8fd814f7b2680e91585a481d18e9f
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Apr 13 23:02:15 2024 +0200

    * tp/Texinfo/XS/main/manipulate_tree.c (protect_colon)
    (protect_colon_in_tree, protect_comma, protect_comma_in_tree)
    (protect_node_after_label, protect_node_after_label_in_tree),
    tp/Texinfo/XS/structuring_transfo/structuring.c,
    tp/Texinfo/XS/structuring_transfo/transformations.c: move functions
    calling protect_text and modify_tree out of structuring.c and
    transformations.c to manipulate_tree.c.
---
 ChangeLog                                          | 10 +++++
 tp/Texinfo/XS/main/manipulate_tree.c               | 45 ++++++++++++++++++++--
 tp/Texinfo/XS/main/manipulate_tree.h               |  4 +-
 tp/Texinfo/XS/structuring_transfo/structuring.c    | 16 +-------
 tp/Texinfo/XS/structuring_transfo/structuring.h    |  1 -
 .../XS/structuring_transfo/transformations.c       | 28 ++------------
 .../XS/structuring_transfo/transformations.h       |  2 -
 7 files changed, 59 insertions(+), 47 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9b19db4a95..2e5203f31d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,16 @@
 
        * README-hacking: use suppressions file for valgrind
 
+2024-04-13  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/main/manipulate_tree.c (protect_colon)
+       (protect_colon_in_tree, protect_comma, protect_comma_in_tree)
+       (protect_node_after_label, protect_node_after_label_in_tree),
+       tp/Texinfo/XS/structuring_transfo/structuring.c,
+       tp/Texinfo/XS/structuring_transfo/transformations.c: move functions
+       calling protect_text and modify_tree out of structuring.c and
+       transformations.c to manipulate_tree.c.
+
 2024-04-13  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/ManipulateTree.pm, tp/Texinfo/Common.pm,
diff --git a/tp/Texinfo/XS/main/manipulate_tree.c 
b/tp/Texinfo/XS/main/manipulate_tree.c
index bb9ce64924..eacce54cd9 100644
--- a/tp/Texinfo/XS/main/manipulate_tree.c
+++ b/tp/Texinfo/XS/main/manipulate_tree.c
@@ -13,6 +13,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
+/* Corresponding Perl code is mainly in Texinfo::ManipulateTree */
+
 #include <config.h>
 #include <stddef.h>
 #include <string.h>
@@ -33,8 +35,6 @@
 #include "manipulate_tree.h"
 #include "unicode.h"
 
-/* copy_tree from Texinfo::Common */
-
 ELEMENT *
 copy_tree_internal (ELEMENT* current, ELEMENT *parent);
 
@@ -425,6 +425,7 @@ remove_from_source_mark_list (SOURCE_MARK_LIST *list, 
size_t where)
   return removed;
 }
 
+/* In Texinfo::Common */
 /* relocate SOURCE_MARKS source marks with position between
    BEGIN_POSITION and BEGIN_POSITION + LEN to be relative to BEGIN_POSITION,
    and move to element E.
@@ -498,6 +499,7 @@ relocate_source_marks (SOURCE_MARK_LIST *source_mark_list, 
ELEMENT *new_e,
 
 
 
+/* In Texinfo::Common */
 /* NODE->contents is the Texinfo for the specification of a node.  This
    function sets two fields on the returned object:
 
@@ -775,7 +777,6 @@ parse_node_manual (ELEMENT *node, int modify_node)
 
 
 
-/* in Common.pm */
 ELEMENT *
 modify_tree (ELEMENT *tree,
              ELEMENT_LIST *(*operation)(const char *type, ELEMENT *element, 
void* argument),
@@ -863,7 +864,7 @@ new_asis_command_with_text (const char *text, ELEMENT 
*parent,
   return new_command;
 }
 
-ELEMENT_LIST *
+static ELEMENT_LIST *
 protect_text (ELEMENT *current, const char *to_protect)
 {
   if (current->text.end > 0 && !(current->type == ET_raw
@@ -976,6 +977,42 @@ protect_text (ELEMENT *current, const char *to_protect)
     return 0;
 }
 
+static ELEMENT_LIST *
+protect_colon (const char *type, ELEMENT *current, void *argument)
+{
+  return protect_text (current, ":");
+}
+
+ELEMENT *
+protect_colon_in_tree (ELEMENT *tree)
+{
+  return modify_tree (tree, &protect_colon, 0);
+}
+
+static ELEMENT_LIST *
+protect_comma (const char *type, ELEMENT *current, void *argument)
+{
+  return protect_text (current, ",");
+}
+
+ELEMENT *
+protect_comma_in_tree (ELEMENT *tree)
+{
+  return modify_tree (tree, &protect_comma, 0);
+}
+
+static ELEMENT_LIST *
+protect_node_after_label (const char *type, ELEMENT *current, void *argument)
+{
+  return protect_text (current, ".\t,");
+}
+
+ELEMENT *
+protect_node_after_label_in_tree (ELEMENT *tree)
+{
+  return modify_tree (tree, &protect_node_after_label, 0);
+}
+
 
 
 const char *
diff --git a/tp/Texinfo/XS/main/manipulate_tree.h 
b/tp/Texinfo/XS/main/manipulate_tree.h
index b24aa1c0fe..59b9ed345b 100644
--- a/tp/Texinfo/XS/main/manipulate_tree.h
+++ b/tp/Texinfo/XS/main/manipulate_tree.h
@@ -43,7 +43,9 @@ ELEMENT *modify_tree (ELEMENT *tree,
 ELEMENT *new_asis_command_with_text (const char *text, ELEMENT *parent,
                                      enum element_type type);
 
-ELEMENT_LIST *protect_text (ELEMENT *current, const char *to_protect);
+ELEMENT *protect_colon_in_tree (ELEMENT *tree);
+ELEMENT *protect_comma_in_tree (ELEMENT *tree);
+ELEMENT *protect_node_after_label_in_tree (ELEMENT *tree);
 
 
 
diff --git a/tp/Texinfo/XS/structuring_transfo/structuring.c 
b/tp/Texinfo/XS/structuring_transfo/structuring.c
index 3d9713f338..c1ade41fe6 100644
--- a/tp/Texinfo/XS/structuring_transfo/structuring.c
+++ b/tp/Texinfo/XS/structuring_transfo/structuring.c
@@ -33,7 +33,8 @@
 /* for get_label_element section_level enumerate_item_representation
    xasprintf */
 #include "utils.h"
-/* for copy_tree copy_contents parse_node_manual modify_tree protect_text */
+/* for copy_tree copy_contents parse_node_manual
+   protect_colon_in_tree */
 #include "manipulate_tree.h"
 #include "command_stack.h"
 #include "node_name_normalization.h"
@@ -2179,19 +2180,6 @@ new_master_menu (ERROR_MESSAGE_LIST *error_messages,
     }
 }
 
-/* In Texinfo::Common */
-static ELEMENT_LIST *
-protect_colon (const char *type, ELEMENT *current, void *argument)
-{
-  return protect_text(current, ":");
-}
-
-ELEMENT *
-protect_colon_in_tree (ELEMENT *tree)
-{
-  return modify_tree (tree, &protect_colon, 0);
-}
-
 ELEMENT *
 new_complete_menu_master_menu (ERROR_MESSAGE_LIST *error_messages,
                                const OPTIONS *options,
diff --git a/tp/Texinfo/XS/structuring_transfo/structuring.h 
b/tp/Texinfo/XS/structuring_transfo/structuring.h
index 82e3a44dce..998828a8e9 100644
--- a/tp/Texinfo/XS/structuring_transfo/structuring.h
+++ b/tp/Texinfo/XS/structuring_transfo/structuring.h
@@ -29,6 +29,5 @@ ELEMENT *new_complete_menu_master_menu (ERROR_MESSAGE_LIST 
*error_messages,
                                const OPTIONS *options,
                                const LABEL_LIST *identifiers_target,
                                const ELEMENT *node);
-ELEMENT *protect_colon_in_tree (ELEMENT *tree);
 
 #endif
diff --git a/tp/Texinfo/XS/structuring_transfo/transformations.c 
b/tp/Texinfo/XS/structuring_transfo/transformations.c
index 0b219f7c5b..607285b157 100644
--- a/tp/Texinfo/XS/structuring_transfo/transformations.c
+++ b/tp/Texinfo/XS/structuring_transfo/transformations.c
@@ -37,7 +37,8 @@
 #include "debug.h"
 #include "utils.h"
 /* for copy_contents normalized_menu_entry_internal_node modify_tree
-   protect_text new_asis_command_with_text */
+   protect_colon_in_tree new_asis_command_with_text
+   protect_comma_in_tree protect_node_after_label_in_tree */
 #include "manipulate_tree.h"
 #include "structuring.h"
 #include "convert_to_texinfo.h"
@@ -75,6 +76,7 @@ lookup_index_entry (ELEMENT *index_entry_info, INDEX 
**indices_information)
   return result;
 }
 
+/* In Texinfo::ManipulateTree */
 void
 protect_first_parenthesis (ELEMENT *element)
 {
@@ -1262,30 +1264,6 @@ regenerate_master_menu (DOCUMENT *document, int 
use_sections)
   return 1;
 }
 
-ELEMENT_LIST *
-protect_comma (const char *type, ELEMENT *current, void *argument)
-{
-  return protect_text (current, ",");
-}
-
-ELEMENT *
-protect_comma_in_tree (ELEMENT *tree)
-{
-  return modify_tree (tree, &protect_comma, 0);
-}
-
-ELEMENT_LIST *
-protect_node_after_label (const char *type, ELEMENT *current, void *argument)
-{
-  return protect_text (current, ".\t,");
-}
-
-ELEMENT *
-protect_node_after_label_in_tree (ELEMENT *tree)
-{
-  return modify_tree (tree, &protect_node_after_label, 0);
-}
-
 /* NOTE in perl there is a customization_information, but here we use the
    document for error registration and customization */
 ELEMENT_LIST *
diff --git a/tp/Texinfo/XS/structuring_transfo/transformations.h 
b/tp/Texinfo/XS/structuring_transfo/transformations.h
index ff7397200c..384faf25cd 100644
--- a/tp/Texinfo/XS/structuring_transfo/transformations.h
+++ b/tp/Texinfo/XS/structuring_transfo/transformations.h
@@ -11,8 +11,6 @@ void relate_index_entries_to_table_items_in_tree (ELEMENT 
*tree,
                                     INDEX **indices_information);
 void move_index_entries_after_items_in_tree (ELEMENT *tree);
 ELEMENT *reference_to_arg_in_tree (ELEMENT *tree, DOCUMENT *document);
-ELEMENT *protect_comma_in_tree (ELEMENT *tree);
-ELEMENT *protect_node_after_label_in_tree (ELEMENT *tree);
 void complete_tree_nodes_menus (const ELEMENT *root, int use_sections);
 void complete_tree_nodes_missing_menu (DOCUMENT *document, int use_sections);
 int regenerate_master_menu (DOCUMENT *document, int use_sections);



reply via email to

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