[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/Convert/HTML.pm (_XS_html_converter_
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/Convert/HTML.pm (_XS_html_converter_get_customization) tp/Texinfo/XS/convert/ConvertXS.xs (html_converter_get_customization_sv), tp/Texinfo/XS/convert/get_html_perl_info.c (html_converter_get_customization_sv): rename html_converter_get_customization_sv as _XS_html_converter_get_customization. |
Date: |
Fri, 04 Oct 2024 19:26:57 -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 9a7d55e472 * tp/Texinfo/Convert/HTML.pm
(_XS_html_converter_get_customization) tp/Texinfo/XS/convert/ConvertXS.xs
(html_converter_get_customization_sv),
tp/Texinfo/XS/convert/get_html_perl_info.c
(html_converter_get_customization_sv): rename
html_converter_get_customization_sv as _XS_html_converter_get_customization.
9a7d55e472 is described below
commit 9a7d55e472d3ad4c1f3834cf4c940fffb2dd3d32
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Aug 15 17:05:33 2024 +0200
* tp/Texinfo/Convert/HTML.pm (_XS_html_converter_get_customization)
tp/Texinfo/XS/convert/ConvertXS.xs
(html_converter_get_customization_sv),
tp/Texinfo/XS/convert/get_html_perl_info.c
(html_converter_get_customization_sv): rename
html_converter_get_customization_sv as
_XS_html_converter_get_customization.
* tp/Texinfo/XS/convert/html_converter_init_options.c
(html_converter_initialize_beginning): rename
html_converter_initialize as html_converter_initialize_beginning.
* tp/Texinfo/Convert/HTML.pm (%XS_conversion_overrides)
(_XS_html_converter_initialize_beginning, converter_initialize),
tp/Texinfo/XS/convert/ConvertXS.xs
(html_converter_initialize_beginning),
tp/Texinfo/XS/convert/converter.c (set_converter_init_information),
tp/Texinfo/XS/convert/texinfo.c (txi_converter_initialize): add an XS
override html_converter_initialize_beginning that is called at the
beginning of converter_initialize in Perl as
_XS_html_converter_initialize_beginning if XS is set. Call
html_converter_initialize_beginning in this override and in
txi_converter_initialize. Do not call
html_converter_initialize_beginning in set_converter_init_information
anymore. The objective is to avoid to have the initialization
necessarily split in two in C.
---
ChangeLog | 29 ++++++++++++++++++++++
tp/Texinfo/Convert/HTML.pm | 21 ++++++++++------
tp/Texinfo/XS/convert/ConvertXS.xs | 18 +++++++++++---
tp/Texinfo/XS/convert/converter.c | 12 ++++-----
tp/Texinfo/XS/convert/get_html_perl_info.c | 5 ++--
tp/Texinfo/XS/convert/get_html_perl_info.h | 2 +-
tp/Texinfo/XS/convert/html_converter_api.h | 2 +-
.../XS/convert/html_converter_init_options.c | 2 +-
.../XS/convert/html_converter_init_options.h | 2 +-
tp/Texinfo/XS/convert/html_prepare_converter.c | 8 +++---
tp/Texinfo/XS/convert/texinfo.c | 1 +
11 files changed, 75 insertions(+), 27 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c08942a952..19e6dbaba5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,35 @@
(html_default_format_node_redirection_page)
(html_default_format_special_body_about): fix function names.
+2024-08-15 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Convert/HTML.pm (_XS_html_converter_get_customization)
+ tp/Texinfo/XS/convert/ConvertXS.xs
+ (html_converter_get_customization_sv),
+ tp/Texinfo/XS/convert/get_html_perl_info.c
+ (html_converter_get_customization_sv): rename
+ html_converter_get_customization_sv as
+ _XS_html_converter_get_customization.
+
+ * tp/Texinfo/XS/convert/html_converter_init_options.c
+ (html_converter_initialize_beginning): rename
+ html_converter_initialize as html_converter_initialize_beginning.
+
+ * tp/Texinfo/Convert/HTML.pm (%XS_conversion_overrides)
+ (_XS_html_converter_initialize_beginning, converter_initialize),
+ tp/Texinfo/XS/convert/ConvertXS.xs
+ (html_converter_initialize_beginning),
+ tp/Texinfo/XS/convert/converter.c (set_converter_init_information),
+ tp/Texinfo/XS/convert/texinfo.c (txi_converter_initialize): add an XS
+ override html_converter_initialize_beginning that is called at the
+ beginning of converter_initialize in Perl as
+ _XS_html_converter_initialize_beginning if XS is set. Call
+ html_converter_initialize_beginning in this override and in
+ txi_converter_initialize. Do not call
+ html_converter_initialize_beginning in set_converter_init_information
+ anymore. The objective is to avoid to have the initialization
+ necessarily split in two in C.
+
2024-08-15 Patrice Dumas <pertusus@free.fr>
TODO: update text on libraries as there are now private API at diverse
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index bebf3b7f52..069b82d0ac 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -111,8 +111,10 @@ my %XS_conversion_overrides = (
# following are not called when output and convert are overriden
"Texinfo::Convert::HTML::_XS_format_setup"
=> "Texinfo::Convert::ConvertXS::html_format_setup",
- "Texinfo::Convert::HTML::_XS_html_converter_initialize"
- => "Texinfo::Convert::ConvertXS::html_converter_initialize_sv",
+ "Texinfo::Convert::HTML::_XS_html_converter_initialize_beginning"
+ => "Texinfo::Convert::ConvertXS::html_converter_initialize_beginning",
+ "Texinfo::Convert::HTML::_XS_html_converter_get_customization"
+ => "Texinfo::Convert::ConvertXS::html_converter_get_customization_sv",
"Texinfo::Convert::HTML::conversion_initialization"
=> "Texinfo::Convert::ConvertXS::html_conversion_initialization",
"Texinfo::Convert::HTML::_setup_convert"
@@ -8689,7 +8691,11 @@ my %special_characters = (
'non_breaking_space' => [$xml_named_entity_nbsp, '00A0'],
);
-sub _XS_html_converter_initialize($$$$$$$$$$$$$$$$$$)
+sub _XS_html_converter_initialize_beginning($)
+{
+}
+
+sub _XS_html_converter_get_customization($$$$$$$$$$$$$$$$$$)
{
}
@@ -8699,9 +8705,10 @@ sub converter_initialize($)
{
my $self = shift;
- if (!($self->{'converter_descriptor'} and $XS_convert)) {
- # initializatin done either in Perl or XS
-
+ # beginning of initialization done either in Perl or XS
+ if ($self->{'converter_descriptor'} and $XS_convert) {
+ _XS_html_converter_initialize_beginning($self);
+ } else {
# used in initialization. Set if undef
if (!defined($self->get_conf('FORMAT_MENU'))) {
$self->force_conf('FORMAT_MENU', '');
@@ -9086,7 +9093,7 @@ sub converter_initialize($)
# XS parser initialization
if ($self->{'converter_descriptor'} and $XS_convert) {
- _XS_html_converter_initialize($self,
+ _XS_html_converter_get_customization($self,
\%default_formatting_references,
\%default_css_string_formatting_references,
\%default_commands_open,
diff --git a/tp/Texinfo/XS/convert/ConvertXS.xs
b/tp/Texinfo/XS/convert/ConvertXS.xs
index 2448ce3923..2968b3e1fc 100644
--- a/tp/Texinfo/XS/convert/ConvertXS.xs
+++ b/tp/Texinfo/XS/convert/ConvertXS.xs
@@ -58,6 +58,7 @@
#include "convert_html.h"
#include "format_html.h"
#include "html_prepare_converter.h"
+#include "html_converter_init_options.h"
#include "get_html_perl_info.h"
/* See the NOTE in build_perl_info.c on use of functions related to
@@ -600,11 +601,22 @@ void
html_format_setup ()
void
-html_converter_initialize_sv (SV *converter_in, SV
*default_formatting_references, SV *default_css_string_formatting_references,
SV *default_commands_open, SV *default_commands_conversion, SV
*default_css_string_commands_conversion, SV *default_types_open, SV
*default_types_conversion, SV *default_css_string_types_conversion, SV
*default_output_units_conversion, SV *default_special_unit_body, SV
*customized_upper_case_commands, SV *customized_type_formatting, SV
*customized_accent_entiti [...]
+html_converter_initialize_beginning (SV *converter_in)
PREINIT:
CONVERTER *self;
CODE:
- self = get_sv_converter (converter_in, "html_converter_initialize_sv");
+ self = get_sv_converter (converter_in,
+ "html_converter_initialize_beginning");
+ if (self)
+ html_converter_initialize_beginning (self);
+
+void
+html_converter_get_customization_sv (SV *converter_in, SV
*default_formatting_references, SV *default_css_string_formatting_references,
SV *default_commands_open, SV *default_commands_conversion, SV
*default_css_string_commands_conversion, SV *default_types_open, SV
*default_types_conversion, SV *default_css_string_types_conversion, SV
*default_output_units_conversion, SV *default_special_unit_body, SV
*customized_upper_case_commands, SV *customized_type_formatting, SV
*customized_accent [...]
+ PREINIT:
+ CONVERTER *self;
+ CODE:
+ self = get_sv_converter (converter_in,
+ "html_converter_customization_sv");
/* initialize first the special unit info, as the special unit
directions are needed for the remainder of initialization.
@@ -614,7 +626,7 @@ html_converter_initialize_sv (SV *converter_in, SV
*default_formatting_reference
html_converter_init_special_unit_sv (converter_in,
customized_special_unit_info);
html_converter_init_special_unit (self);
- html_converter_initialize_sv (converter_in,
+ html_converter_get_customization_sv (converter_in,
default_formatting_references,
default_css_string_formatting_references,
default_commands_open,
diff --git a/tp/Texinfo/XS/convert/converter.c
b/tp/Texinfo/XS/convert/converter.c
index b823c7c136..a1a13fdbe4 100644
--- a/tp/Texinfo/XS/convert/converter.c
+++ b/tp/Texinfo/XS/convert/converter.c
@@ -59,16 +59,14 @@
#include "unicode.h"
#include "manipulate_indices.h"
#include "document.h"
-#include "html_converter_init_options.h"
-#include "html_converter_finish.h"
-#include "call_perl_function.h"
+#include "html_converter_api.h"
#include "converter.h"
/* table used to dispatch format specific functions.
Same purpose as inherited methods in Texinfo::Convert::Converter */
CONVERTER_FORMAT_DATA converter_format_data[] = {
{"html", "Texinfo::Convert::HTML", &html_converter_defaults,
- &html_converter_initialize, &html_reset_converter,
+ /* &html_converter_initialize */ 0, &html_reset_converter,
&html_free_converter},
};
@@ -320,7 +318,7 @@ apply_converter_info (CONVERTER *converter,
/* apply format_defaults and user_conf initialization information and call
format specific options setting and initialization functions.
- Correspond to Perl _generic_converter_init and part of converter_initialize.
+ Correspond to Perl _generic_converter_init.
*/
void
set_converter_init_information (CONVERTER *converter,
@@ -358,15 +356,15 @@ set_converter_init_information (CONVERTER *converter,
converter->converted_format);
*/
+ /*
if (converter_format != COF_none
&& converter_format_data[converter_format].converter_initialize)
{
- /* beginning of Perl converter_initialize always done in C even when
- called from Perl */
void (* format_converter_initialize) (CONVERTER *self)
= converter_format_data[converter_format].converter_initialize;
format_converter_initialize (converter);
}
+ */
}
CONVERTER_INITIALIZATION_INFO *
diff --git a/tp/Texinfo/XS/convert/get_html_perl_info.c
b/tp/Texinfo/XS/convert/get_html_perl_info.c
index a06674deb0..2bd4779a85 100644
--- a/tp/Texinfo/XS/convert/get_html_perl_info.c
+++ b/tp/Texinfo/XS/convert/get_html_perl_info.c
@@ -228,7 +228,7 @@ html_converter_init_special_unit_sv (SV *converter_sv,
}
void
-html_converter_initialize_sv (SV *converter_sv,
+html_converter_get_customization_sv (SV *converter_sv,
SV *default_formatting_references,
SV *default_css_string_formatting_references,
SV *default_commands_open,
@@ -284,7 +284,8 @@ html_converter_initialize_sv (SV *converter_sv,
dTHX;
- converter = get_sv_converter (converter_sv, "html_converter_initialize_sv");
+ converter = get_sv_converter (converter_sv,
+ "html_converter_get_customization_sv");
special_unit_varieties = &converter->special_unit_varieties;
diff --git a/tp/Texinfo/XS/convert/get_html_perl_info.h
b/tp/Texinfo/XS/convert/get_html_perl_info.h
index cc4943dc27..0f6af56d7b 100644
--- a/tp/Texinfo/XS/convert/get_html_perl_info.h
+++ b/tp/Texinfo/XS/convert/get_html_perl_info.h
@@ -13,7 +13,7 @@ size_t get_output_units_descriptor_converter_sv (SV
*converter_in);
void html_converter_init_special_unit_sv (SV *converter_sv,
SV *customized_special_unit_info);
-void html_converter_initialize_sv (SV *converter_sv,
+void html_converter_get_customization_sv (SV *converter_sv,
SV *default_formatting_references,
SV *default_css_string_formatting_references,
SV *default_commands_open,
diff --git a/tp/Texinfo/XS/convert/html_converter_api.h
b/tp/Texinfo/XS/convert/html_converter_api.h
index 7508d8f6a4..3829c85b02 100644
--- a/tp/Texinfo/XS/convert/html_converter_api.h
+++ b/tp/Texinfo/XS/convert/html_converter_api.h
@@ -31,7 +31,7 @@ void html_format_setup (void);
void html_converter_defaults (CONVERTER *self,
CONVERTER_INITIALIZATION_INFO *format_defaults);
-void html_converter_initialize (CONVERTER *self);
+void html_converter_initialize_beginning (CONVERTER *self);
/* in html_prepare_converter.c */
void html_converter_init_special_unit (CONVERTER *self);
diff --git a/tp/Texinfo/XS/convert/html_converter_init_options.c
b/tp/Texinfo/XS/convert/html_converter_init_options.c
index 956aeadda4..bcc3a5986c 100644
--- a/tp/Texinfo/XS/convert/html_converter_init_options.c
+++ b/tp/Texinfo/XS/convert/html_converter_init_options.c
@@ -164,7 +164,7 @@ html_converter_defaults (CONVERTER *self,
/* this code corresponds to the Perl converter_initialize code, only for
code to be called before Perl customization setup information is passed */
void
-html_converter_initialize (CONVERTER *self)
+html_converter_initialize_beginning (CONVERTER *self)
{
const char *split = self->conf->SPLIT.o.string;
int max_header_level = self->conf->MAX_HEADER_LEVEL.o.integer;
diff --git a/tp/Texinfo/XS/convert/html_converter_init_options.h
b/tp/Texinfo/XS/convert/html_converter_init_options.h
index eb96ae9c5c..e6c42e4d84 100644
--- a/tp/Texinfo/XS/convert/html_converter_init_options.h
+++ b/tp/Texinfo/XS/convert/html_converter_init_options.h
@@ -8,5 +8,5 @@
void html_converter_defaults (CONVERTER *self,
CONVERTER_INITIALIZATION_INFO *format_defaults);
-void html_converter_initialize (CONVERTER *self);
+void html_converter_initialize_beginning (CONVERTER *self);
#endif
diff --git a/tp/Texinfo/XS/convert/html_prepare_converter.c
b/tp/Texinfo/XS/convert/html_prepare_converter.c
index 476d81a2b1..88b3f013ce 100644
--- a/tp/Texinfo/XS/convert/html_prepare_converter.c
+++ b/tp/Texinfo/XS/convert/html_prepare_converter.c
@@ -1091,10 +1091,10 @@ static const SPECIAL_UNIT_BODY_INTERNAL_CONVERSION
{0, 0},
};
-/* When initializing from Perl, html_converter_initialize_sv is called first
- to set customization information based on Perl data. Then this function
- is called for the remainder of initialization that requires customization
- information.
+/* When initializing from Perl, html_converter_get_customization_sv is called
+ first to set customization information based on Perl data. Then this
+ function is called for the remainder of initialization that requires
+ customization information.
*/
void
html_converter_customize (CONVERTER *self)
diff --git a/tp/Texinfo/XS/convert/texinfo.c b/tp/Texinfo/XS/convert/texinfo.c
index d11ef33f56..45914d6b6c 100644
--- a/tp/Texinfo/XS/convert/texinfo.c
+++ b/tp/Texinfo/XS/convert/texinfo.c
@@ -350,6 +350,7 @@ txi_converter_initialize (CONVERTER *converter,
switch (converter_format)
{
case COF_html:
+ html_converter_initialize_beginning (converter);
html_converter_init_special_unit (converter);
html_converter_customize (converter);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/Convert/HTML.pm (_XS_html_converter_get_customization) tp/Texinfo/XS/convert/ConvertXS.xs (html_converter_get_customization_sv), tp/Texinfo/XS/convert/get_html_perl_info.c (html_converter_get_customization_sv): rename html_converter_get_customization_sv as _XS_html_converter_get_customization.,
Patrice Dumas <=