[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Sun, 26 Nov 2023 10:40:45 -0500 (EST) |
branch: master
commit acada79767908d69985eaa49258996418a1adea4
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Nov 26 16:38:36 2023 +0100
* tp/Texinfo/XS/main/DocumentXS.xs (gdt): update build_texinfo_tree
call.
* tp/Makefile.am (dist_modules_DATA), tp/Texinfo/StructTransfXS.pm,
tp/Texinfo/XS/Makefile.am (StructuringTransfoXS*),
tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs: rename
StructTransf to StructTransfXS and StructuringTransfo to
StructuringTransfoXS.
---
.gitignore | 3 +-
ChangeLog | 11 +
tp/Makefile.am | 2 +-
tp/Texinfo/Common.pm | 18 +-
tp/Texinfo/StructTransf.pm | 54 ---
tp/Texinfo/Structuring.pm | 28 +-
tp/Texinfo/Transformations.pm | 18 +-
tp/Texinfo/XS/Makefile.am | 16 +-
tp/Texinfo/XS/main/DocumentXS.xs | 2 +-
.../XS/structuring_transfo/StructuringTransfo.xs | 431 ---------------------
10 files changed, 54 insertions(+), 529 deletions(-)
diff --git a/.gitignore b/.gitignore
index 9b3dcb8fdb..ce8f9dba66 100644
--- a/.gitignore
+++ b/.gitignore
@@ -319,7 +319,6 @@ tp/Texinfo/XS/gnulib/m4/ltversion.m4
tp/Texinfo/XS/gnulib/m4/lt~obsolete.m4
tp/Texinfo/XS/main/DocumentXS.c
-tp/Texinfo/XS/main/TranslationsXS.c
tp/Texinfo/XS/main/accent_tables_8bit_codepoints.c
tp/Texinfo/XS/main/command_data.c
tp/Texinfo/XS/main/cmd_normalization.c
@@ -336,7 +335,7 @@ tp/Texinfo/XS/main/options_types.h
tp/Texinfo/XS/main/*.lo
-tp/Texinfo/XS/structuring_transfo/StructuringTransfo.c
+tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.c
tp/Texinfo/XS/structuring_transfo/*.lo
diff --git a/ChangeLog b/ChangeLog
index b293cf2c68..30a61c4a74 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2023-11-26 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/main/DocumentXS.xs (gdt): update build_texinfo_tree
+ call.
+
+ * tp/Makefile.am (dist_modules_DATA), tp/Texinfo/StructTransfXS.pm,
+ tp/Texinfo/XS/Makefile.am (StructuringTransfoXS*),
+ tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs: rename
+ StructTransf to StructTransfXS and StructuringTransfo to
+ StructuringTransfoXS.
+
2023-11-26 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/main/DocumentXS.xs (gdt): move from TranslationsXS to
diff --git a/tp/Makefile.am b/tp/Makefile.am
index 743b1ad650..04e955c5a9 100644
--- a/tp/Makefile.am
+++ b/tp/Makefile.am
@@ -77,7 +77,7 @@ dist_modules_DATA = \
Texinfo/Parser.pm \
Texinfo/ParserNonXS.pm \
Texinfo/Report.pm \
- Texinfo/StructTransf.pm \
+ Texinfo/StructTransfXS.pm \
Texinfo/Structuring.pm \
Texinfo/Transformations.pm \
Texinfo/Translations.pm \
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index 6fc01a1873..9467c49287 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -43,10 +43,10 @@ use Carp qw(cluck confess);
use Locale::Messages;
-# FIXME do we really want XS in that file? Move to
-# Structuring.pm?
+# FIXME do we really want XS in Common.pm? Move overriden functions
+# to other modules?
use Texinfo::DocumentXS;
-use Texinfo::StructTransf;
+use Texinfo::StructTransfXS;
use Texinfo::XSLoader;
@@ -93,17 +93,17 @@ our %XS_overrides = (
"Texinfo::Common::set_document_options"
=> "Texinfo::DocumentXS::set_document_options",
"Texinfo::Common::copy_tree"
- => "Texinfo::StructTransf::copy_tree",
+ => "Texinfo::StructTransfXS::copy_tree",
"Texinfo::Common::relate_index_entries_to_table_items_in_tree"
- => "Texinfo::StructTransf::relate_index_entries_to_table_items_in_tree",
+ => "Texinfo::StructTransfXS::relate_index_entries_to_table_items_in_tree",
"Texinfo::Common::move_index_entries_after_items_in_tree"
- => "Texinfo::StructTransf::move_index_entries_after_items_in_tree",
+ => "Texinfo::StructTransfXS::move_index_entries_after_items_in_tree",
"Texinfo::Common::protect_colon_in_tree"
- => "Texinfo::StructTransf::protect_colon_in_tree",
+ => "Texinfo::StructTransfXS::protect_colon_in_tree",
"Texinfo::Common::protect_comma_in_tree"
- => "Texinfo::StructTransf::protect_comma_in_tree",
+ => "Texinfo::StructTransfXS::protect_comma_in_tree",
"Texinfo::Common::protect_node_after_label_in_tree"
- => "Texinfo::StructTransf::protect_node_after_label_in_tree",
+ => "Texinfo::StructTransfXS::protect_node_after_label_in_tree",
);
our $module_loaded = 0;
diff --git a/tp/Texinfo/StructTransf.pm b/tp/Texinfo/StructTransf.pm
deleted file mode 100644
index 07d6b87fb6..0000000000
--- a/tp/Texinfo/StructTransf.pm
+++ /dev/null
@@ -1,54 +0,0 @@
-# StructTransf.pm: load structuring and tree transformation XS
-# Copyright 2023 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License,
-# or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-package Texinfo::StructTransf;
-
-use strict;
-use warnings;
-
-our $VERSION = '7.1dev';
-
-use Texinfo::XSLoader;
-
-BEGIN {
- my $XS_structuring = ((not defined($ENV{TEXINFO_XS_PARSER})
- or $ENV{TEXINFO_XS_PARSER} eq '1')
- and (not defined($ENV{TEXINFO_XS_STRUCTURE})
- or $ENV{TEXINFO_XS_STRUCTURE} ne '0'));
- if ($XS_structuring) {
- Texinfo::XSLoader::init (
- "Texinfo::StructTransf",
- "Texinfo::StructTransf",
- "StructuringTransfo",
- undef,
- 0,
- undef,
- undef,
- );
- }
-}
-
-# NB Don't add more functions down here, because this can cause an error
-# with some versions of Perl, connected with any typeglob assignments done
-# above. ("Can't call mro_method_changed_in() on anonymous symbol table").
-#
-# See
http://perl5.git.perl.org/perl.git/commitdiff/03d9f026ae253e9e69212a3cf6f1944437e9f070?hp=ac73ea1ec401df889d312b067f78b618f7ffecc3
-#
-# (change to Perl interpreter on 22 Oct 2011)
-
-
-1;
-__END__
diff --git a/tp/Texinfo/Structuring.pm b/tp/Texinfo/Structuring.pm
index c2262b617d..53f3a36279 100644
--- a/tp/Texinfo/Structuring.pm
+++ b/tp/Texinfo/Structuring.pm
@@ -39,7 +39,7 @@ use Carp qw(cluck confess);
use Unicode::Normalize;
-use Texinfo::StructTransf;
+use Texinfo::StructTransfXS;
use Texinfo::XSLoader;
@@ -94,35 +94,35 @@ my $XS_structuring = ((not defined($ENV{TEXINFO_XS})
our %XS_overrides = (
"Texinfo::Structuring::associate_internal_references"
- => "Texinfo::StructTransf::associate_internal_references",
+ => "Texinfo::StructTransfXS::associate_internal_references",
"Texinfo::Structuring::sectioning_structure"
- => "Texinfo::StructTransf::sectioning_structure",
+ => "Texinfo::StructTransfXS::sectioning_structure",
"Texinfo::Structuring::warn_non_empty_parts"
- => "Texinfo::StructTransf::warn_non_empty_parts",
+ => "Texinfo::StructTransfXS::warn_non_empty_parts",
"Texinfo::Structuring::nodes_tree"
- => "Texinfo::StructTransf::nodes_tree",
+ => "Texinfo::StructTransfXS::nodes_tree",
"Texinfo::Structuring::set_menus_node_directions"
- => "Texinfo::StructTransf::set_menus_node_directions",
+ => "Texinfo::StructTransfXS::set_menus_node_directions",
"Texinfo::Structuring::complete_node_tree_with_menus"
- => "Texinfo::StructTransf::complete_node_tree_with_menus",
+ => "Texinfo::StructTransfXS::complete_node_tree_with_menus",
"Texinfo::Structuring::check_nodes_are_referenced"
- => "Texinfo::StructTransf::check_nodes_are_referenced",
+ => "Texinfo::StructTransfXS::check_nodes_are_referenced",
"Texinfo::Structuring::number_floats"
- => "Texinfo::StructTransf::number_floats",
+ => "Texinfo::StructTransfXS::number_floats",
"Texinfo::Structuring::rebuild_output_units"
- => "Texinfo::StructTransf::rebuild_output_units",
+ => "Texinfo::StructTransfXS::rebuild_output_units",
"Texinfo::Structuring::_XS_unsplit"
- => "Texinfo::StructTransf::unsplit",
+ => "Texinfo::StructTransfXS::unsplit",
# Not useful for HTML as functions, as the calling functions are
# already overriden
# Could be readded when other converters than HTML are done in C
# "Texinfo::Structuring::split_by_node"
- # => "Texinfo::StructTransf::split_by_node");
+ # => "Texinfo::StructTransfXS::split_by_node");
# "Texinfo::Structuring::split_by_section"
- # => "Texinfo::StructTransf::split_by_section");
+ # => "Texinfo::StructTransfXS::split_by_section");
# "Texinfo::Structuring::split_pages"
- # => "Texinfo::StructTransf::split_pages"
+ # => "Texinfo::StructTransfXS::split_pages"
);
our $module_loaded = 0;
diff --git a/tp/Texinfo/Transformations.pm b/tp/Texinfo/Transformations.pm
index b3677b54bb..4252f819b9 100644
--- a/tp/Texinfo/Transformations.pm
+++ b/tp/Texinfo/Transformations.pm
@@ -30,7 +30,7 @@ use strict;
use Carp qw(cluck);
-use Texinfo::StructTransf;
+use Texinfo::StructTransfXS;
use Texinfo::XSLoader;
@@ -63,21 +63,21 @@ my $XS_structuring = ((not defined($ENV{TEXINFO_XS})
our %XS_overrides = (
"Texinfo::Transformations::fill_gaps_in_sectioning"
- => "Texinfo::StructTransf::fill_gaps_in_sectioning",
+ => "Texinfo::StructTransfXS::fill_gaps_in_sectioning",
"Texinfo::Transformations::reference_to_arg_in_tree"
- => "Texinfo::StructTransf::reference_to_arg_in_tree",
+ => "Texinfo::StructTransfXS::reference_to_arg_in_tree",
"Texinfo::Transformations::complete_tree_nodes_menus"
- => "Texinfo::StructTransf::complete_tree_nodes_menus",
+ => "Texinfo::StructTransfXS::complete_tree_nodes_menus",
"Texinfo::Transformations::complete_tree_nodes_missing_menu"
- => "Texinfo::StructTransf::complete_tree_nodes_missing_menu",
+ => "Texinfo::StructTransfXS::complete_tree_nodes_missing_menu",
"Texinfo::Transformations::regenerate_master_menu"
- => "Texinfo::StructTransf::regenerate_master_menu",
+ => "Texinfo::StructTransfXS::regenerate_master_menu",
"Texinfo::Transformations::insert_nodes_for_sectioning_commands"
- => "Texinfo::StructTransf::insert_nodes_for_sectioning_commands",
+ => "Texinfo::StructTransfXS::insert_nodes_for_sectioning_commands",
"Texinfo::Transformations::protect_hashchar_at_line_beginning"
- => "Texinfo::StructTransf::protect_hashchar_at_line_beginning",
+ => "Texinfo::StructTransfXS::protect_hashchar_at_line_beginning",
"Texinfo::Transformations::protect_first_parenthesis_in_targets"
- => "Texinfo::StructTransf::protect_first_parenthesis_in_targets",
+ => "Texinfo::StructTransfXS::protect_first_parenthesis_in_targets",
);
our $module_loaded = 0;
diff --git a/tp/Texinfo/XS/Makefile.am b/tp/Texinfo/XS/Makefile.am
index c93d960249..af7fa6e22b 100644
--- a/tp/Texinfo/XS/Makefile.am
+++ b/tp/Texinfo/XS/Makefile.am
@@ -328,23 +328,23 @@ DocumentXS_la_LDFLAGS = $(XSLIBS_LDFLAGS)
########################## StructuringTransfo XS
if HAVE_ICONV
-xs_LTLIBRARIES += StructuringTransfo.la
+xs_LTLIBRARIES += StructuringTransfoXS.la
endif
-StructuringTransfo_la_SOURCES = \
- structuring_transfo/StructuringTransfo.c \
+StructuringTransfoXS_la_SOURCES = \
+ structuring_transfo/StructuringTransfoXS.c \
structuring_transfo/structuring.c \
structuring_transfo/structuring.h \
structuring_transfo/transformations.c \
structuring_transfo/transformations.h
-EXTRA_DIST += structuring_transfo/StructuringTransfo.xs
+EXTRA_DIST += structuring_transfo/StructuringTransfoXS.xs
# locate include files under out-of-source builds.
-StructuringTransfo_la_CPPFLAGS = -I$(srcdir)/main
-I$(srcdir)/structuring_transfo $(AM_CPPFLAGS) $(GNULIB_CPPFLAGS)
$(XSLIBS_CPPFLAGS)
-StructuringTransfo_la_CFLAGS = $(XSLIBS_CFLAGS)
-StructuringTransfo_la_LIBADD = libtexinfoxs.la libtexinfo.la
$(top_builddir)/gnulib/lib/libgnu.la
-StructuringTransfo_la_LDFLAGS = $(XSLIBS_LDFLAGS) $(LTLIBICONV)
$(LTLIBUNISTRING)
+StructuringTransfoXS_la_CPPFLAGS = -I$(srcdir)/main
-I$(srcdir)/structuring_transfo $(AM_CPPFLAGS) $(GNULIB_CPPFLAGS)
$(XSLIBS_CPPFLAGS)
+StructuringTransfoXS_la_CFLAGS = $(XSLIBS_CFLAGS)
+StructuringTransfoXS_la_LIBADD = libtexinfoxs.la libtexinfo.la
$(top_builddir)/gnulib/lib/libgnu.la
+StructuringTransfoXS_la_LDFLAGS = $(XSLIBS_LDFLAGS) $(LTLIBICONV)
$(LTLIBUNISTRING)
########################## ConvertXS
diff --git a/tp/Texinfo/XS/main/DocumentXS.xs b/tp/Texinfo/XS/main/DocumentXS.xs
index 37c15e7434..fa098d38a1 100644
--- a/tp/Texinfo/XS/main/DocumentXS.xs
+++ b/tp/Texinfo/XS/main/DocumentXS.xs
@@ -243,7 +243,7 @@ gdt (SV *options_in, string, ...)
= gdt (string, options, replaced_substrings,
translation_context, in_lang);
gdt_document = retrieve_document (gdt_document_descriptor);
- result_tree = build_texinfo_tree (gdt_document->tree);
+ result_tree = build_texinfo_tree (gdt_document->tree, 0);
hv_store (result_tree, "tree_document_descriptor",
strlen ("tree_document_descriptor"),
newSViv ((IV) gdt_document_descriptor), 0);
diff --git a/tp/Texinfo/XS/structuring_transfo/StructuringTransfo.xs
b/tp/Texinfo/XS/structuring_transfo/StructuringTransfo.xs
deleted file mode 100644
index 4373ce6dba..0000000000
--- a/tp/Texinfo/XS/structuring_transfo/StructuringTransfo.xs
+++ /dev/null
@@ -1,431 +0,0 @@
-/* Copyright 2023 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-/* Avoid namespace conflicts. */
-#define context perl_context
-
-#define PERL_NO_GET_CONTEXT
-#include "EXTERN.h"
-#include "perl.h"
-#if defined _WIN32 && !defined __CYGWIN__
-# undef free
-#endif
-#include "XSUB.h"
-
-#undef context
-
-#include "ppport.h"
-
-#include "options_types.h"
-#include "tree_types.h"
-#include "document_types.h"
-#include "tree.h"
-#include "utils.h"
-#include "manipulate_tree.h"
-#include "document.h"
-#include "transformations.h"
-#include "structuring.h"
-#include "output_unit.h"
-#include "get_perl_info.h"
-#include "build_perl_info.h"
-
-MODULE = Texinfo::StructTransf PACKAGE = Texinfo::StructTransf
-
-PROTOTYPES: ENABLE
-
-void
-fill_gaps_in_sectioning (SV *tree_in)
- PREINIT:
- ELEMENT_LIST *added_sections;
- DOCUMENT *document;
- CODE:
- document = get_sv_tree_document (tree_in, "fill_gaps_in_sectioning");
- if (document)
- {
- added_sections = fill_gaps_in_sectioning (document->tree);
- /* cannot easily be used as it does not match with perl tree.
- Also the return would not be usable as error status */
- destroy_list (added_sections);
- }
-
-SV *
-copy_tree (SV *tree_in)
- PREINIT:
- DOCUMENT *document;
- CODE:
- document = get_sv_tree_document (tree_in, "copy_tree");
- if (document)
- {
- ELEMENT *result = copy_tree (document->tree);
- /* FIXME have a similar system but for trees only? */
- int copy_document_descriptor = register_document (result, 0, 0, 0,
- 0, 0, 0, 0, 0, 0);
- HV *hv = build_texinfo_tree (result, 0);
- hv_store (hv, "tree_document_descriptor",
- strlen ("tree_document_descriptor"),
- newSViv ((IV) copy_document_descriptor), 0);
- RETVAL = newRV_inc ((SV *) hv);
- }
- else
- RETVAL = newSV(0);
- OUTPUT:
- RETVAL
-
-void
-relate_index_entries_to_table_items_in_tree (SV *document_in)
- PREINIT:
- DOCUMENT *document;
- CODE:
- document = get_sv_document_document (document_in,
- "relate_index_entries_to_table_items_in_tree");
- if (document)
- {
- if (!document->index_names)
- {
- fprintf (stderr, "ERROR: %d: no index_names\n",
- document->descriptor);
- }
- else
- relate_index_entries_to_table_items_in_tree (document->tree,
- document->index_names);
- }
-
-void
-move_index_entries_after_items_in_tree (SV *tree_in)
- PREINIT:
- DOCUMENT *document;
- CODE:
- document = get_sv_tree_document (tree_in,
-
"move_index_entries_after_items_in_tree");
- if (document)
- move_index_entries_after_items_in_tree (document->tree);
-
-# The perl function returns a tree, as the
-# argument could be modified. Here, tree_in is always a container
-# that is not modified, so there is no need to return a tree.
-void
-reference_to_arg_in_tree (SV *tree_in)
- PREINIT:
- DOCUMENT *document = 0;
- CODE:
- /* FIXME warn? Document not found happens with direct calls of
- _new_node, for example */
- document = get_sv_tree_document (tree_in, 0);
- if (document)
- reference_to_arg_in_tree (document->tree);
-
-void
-associate_internal_references (SV *document_in, ...)
- PROTOTYPE: $$$
- PREINIT:
- DOCUMENT *document = 0;
- CODE:
- /* FIXME warning/error if not found? */
- document = get_sv_document_document (document_in, 0);
- if (document)
- associate_internal_references (document);
-
-
-# The perl function returns a list of sections, but it is only used
-# to register in the document. It is better to reserve the return
-# value for a return status, if it becomes needed.
-void
-sectioning_structure (SV *tree_in, ...)
- PROTOTYPE: $$$
- PREINIT:
- DOCUMENT *document = 0;
- CODE:
- /* FIXME warning/error if not found? */
- document = get_sv_tree_document (tree_in, 0);
- if (document)
- {
- ELEMENT_LIST *sections_list = sectioning_structure (document);
- register_document_sections_list (document, sections_list);
- }
-
-void
-warn_non_empty_parts (SV *document_in, ...)
- PROTOTYPE: $$$
- PREINIT:
- DOCUMENT *document = 0;
- CODE:
- /* FIXME warning/error if not found? */
- document = get_sv_document_document (document_in, 0);
- if (document)
- warn_non_empty_parts (document);
-
-void
-set_menus_node_directions (SV *document_in, ...)
- PROTOTYPE: $$$
- PREINIT:
- DOCUMENT *document = 0;
- CODE:
- /* FIXME warning/error if not found? */
- document = get_sv_document_document (document_in, 0);
- if (document)
- set_menus_node_directions (document);
-
-void
-complete_node_tree_with_menus (SV *document_in, ...)
- PROTOTYPE: $$$
- PREINIT:
- DOCUMENT *document = 0;
- CODE:
- /* FIXME warning/error if not found? */
- document = get_sv_document_document (document_in, 0);
- if (document)
- complete_node_tree_with_menus (document);
-
-void
-check_nodes_are_referenced (SV *document_in, ...)
- PROTOTYPE: $$$
- PREINIT:
- DOCUMENT *document = 0;
- CODE:
- /* FIXME warning/error if not found? */
- document = get_sv_document_document (document_in, 0);
- if (document)
- check_nodes_are_referenced (document);
-
-void
-number_floats (SV *document_in)
- PREINIT:
- DOCUMENT *document = 0;
- CODE:
- /* FIXME warning/error if not found? */
- document = get_sv_document_document (document_in, 0);
- if (document)
- number_floats (document);
-
-void
-complete_tree_nodes_menus (SV *tree_in, SV *use_sections_in=0)
- PREINIT:
- DOCUMENT *document = 0;
- int use_sections = 0;
- CODE:
- document = get_sv_tree_document (tree_in, "complete_tree_nodes_menus");
- if (use_sections_in && SvOK (use_sections_in))
- {
- use_sections = SvIV (use_sections_in);
- }
- if (document)
- complete_tree_nodes_menus (document->tree, use_sections);
-
-void
-complete_tree_nodes_missing_menu (SV *tree_in, SV *use_sections_in=0)
- PREINIT:
- DOCUMENT *document = 0;
- int use_sections = 0;
- CODE:
- document = get_sv_tree_document (tree_in,
- "complete_tree_nodes_missing_menu");
- if (use_sections_in && SvOK (use_sections_in))
- {
- use_sections = SvIV (use_sections_in);
- }
- if (document)
- complete_tree_nodes_missing_menu (document->tree, use_sections);
-
-# regenerate_master_menu uses the options of the document, so we ignore
-# customization_information, which should contain the same information
-void
-regenerate_master_menu (SV *document_in, SV *customization_information, SV
*use_sections_in=0)
- PREINIT:
- DOCUMENT *document = 0;
- int use_sections = 0;
- CODE:
- document = get_sv_document_document (document_in,
- "regenerate_master_menu");
- if (use_sections_in && SvOK (use_sections_in))
- {
- use_sections = SvIV (use_sections_in);
- }
- if (document)
- regenerate_master_menu (document, use_sections);
-
-# The perl function returns the list of added nodes. It is better
-# to reserve the return value for a return status, if it becomes needed.
-# FIXME the added nodes return value is used in pod2texi
-void
-insert_nodes_for_sectioning_commands (SV *document_in, ...)
- PROTOTYPE: $;$$
- PREINIT:
- DOCUMENT *document = 0;
- CODE:
- document = get_sv_document_document (document_in,
- "insert_nodes_for_sectioning_commands");
- if (document)
- {
- ELEMENT_LIST *added_nodes
- = insert_nodes_for_sectioning_commands (document);
- destroy_list (added_nodes);
- }
-
-# The perl function returns a list of nodes, but it is only used
-# to register in the document. It is better to reserve the return
-# value for a return status, if it becomes needed.
-void
-nodes_tree (SV *document_in, ...)
- PROTOTYPE: $$$
- PREINIT:
- DOCUMENT *document = 0;
- CODE:
- document = get_sv_document_document (document_in, "nodes_tree");
- if (document)
- {
- ELEMENT_LIST *nodes_list = nodes_tree (document);
- register_document_nodes_list (document, nodes_list);
- }
-
-# For the next functions, the perl function returns a tree, as the
-# argument could be modified. Here, tree_in is always a container
-# that is not modified, so there is no need to return a tree.
-void
-protect_colon_in_tree (SV *tree_in)
- PREINIT:
- DOCUMENT *document = 0;
- CODE:
- /* FIXME warning/error if not found? */
- document = get_sv_tree_document (tree_in, 0);
- /* there is no need to replace the root of the tree */
- if (document)
- protect_colon_in_tree (document->tree);
-
-void
-protect_comma_in_tree (SV *tree_in)
- PREINIT:
- DOCUMENT *document = 0;
- CODE:
- /* FIXME warning/error if not found? */
- document = get_sv_tree_document (tree_in, 0);
- /* there is no need to replace the root of the tree */
- if (document)
- protect_comma_in_tree (document->tree);
-
-void
-protect_node_after_label_in_tree (SV *tree_in)
- PREINIT:
- DOCUMENT *document = 0;
- CODE:
- /* FIXME warning/error if not found? */
- document = get_sv_tree_document (tree_in, 0);
- /* there is no need to replace the root of the tree */
- if (document)
- protect_node_after_label_in_tree (document->tree);
-
-void
-protect_hashchar_at_line_beginning (SV *tree_in, ...)
- PROTOTYPE: $;$$
- PREINIT:
- DOCUMENT *document = 0;
- CODE:
- /* FIXME warning/error if not found? */
- document = get_sv_tree_document (tree_in, 0);
- /* there is no need to replace the root of the tree */
- if (document)
- protect_hashchar_at_line_beginning (document);
-
-void
-protect_first_parenthesis_in_targets (SV *tree_in)
- PREINIT:
- DOCUMENT *document = 0;
- CODE:
- /* FIXME warning/error if not found? */
- document = get_sv_tree_document (tree_in, 0);
- if (document)
- protect_first_parenthesis_in_targets (document->tree);
-
-SV *
-split_by_node (SV *tree_in)
- PREINIT:
- DOCUMENT *document = 0;
- CODE:
- /* FIXME warning/error if not found? */
- document = get_sv_tree_document (tree_in, 0);
- if (document)
- {
- int output_units_descriptor = split_by_node (document->tree);
- RETVAL = build_output_units_list (output_units_descriptor);
- }
- else
- RETVAL = newSV(0);
- OUTPUT:
- RETVAL
-
-SV *
-split_by_section (SV *tree_in)
- PREINIT:
- DOCUMENT *document = 0;
- CODE:
- /* FIXME warning/error if not found? */
- document = get_sv_tree_document (tree_in, 0);
- if (document)
- {
- int output_units_descriptor = split_by_section (document->tree);
- RETVAL = build_output_units_list (output_units_descriptor);
- }
- else
- RETVAL = newSV(0);
- OUTPUT:
- RETVAL
-
-int
-unsplit (SV *tree_in)
- PREINIT:
- DOCUMENT *document = 0;
- CODE:
- /* FIXME warning/error if not found? */
- document = get_sv_tree_document (tree_in, 0);
- if (document)
- RETVAL = unsplit (document->tree);
- else
- RETVAL = -1;
- OUTPUT:
- RETVAL
-
-# return the input if XS information are missing or not found
-SV *
-rebuild_output_units (SV *output_units_in)
- PREINIT:
- int output_units_descriptor = 0;
- CODE:
- /* FIXME warning/error if not found? */
- output_units_descriptor
- = get_sv_output_units_descriptor (output_units_in, 0);
- if (output_units_descriptor)
- RETVAL = build_output_units_list (output_units_descriptor);
- else
- /* FIXME adding SvREFCNT_inc was done by trial and error
- as without one gets "Useless assignment to a temporary" */
- RETVAL = SvREFCNT_inc(output_units_in);
- /*
- RETVAL = newSV(0);
- */
- OUTPUT:
- RETVAL
-
-void
-split_pages (SV *output_units_in, char *split)
- PREINIT:
- OUTPUT_UNIT_LIST *output_units = 0;
- CODE:
- /* FIXME warning/error if not found? */
- output_units = get_sv_output_units (output_units_in, 0);
- if (output_units)
- split_pages (output_units, split);
-
-