[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Sun, 14 Apr 2024 13:39:44 -0400 (EDT) |
branch: master
commit 9021e624e424800f715c2bafae739602cd78fbe3
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Apr 14 18:44:18 2024 +0200
* tp/Texinfo/Document.pm (%XS_overrides),
tp/Texinfo/XS/main/DocumentXS.xs: remove rebuild_document, document
accessors should be used instead.
---
ChangeLog | 6 ++++++
tp/Texinfo/Document.pm | 12 ------------
tp/Texinfo/Structuring.pm | 2 +-
tp/Texinfo/XS/main/DocumentXS.xs | 12 +++++++-----
tp/Texinfo/XS/main/build_perl_info.c | 3 ++-
5 files changed, 16 insertions(+), 19 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index fadea87b1a..b811a7be9c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-04-14 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Document.pm (%XS_overrides),
+ tp/Texinfo/XS/main/DocumentXS.xs: remove rebuild_document, document
+ accessors should be used instead.
+
2024-04-14 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/ManipulateTree.pm (normalized_menu_entry_internal_node)
diff --git a/tp/Texinfo/Document.pm b/tp/Texinfo/Document.pm
index 39a15c454f..9279d4b90d 100644
--- a/tp/Texinfo/Document.pm
+++ b/tp/Texinfo/Document.pm
@@ -48,8 +48,6 @@ our %XS_overrides = (
=> "Texinfo::DocumentXS::set_document_global_info",
"Texinfo::Document::errors"
=> "Texinfo::DocumentXS::document_errors",
- "Texinfo::Document::rebuild_document"
- => "Texinfo::DocumentXS::rebuild_document",
"Texinfo::Document::rebuild_tree"
=> "Texinfo::DocumentXS::rebuild_tree",
"Texinfo::Document::tree"
@@ -473,16 +471,6 @@ sub remove_document($)
my $document = shift;
}
-# this method does nothing, but the XS override rebuilds the Perl
-# document based on XS data.
-# Should not need to be used, calling tree() should do about the same,
-# therefore not documented.
-sub rebuild_document($;$)
-{
- my $document = shift;
- my $no_store = shift;
-}
-
# this method does nothing, but the XS override rebuilds the Perl
# tree based on XS data.
sub rebuild_tree($;$)
diff --git a/tp/Texinfo/Structuring.pm b/tp/Texinfo/Structuring.pm
index 2e6fa900c3..2d396ff275 100644
--- a/tp/Texinfo/Structuring.pm
+++ b/tp/Texinfo/Structuring.pm
@@ -1610,7 +1610,7 @@ __END__
=head1 NAME
-Texinfo::Structuring - information on Texinfo::Document tree
+Texinfo::Structuring - information on Texinfo::Document document structure
=head1 SYNOPSIS
diff --git a/tp/Texinfo/XS/main/DocumentXS.xs b/tp/Texinfo/XS/main/DocumentXS.xs
index 6f52cdf957..df348a9b3d 100644
--- a/tp/Texinfo/XS/main/DocumentXS.xs
+++ b/tp/Texinfo/XS/main/DocumentXS.xs
@@ -44,6 +44,8 @@ MODULE = Texinfo::DocumentXS PACKAGE =
Texinfo::DocumentXS
PROTOTYPES: ENABLE
+# More related to translations than to the Texinfo Document, but we do not
+# to add another XS file for only one function.
void
configure_output_strings_translations (localesdir,
strings_textdomain="texinfo_document")
char *localesdir = (char *)SvPVbyte_nolen($arg);
@@ -51,12 +53,12 @@ configure_output_strings_translations (localesdir,
strings_textdomain="texinfo_d
CODE:
configure_output_strings_translations (localesdir, strings_textdomain);
-void
-rebuild_document (SV *document_in, int no_store=0)
-
# Since build_document is called, the underlying document HV is destroyed
-# instead of being reused. Being able to get the document HV from the
-# XS document or from the Perl tree would be needed to do it differently.
+# instead of being reused, which is somewhat inefficient. Doing something
+# better would require the possibility to get the document HV from the
+# XS document or from the Perl tree. This XS interface is rarely used,
+# however, as, in general, a document is available and document_tree
+# can be used instead, therefore it is fine to keep the code as is.
SV *
rebuild_tree (SV *tree_in, ...)
PROTOTYPE: $;$
diff --git a/tp/Texinfo/XS/main/build_perl_info.c
b/tp/Texinfo/XS/main/build_perl_info.c
index 55714bf1f3..f829afc8d1 100644
--- a/tp/Texinfo/XS/main/build_perl_info.c
+++ b/tp/Texinfo/XS/main/build_perl_info.c
@@ -1220,7 +1220,7 @@ build_errors (ERROR_MESSAGE *error_list, size_t
error_number)
/* add C messages to a Texinfo::Report object, like
Texinfo::Report::add_formatted_message does.
NOTE probably not useful for converters as errors need to be passed
- explicitely both from Perl and XS.
+ explicitely both from Perl and XS and are added at that point.
Also return $report->{'errors_warnings'} in ERRORS_WARNINGS_OUT and
$report->{'error_nrs'} in ERRORS_NRS_OUT, even if ERROR_MESSAGES is
@@ -1538,6 +1538,7 @@ build_document (size_t document_descriptor, int no_store)
return sv;
}
+/* Currently unused, but could be */
void
rebuild_document (SV *document_in, int no_store)
{