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/tree.c (replace_element_in_l


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/main/tree.c (replace_element_in_list): add.
Date: Mon, 13 Nov 2023 18:35:00 -0500

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 c7187c0d3b * tp/Texinfo/XS/main/tree.c (replace_element_in_list): add.
c7187c0d3b is described below

commit c7187c0d3bc5969a6ac2c6d34b551efe84152d37
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Nov 14 00:34:52 2023 +0100

    * tp/Texinfo/XS/main/tree.c (replace_element_in_list): add.
    
    * tp/Texinfo/XS/convert/convert_html.c (html_get_tree_root_element)
    (prepare_special_units, prepare_footnotes_targets)
    (html_prepare_output_units_global_targets),
    tp/Texinfo/XS/main/build_perl_info.c (build_global_info_tree_info)
    (build_global_commands), tp/Texinfo/XS/main/command_data.awk,
    tp/Texinfo/XS/main/utils.c (delete_global_info)
    (delete_global_commands, get_cmd_global_multi_command)
    (get_cmd_global_uniq_command, get_global_document_command),
    tp/Texinfo/XS/parsetexi/handle_commands.c (handle_line_command)
    (handle_block_command), tp/Texinfo/XS/parsetexi/parser.c
    (register_global_command, store_document),
    tp/Texinfo/XS/structuring_transfo/structuring.c (warn_non_empty_parts)
    (set_menus_node_directions),
    tp/Texinfo/XS/structuring_transfo/transformations.c
    (regenerate_master_menu): use ELEMENT_LIST as container of global multi
    commands, not ELEMENT.
---
 ChangeLog                                          | 22 +++++++++++
 tp/Texinfo/XS/convert/convert_html.c               | 33 ++++++++--------
 tp/Texinfo/XS/main/build_perl_info.c               | 24 +++++------
 tp/Texinfo/XS/main/command_data.awk                |  6 +--
 tp/Texinfo/XS/main/tree.c                          | 20 ++++++----
 tp/Texinfo/XS/main/tree.h                          |  2 +
 tp/Texinfo/XS/main/utils.c                         | 46 ++++++++++++++--------
 tp/Texinfo/XS/main/utils.h                         |  4 +-
 tp/Texinfo/XS/parsetexi/handle_commands.c          |  8 ++--
 tp/Texinfo/XS/parsetexi/parser.c                   | 21 +++++-----
 tp/Texinfo/XS/structuring_transfo/structuring.c    | 10 ++---
 .../XS/structuring_transfo/transformations.c       |  5 +--
 12 files changed, 122 insertions(+), 79 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ac31a2de2d..4a72fc4458 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2023-11-13  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/main/tree.c (replace_element_in_list): add.
+
+       * tp/Texinfo/XS/convert/convert_html.c (html_get_tree_root_element)
+       (prepare_special_units, prepare_footnotes_targets)
+       (html_prepare_output_units_global_targets),
+       tp/Texinfo/XS/main/build_perl_info.c (build_global_info_tree_info)
+       (build_global_commands), tp/Texinfo/XS/main/command_data.awk,
+       tp/Texinfo/XS/main/utils.c (delete_global_info)
+       (delete_global_commands, get_cmd_global_multi_command)
+       (get_cmd_global_uniq_command, get_global_document_command),
+       tp/Texinfo/XS/parsetexi/handle_commands.c (handle_line_command)
+       (handle_block_command), tp/Texinfo/XS/parsetexi/parser.c
+       (register_global_command, store_document),
+       tp/Texinfo/XS/structuring_transfo/structuring.c (warn_non_empty_parts)
+       (set_menus_node_directions),
+       tp/Texinfo/XS/structuring_transfo/transformations.c
+       (regenerate_master_menu): use ELEMENT_LIST as container of global multi
+       commands, not ELEMENT.
+
+
 2023-11-13  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/convert/call_html_perl_function.c
diff --git a/tp/Texinfo/XS/convert/convert_html.c 
b/tp/Texinfo/XS/convert/convert_html.c
index b593f732cf..773bb36b78 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -241,16 +241,15 @@ html_get_tree_root_element (CONVERTER *self, const 
ELEMENT *command,
           const OUTPUT_UNIT_LIST *output_units
              = retrieve_output_units (self->document_units_descriptor);
           if (current->cmd == CM_copying
-              && self->document->global_commands
-                      ->insertcopying.contents.number > 0)
+              && self->document->global_commands->insertcopying.number > 0)
             {
-              const ELEMENT global_insertcopying
+              const ELEMENT_LIST global_insertcopying
                 = self->document->global_commands->insertcopying;
               int i;
-              for (i = 0; i < global_insertcopying.contents.number; i++)
+              for (i = 0; i < global_insertcopying.number; i++)
                 {
                   const ELEMENT *insertcopying
-                      = global_insertcopying.contents.list[i];
+                      = global_insertcopying.list[i];
                   ROOT_AND_UNIT *cur_result = html_get_tree_root_element (self,
                                                 insertcopying, find_container);
                   if (cur_result->output_unit || cur_result->root)
@@ -615,15 +614,15 @@ prepare_special_units (CONVERTER *self, int 
output_units_descriptor,
                     }
                   else if (!strcmp (contents_location, "inline"))
                     {
-                      const ELEMENT *global_command
-                       = get_cmd_global_command (
+                      const ELEMENT_LIST *global_command
+                       = get_cmd_global_multi_command (
                                       self->document->global_commands, cmd);
-                      if (global_command->contents.number > 0)
+                      if (global_command->number > 0)
                         {
                           int i;
-                          for (i = 0; i < global_command->contents.number; i++)
+                          for (i = 0; i < global_command->number; i++)
                             {
-                              const ELEMENT *command = 
global_command->contents.list[i];
+                              const ELEMENT *command = global_command->list[i];
                               ROOT_AND_UNIT *root_unit
                                = html_get_tree_root_element (self, command, 0);
                               if (root_unit->output_unit)
@@ -650,7 +649,7 @@ prepare_special_units (CONVERTER *self, int 
output_units_descriptor,
         }
     }
 
-  if (self->document->global_commands->footnotes.contents.number > 0
+  if (self->document->global_commands->footnotes.number > 0
       && !strcmp(self->conf->footnotestyle, "separate")
       && output_units && output_units->number > 1)
     add_string ("footnotes", do_special);
@@ -1390,13 +1389,13 @@ static const char *docid_base = "DOCF";
 static void
 prepare_footnotes_targets (CONVERTER *self)
 {
-  const ELEMENT *global_footnotes = 
&self->document->global_commands->footnotes;
-  if (global_footnotes->contents.number > 0)
+  const ELEMENT_LIST *global_footnotes = 
&self->document->global_commands->footnotes;
+  if (global_footnotes->number > 0)
     {
       int i;
-      for (i = 0; i < global_footnotes->contents.number; i++)
+      for (i = 0; i < global_footnotes->number; i++)
         {
-          const ELEMENT *footnote = global_footnotes->contents.list[i];
+          const ELEMENT *footnote = global_footnotes->list[i];
           TEXT footid;
           TEXT docid;
           int nr = i+1;
@@ -1506,10 +1505,10 @@ html_prepare_output_units_global_targets (CONVERTER 
*self,
   /* It is always the first printindex, even if it is not output (for example
      it is in @copying and @titlepage, which are certainly wrong constructs).
    */
-  if (self->document->global_commands->printindex.contents.number > 0)
+  if (self->document->global_commands->printindex.number > 0)
     {
       const ELEMENT *printindex
-        = self->document->global_commands->printindex.contents.list[0];
+        = self->document->global_commands->printindex.list[0];
       ROOT_AND_UNIT *root_unit
         = html_get_tree_root_element (self, printindex, 0);
       if (root_unit->output_unit)
diff --git a/tp/Texinfo/XS/main/build_perl_info.c 
b/tp/Texinfo/XS/main/build_perl_info.c
index 384263e275..0e9ebb76d2 100644
--- a/tp/Texinfo/XS/main/build_perl_info.c
+++ b/tp/Texinfo/XS/main/build_perl_info.c
@@ -900,14 +900,14 @@ build_global_info_tree_info (HV *hv, GLOBAL_INFO 
*global_info_ref)
 
   dTHX;
 
-  if (global_info.dircategory_direntry.contents.number > 0)
+  if (global_info.dircategory_direntry.number > 0)
     {
       AV *av = newAV ();
       hv_store (hv, "dircategory_direntry", strlen ("dircategory_direntry"),
                 newRV_noinc ((SV *) av), 0);
-      for (i = 0; i < global_info.dircategory_direntry.contents.number; i++)
+      for (i = 0; i < global_info.dircategory_direntry.number; i++)
         {
-          e = contents_child_by_index (&global_info.dircategory_direntry, i);
+          e = global_info.dircategory_direntry.list[i];
           if (e->hv)
             av_push (av, newRV_inc ((SV *) e->hv));
         }
@@ -946,42 +946,42 @@ build_global_commands (GLOBAL_COMMANDS 
*global_commands_ref)
 
   /* The following are arrays of elements. */
 
-  if (global_commands.footnotes.contents.number > 0)
+  if (global_commands.footnotes.number > 0)
     {
       av = newAV ();
       hv_store (hv, "footnote", strlen ("footnote"),
                 newRV_noinc ((SV *) av), 0);
-      for (i = 0; i < global_commands.footnotes.contents.number; i++)
+      for (i = 0; i < global_commands.footnotes.number; i++)
         {
-          e = contents_child_by_index (&global_commands.footnotes, i);
+          e = global_commands.footnotes.list[i];
           if (e->hv)
             av_push (av, newRV_inc ((SV *) e->hv));
         }
     }
 
   /* float is a type, it does not work there, use floats instead */
-  if (global_commands.floats.contents.number > 0)
+  if (global_commands.floats.number > 0)
     {
       av = newAV ();
       hv_store (hv, "float", strlen ("float"),
                 newRV_noinc ((SV *) av), 0);
-      for (i = 0; i < global_commands.floats.contents.number; i++)
+      for (i = 0; i < global_commands.floats.number; i++)
         {
-          e = contents_child_by_index (&global_commands.floats, i);
+          e = global_commands.floats.list[i];
           if (e->hv)
             av_push (av, newRV_inc ((SV *) e->hv));
         }
     }
 
 #define GLOBAL_CASE(cmd) \
-  if (global_commands.cmd.contents.number > 0)                              \
+  if (global_commands.cmd.number > 0)                              \
     {                                                                   \
       av = newAV ();                                                    \
       hv_store (hv, #cmd, strlen (#cmd),                                \
                 newRV_noinc ((SV *) av), 0);                              \
-      for (i = 0; i < global_commands.cmd.contents.number; i++)             \
+      for (i = 0; i < global_commands.cmd.number; i++)             \
         {                                                               \
-          e = contents_child_by_index (&global_commands.cmd, i);            \
+          e = global_commands.cmd.list[i];            \
           if (e->hv)                                                    \
             av_push (av, newRV_inc ((SV *) e->hv));                     \
         }                                                               \
diff --git a/tp/Texinfo/XS/main/command_data.awk 
b/tp/Texinfo/XS/main/command_data.awk
index f1c55f42ca..9599f9895e 100644
--- a/tp/Texinfo/XS/main/command_data.awk
+++ b/tp/Texinfo/XS/main/command_data.awk
@@ -179,7 +179,7 @@ END {
                   if (c != "float" && c != "footnote") {
                     print "GLOBAL_CASE(" c ");" > GMC
                     tmp_str = global_multi_commands_struct_str
-                    global_multi_commands_struct_str = tmp_str "   ELEMENT " c 
";\n"
+                    global_multi_commands_struct_str = tmp_str "   
ELEMENT_LIST " c ";\n"
                   }
                 } else if (flags_array[flag_idx] == "global_unique") {
                   # setfilename is special, it can also happen in @include
@@ -267,8 +267,8 @@ END {
 
     print global_unique_commands_struct_str   > GCT
     print "   /* Arrays of elements */"       > GCT
-    print "   ELEMENT floats;"                > GCT
-    print "   ELEMENT footnotes;\n"           > GCT
+    print "   ELEMENT_LIST floats;"                > GCT
+    print "   ELEMENT_LIST footnotes;\n"           > GCT
     print global_multi_commands_struct_str    > GCT
     print "} GLOBAL_COMMANDS;\n"              > GCT
     print "#endif"                            > GCT
diff --git a/tp/Texinfo/XS/main/tree.c b/tp/Texinfo/XS/main/tree.c
index 69c5f84404..c0d7d18cb2 100644
--- a/tp/Texinfo/XS/main/tree.c
+++ b/tp/Texinfo/XS/main/tree.c
@@ -512,27 +512,33 @@ args_child_by_index (ELEMENT *e, int index)
   return e->args.list[index];
 }
 
-/* do not set parent as it can be used to replace in a container element */
-int
-replace_element_in_contents (ELEMENT *parent, ELEMENT *removed, ELEMENT *added)
+int replace_element_in_list (ELEMENT_LIST *list, ELEMENT *removed,
+                             ELEMENT *added)
 {
   int i;
 
-  if (!parent || !parent->contents.number)
+  if (!list || !list->number)
     return 0;
 
-  for (i = 0; i < parent->contents.number; i++)
+  for (i = 0; i < list->number; i++)
     {
-      ELEMENT *content = parent->contents.list[i];
+      ELEMENT *content = list->list[i];
       if (content == removed)
         {
-          parent->contents.list[i] = added;
+          list->list[i] = added;
           return 1;
         }
     }
   return 0;
 }
 
+/* do not set parent as it can be used to replace in a container element */
+int
+replace_element_in_contents (ELEMENT *parent, ELEMENT *removed, ELEMENT *added)
+{
+  return replace_element_in_list (&parent->contents, removed, added);
+}
+
 /* should only be used if the nse->manual_content
    and nse->node_content are not already in the tree,
    in practice when the node spec was created by
diff --git a/tp/Texinfo/XS/main/tree.h b/tp/Texinfo/XS/main/tree.h
index 85fac5c72d..8db37d8308 100644
--- a/tp/Texinfo/XS/main/tree.h
+++ b/tp/Texinfo/XS/main/tree.h
@@ -41,6 +41,8 @@ void destroy_element (ELEMENT *e);
 void destroy_element_and_children (ELEMENT *e);
 int replace_element_in_contents (ELEMENT *parent, ELEMENT *removed,
                                  ELEMENT *added);
+int replace_element_in_list (ELEMENT_LIST *list, ELEMENT *removed,
+                             ELEMENT *added);
 void destroy_node_spec (NODE_SPEC_EXTRA *nse);
 
 #define element_contents_number(e) ((e)->contents.number)
diff --git a/tp/Texinfo/XS/main/utils.c b/tp/Texinfo/XS/main/utils.c
index feaab149fe..b13f46e882 100644
--- a/tp/Texinfo/XS/main/utils.c
+++ b/tp/Texinfo/XS/main/utils.c
@@ -826,7 +826,7 @@ delete_global_info (GLOBAL_INFO *global_info_ref)
 {
   GLOBAL_INFO global_info = *global_info_ref;
 
-  free (global_info.dircategory_direntry.contents.list);
+  free (global_info.dircategory_direntry.list);
 
   free (global_info.input_encoding_name);
   free (global_info.input_file_name);
@@ -839,7 +839,7 @@ delete_global_commands (GLOBAL_COMMANDS 
*global_commands_ref)
   GLOBAL_COMMANDS global_commands = *global_commands_ref;
 
 #define GLOBAL_CASE(cmx) \
-  free (global_commands.cmx.contents.list)
+  free (global_commands.cmx.list)
 
   GLOBAL_CASE(floats);
   GLOBAL_CASE(footnotes);
@@ -849,15 +849,15 @@ delete_global_commands (GLOBAL_COMMANDS 
*global_commands_ref)
 #undef GLOBAL_CASE
 }
 
-ELEMENT *
-get_cmd_global_command (GLOBAL_COMMANDS *global_commands_ref,
-                        enum command_id cmd)
+ELEMENT_LIST *
+get_cmd_global_multi_command (GLOBAL_COMMANDS *global_commands_ref,
+                              enum command_id cmd)
 {
 
   switch (cmd)
     {
 #define GLOBAL_CASE(cmx) \
-     case CM_##cmx:   \
+     case CM_##cmx: \
        return &global_commands_ref->cmx;
 
      case CM_footnote:
@@ -869,7 +869,18 @@ get_cmd_global_command (GLOBAL_COMMANDS 
*global_commands_ref,
 #include "global_multi_commands_case.c"
 
 #undef GLOBAL_CASE
+     default:
+       return 0;
+   }
+}
 
+ELEMENT *
+get_cmd_global_uniq_command (GLOBAL_COMMANDS *global_commands_ref,
+                             enum command_id cmd)
+{
+
+  switch (cmd)
+    {
 #define GLOBAL_UNIQUE_CASE(cmd) \
      case CM_##cmd: \
        return global_commands_ref->cmd;
@@ -994,29 +1005,29 @@ get_global_document_command (GLOBAL_COMMANDS 
*global_commands,
     fprintf (stderr, "BUG: get_global_document_command: unknown CL: %d\n",
                      command_location);
 
-  ELEMENT *command
-     = get_cmd_global_command (global_commands, cmd);
+  ELEMENT_LIST *command_list
+     = get_cmd_global_multi_command (global_commands, cmd);
   if (builtin_command_data[cmd].flags & CF_global)
     {
-      if (command->contents.number)
+      if (command_list->number)
         {
           if (command_location == CL_last)
             {
-              element = command->contents.list[command->contents.number -1];
+              element = command_list->list[command_list->number -1];
             }
           else
             {
               if (command_location == CL_preamble_or_first
-                   && !in_preamble (command->contents.list[0]))
+                   && !in_preamble (command_list->list[0]))
                 {
-                  element = command->contents.list[0];
+                  element = command_list->list[0];
                 }
               else
                 {
                   int i;
-                  for (i = 0; i < command->contents.number; i++)
+                  for (i = 0; i < command_list->number; i++)
                     {
-                      ELEMENT *command_element = command->contents.list[i];
+                      ELEMENT *command_element = command_list->list[i];
                       if (in_preamble (command_element))
                         {
                           element = command_element;
@@ -1028,9 +1039,12 @@ get_global_document_command (GLOBAL_COMMANDS 
*global_commands,
             }
         }
     }
-  else if (command)
+  else
     {
-      element = command;
+      ELEMENT *command
+        = get_cmd_global_uniq_command (global_commands, cmd);
+      if (command)
+        element = command;
     }
   return element;
 }
diff --git a/tp/Texinfo/XS/main/utils.h b/tp/Texinfo/XS/main/utils.h
index 7d57770bcc..93952bc1d9 100644
--- a/tp/Texinfo/XS/main/utils.h
+++ b/tp/Texinfo/XS/main/utils.h
@@ -281,6 +281,6 @@ char *informative_command_value (ELEMENT *element);
 ELEMENT *set_global_document_command (GLOBAL_COMMANDS *global_commands,
                              OPTIONS *options, enum command_id cmd,
                              enum command_location command_location);
-ELEMENT *get_cmd_global_command (GLOBAL_COMMANDS *global_commands_ref,
-                                 enum command_id cmd);
+ELEMENT_LIST *get_cmd_global_multi_command (GLOBAL_COMMANDS 
*global_commands_ref,
+                                      enum command_id cmd);
 #endif
diff --git a/tp/Texinfo/XS/parsetexi/handle_commands.c 
b/tp/Texinfo/XS/parsetexi/handle_commands.c
index b8661f2805..40c83ba8d8 100644
--- a/tp/Texinfo/XS/parsetexi/handle_commands.c
+++ b/tp/Texinfo/XS/parsetexi/handle_commands.c
@@ -966,7 +966,7 @@ handle_line_command (ELEMENT *current, char **line_inout,
   if (command_e)
     register_global_command (command_e);
   if (cmd == CM_dircategory)
-    add_to_contents_as_array (&global_info.dircategory_direntry, command_e);
+    add_to_element_list (&global_info.dircategory_direntry, command_e);
 
 funexit:
   *line_inout = line;
@@ -1066,7 +1066,7 @@ handle_block_command (ELEMENT *current, char **line_inout,
           add_to_element_contents (current, def_line);
           current = def_line;
           add_extra_string_dup (current, "def_command", command_name(cmd));
-          add_extra_string_dup (current, "original_def_cmdname", 
+          add_extra_string_dup (current, "original_def_cmdname",
                                 command_name(cmd));
           /* Check txidefnamenospace flag */
           val = fetch_value ("txidefnamenospace");
@@ -1101,8 +1101,8 @@ handle_block_command (ELEMENT *current, char **line_inout,
           push_context (ct_preformatted, cmd);
 
           if (cmd == CM_direntry)
-            add_to_contents_as_array (&global_info.dircategory_direntry, 
-                                      block);
+            add_to_element_list (&global_info.dircategory_direntry,
+                                 block);
 
           if (current_node)
             {
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index fe02e1c5bd..bf48a87f82 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -357,15 +357,15 @@ register_global_command (ELEMENT *current)
         {
 #define GLOBAL_CASE(cmx) \
         case CM_##cmx:   \
-          add_to_contents_as_array (&global_commands.cmx, current); \
+          add_to_element_list (&global_commands.cmx, current); \
           break
 
         case CM_footnote:
-          add_to_contents_as_array (&global_commands.footnotes, current);
+          add_to_element_list (&global_commands.footnotes, current);
           break;
 
         case CM_float:
-          add_to_contents_as_array (&global_commands.floats, current);
+          add_to_element_list (&global_commands.floats, current);
           break;
 
 #include "global_multi_commands_case.c"
@@ -2536,16 +2536,17 @@ store_document (ELEMENT *root)
   if (global_info.input_directory)
     doc_global_info->input_directory
       = strdup (global_info.input_directory);
+
   #define COPY_GLOBAL_ARRAY(type,cmd) \
-   doc_global_##type->cmd.contents.list = 0;                            \
-   doc_global_##type->cmd.contents.number = 0;                          \
-   doc_global_##type->cmd.contents.space = 0;                           \
-   if (global_##type.cmd.contents.number > 0)                           \
+   doc_global_##type->cmd.list = 0;                            \
+   doc_global_##type->cmd.number = 0;                          \
+   doc_global_##type->cmd.space = 0;                           \
+   if (global_##type.cmd.number > 0)                           \
     {                                                                   \
-      for (i = 0; i < global_##type.cmd.contents.number; i++)           \
+      for (i = 0; i < global_##type.cmd.number; i++)           \
         {                                                               \
-          ELEMENT *e = contents_child_by_index (&global_##type.cmd, i); \
-          add_to_contents_as_array (&doc_global_##type->cmd, e);        \
+          ELEMENT *e = global_##type.cmd.list[i]; \
+          add_to_element_list (&doc_global_##type->cmd, e);        \
         }                                                               \
     }
   COPY_GLOBAL_ARRAY(info,dircategory_direntry);
diff --git a/tp/Texinfo/XS/structuring_transfo/structuring.c 
b/tp/Texinfo/XS/structuring_transfo/structuring.c
index 39d27d4ce2..14e931b161 100644
--- a/tp/Texinfo/XS/structuring_transfo/structuring.c
+++ b/tp/Texinfo/XS/structuring_transfo/structuring.c
@@ -397,9 +397,9 @@ warn_non_empty_parts (DOCUMENT *document)
   ERROR_MESSAGE_LIST *error_messages = document->error_messages;
   int i;
 
-  for (i = 0; i < global_commands->part.contents.number; i++)
+  for (i = 0; i < global_commands->part.number; i++)
     {
-      ELEMENT *part = global_commands->part.contents.list[i];
+      ELEMENT *part = global_commands->part.list[i];
       if (!is_content_empty (part, 0))
         message_list_command_warn (error_messages, part,
                       "@%s not empty", builtin_command_name (part->cmd));
@@ -920,12 +920,12 @@ set_menus_node_directions (DOCUMENT *document)
     }
 
   /* Check @detailmenu */
-  if (check_menu_entries && global_commands->detailmenu.contents.number > 0)
+  if (check_menu_entries && global_commands->detailmenu.number > 0)
     {
       int i;
-      for (i = 0; i < global_commands->detailmenu.contents.number; i++)
+      for (i = 0; i < global_commands->detailmenu.number; i++)
         {
-          ELEMENT *detailmenu = global_commands->detailmenu.contents.list[i];
+          ELEMENT *detailmenu = global_commands->detailmenu.list[i];
           int k;
           for (k = 0; k < detailmenu->contents.number; k++)
             {
diff --git a/tp/Texinfo/XS/structuring_transfo/transformations.c 
b/tp/Texinfo/XS/structuring_transfo/transformations.c
index 2033a1d362..60da42170b 100644
--- a/tp/Texinfo/XS/structuring_transfo/transformations.c
+++ b/tp/Texinfo/XS/structuring_transfo/transformations.c
@@ -1208,7 +1208,7 @@ regenerate_master_menu (DOCUMENT *document, int 
use_sections)
             {
               int j;
               ELEMENT *removed = remove_from_contents (menu, detailmenu_index);
-              replace_element_in_contents (
+              replace_element_in_list (
                  &document->global_commands->detailmenu, removed, master_menu);
               /* FIXME are the new entries added to internal refs?
                  Note that if they are not, it is possible that this has
@@ -1294,8 +1294,7 @@ regenerate_master_menu (DOCUMENT *document, int 
use_sections)
     }
   /* insert master menu */
   insert_into_contents (last_menu, master_menu, index);
-  add_to_contents_as_array (&document->global_commands->detailmenu,
-                            master_menu);
+  add_to_element_list (&document->global_commands->detailmenu, master_menu);
   return 1;
 }
 



reply via email to

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