[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Tue, 12 Mar 2024 19:09:28 -0400 (EDT) |
branch: master
commit 7f08bef0dec55bb8f571385051d8094888bd1407
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Mar 13 00:07:36 2024 +0100
No information to Perl if no Perl functions are potentially called
* tp/Texinfo/XS/convert/ConvertXS.xs (html_prepare_title_titlepage)
(html_convert_convert, html_convert_output),
tp/Texinfo/XS/convert/convert_html.c (html_convert_convert)
(html_prepare_title_titlepage, html_convert_output): get output units
descriptors from converter.
* tp/Texinfo/XS/convert/ConvertXS.xs (html_prepare_conversion_units),
tp/Texinfo/XS/convert/convert_html.c (html_converter_initialize),
tp/Texinfo/XS/main/converter_types.h (CONVERTER): set a counter based
on total Perl function references potentially called.
* tp/Texinfo/XS/convert/ConvertXS.xs (html_prepare_conversion_units)
(html_prepare_units_directions_files)
(html_prepare_output_units_global_targets)
(html_prepare_converted_output_info, html_prepare_title_titlepage),
tp/Texinfo/XS/convert/build_html_perl_state.c
(build_html_formatting_state),
tp/Texinfo/XS/convert/convert_html.c (html_translate_names),
tp/Texinfo/XS/main/build_perl_info.c (setup_output_units_handler):
do not pass information to Perl if Perl functions are not called.
---
ChangeLog | 25 ++++
tp/Texinfo/XS/convert/ConvertXS.xs | 164 +++++++++++++-------------
tp/Texinfo/XS/convert/build_html_perl_state.c | 3 +
tp/Texinfo/XS/convert/convert_html.c | 58 +++++----
tp/Texinfo/XS/convert/convert_html.h | 9 +-
tp/Texinfo/XS/main/build_perl_info.c | 42 ++++++-
tp/Texinfo/XS/main/build_perl_info.h | 1 +
tp/Texinfo/XS/main/converter_types.h | 2 +
8 files changed, 188 insertions(+), 116 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ffd03f7d5f..c77d0f9259 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,31 @@
the example. Move discussion of having at least one @item, index
entries and comments, and blank lines after the example usage.
+2024-03-12 Patrice Dumas <pertusus@free.fr>
+
+ No information to Perl if no Perl functions are potentially called
+
+ * tp/Texinfo/XS/convert/ConvertXS.xs (html_prepare_title_titlepage)
+ (html_convert_convert, html_convert_output),
+ tp/Texinfo/XS/convert/convert_html.c (html_convert_convert)
+ (html_prepare_title_titlepage, html_convert_output): get output units
+ descriptors from converter.
+
+ * tp/Texinfo/XS/convert/ConvertXS.xs (html_prepare_conversion_units),
+ tp/Texinfo/XS/convert/convert_html.c (html_converter_initialize),
+ tp/Texinfo/XS/main/converter_types.h (CONVERTER): set a counter based
+ on total Perl function references potentially called.
+
+ * tp/Texinfo/XS/convert/ConvertXS.xs (html_prepare_conversion_units)
+ (html_prepare_units_directions_files)
+ (html_prepare_output_units_global_targets)
+ (html_prepare_converted_output_info, html_prepare_title_titlepage),
+ tp/Texinfo/XS/convert/build_html_perl_state.c
+ (build_html_formatting_state),
+ tp/Texinfo/XS/convert/convert_html.c (html_translate_names),
+ tp/Texinfo/XS/main/build_perl_info.c (setup_output_units_handler):
+ do not pass information to Perl if Perl functions are not called.
+
2024-03-12 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/convert/ConvertXS.xs
diff --git a/tp/Texinfo/XS/convert/ConvertXS.xs
b/tp/Texinfo/XS/convert/ConvertXS.xs
index f73e22278c..8c6eac90b4 100644
--- a/tp/Texinfo/XS/convert/ConvertXS.xs
+++ b/tp/Texinfo/XS/convert/ConvertXS.xs
@@ -1858,7 +1858,6 @@ html_prepare_conversion_units (SV *converter_in, ...)
SV *special_units_sv;
SV *associated_special_units_sv;
HV *output_units_hv;
- SV **document_sv;
PPCODE:
if (items > 2 && SvOK(ST(2)))
document_name = SvPVutf8_nolen (ST(2));
@@ -1873,25 +1872,44 @@ html_prepare_conversion_units (SV *converter_in, ...)
self->use_unicode_text = 1;
html_prepare_conversion_units (self);
+ converter_hv = (HV *) SvRV (converter_in);
+
+ /* internal links code is in Perl */
+ if (self->conf->INTERNAL_LINKS.string)
+ self->external_references_number++;
+ /* Conversion to LaTeX is in Perl */
+ if (self->conf->CONVERT_TO_LATEX_IN_MATH.integer > 0)
+ self->external_references_number++;
+ if (self->external_references_number > 0)
+ {
/* need to setup the Perl tree before rebuilding the output units as
they refer to Perl root command elements */
- converter_hv = (HV *) SvRV (converter_in);
- document_sv
- = hv_fetch (converter_hv, "document", strlen ("document"), 0);
- if (document_sv)
+ SV **document_sv
+ = hv_fetch (converter_hv, "document", strlen ("document"), 0);
+ if (document_sv)
+ {
+ HV *document_hv = (HV *) SvRV (*document_sv);
+ store_texinfo_tree (self->document, document_hv);
+ }
+
+ output_units_sv = build_output_units_list
+ (self->output_units_descriptors[OUDT_units]);
+ special_units_sv = build_output_units_list
+ (self->output_units_descriptors[OUDT_special_units]);
+ associated_special_units_sv = build_output_units_list
+ (self->output_units_descriptors[OUDT_associated_special_units]);
+ }
+ else
{
- HV *document_hv = (HV *) SvRV (*document_sv);
- store_texinfo_tree (self->document, document_hv);
+ output_units_sv = setup_output_units_handler
+ (self->output_units_descriptors[OUDT_units]);
+ special_units_sv = setup_output_units_handler
+ (self->output_units_descriptors[OUDT_special_units]);
+ associated_special_units_sv = setup_output_units_handler
+ (self->output_units_descriptors[OUDT_associated_special_units]);
}
- output_units_sv = build_output_units_list
- (self->output_units_descriptors[OUDT_units]);
- special_units_sv = build_output_units_list
- (self->output_units_descriptors[OUDT_special_units]);
- associated_special_units_sv = build_output_units_list
- (self->output_units_descriptors[OUDT_associated_special_units]);
-
output_units_hv = (HV *) SvRV (output_units_sv);
hv_store (converter_hv, "document_units", strlen ("document_units"),
newRV_inc ((SV *) output_units_hv), 0);
@@ -1915,7 +1933,7 @@ html_prepare_units_directions_files (SV *converter_in, SV
*output_units_in, SV *
PREINIT:
CONVERTER *self = 0;
FILE_SOURCE_INFO_LIST *files_source_info = 0;
- SV *files_source_info_sv;
+ SV *files_source_info_sv = 0;
CODE:
self = get_sv_converter (converter_in,
"html_prepare_units_directions_files");
@@ -1923,23 +1941,26 @@ html_prepare_units_directions_files (SV *converter_in,
SV *output_units_in, SV *
output_file, destination_directory, output_filename,
document_name);
- rebuild_output_units_list (output_units_in,
+ if (self->external_references_number > 0)
+ {
+ rebuild_output_units_list (output_units_in,
self->output_units_descriptors[OUDT_units]);
- rebuild_output_units_list (special_units_in,
+ rebuild_output_units_list (special_units_in,
self->output_units_descriptors[OUDT_special_units]);
- rebuild_output_units_list (associated_special_units_in,
- self->output_units_descriptors[OUDT_associated_special_units]);
+ rebuild_output_units_list (associated_special_units_in,
+ self->output_units_descriptors[OUDT_associated_special_units]);
- files_source_info_sv
- = build_html_files_source_info (files_source_info);
- pass_html_global_units_directions (converter_in,
+ files_source_info_sv
+ = build_html_files_source_info (files_source_info);
+ pass_html_global_units_directions (converter_in,
self->global_units_directions,
self->special_units_direction_name);
- pass_html_elements_in_file_count (converter_in,
- &self->output_unit_files);
+ pass_html_elements_in_file_count (converter_in,
+ &self->output_unit_files);
- /* file names API */
- pass_output_unit_files (converter_in, &self->output_unit_files);
+ /* file names API */
+ pass_output_unit_files (converter_in, &self->output_unit_files);
+ }
RETVAL = files_source_info_sv;
OUTPUT:
@@ -1954,16 +1975,19 @@ html_prepare_output_units_global_targets (SV
*converter_in, SV *output_units_in,
"html_prepare_output_units_global_targets");
html_prepare_output_units_global_targets (self);
- rebuild_output_units_list (output_units_in,
+ if (self->external_references_number > 0)
+ {
+ rebuild_output_units_list (output_units_in,
self->output_units_descriptors[OUDT_units]);
- rebuild_output_units_list (special_units_in,
+ rebuild_output_units_list (special_units_in,
self->output_units_descriptors[OUDT_special_units]);
- rebuild_output_units_list (associated_special_units_in,
- self->output_units_descriptors[OUDT_associated_special_units]);
+ rebuild_output_units_list (associated_special_units_in,
+ self->output_units_descriptors[OUDT_associated_special_units]);
- pass_html_global_units_directions (converter_in,
+ pass_html_global_units_directions (converter_in,
self->global_units_directions,
self->special_units_direction_name);
+ }
void
@@ -2012,25 +2036,30 @@ html_prepare_converted_output_info (SV *converter_in)
HV *converter_hv = (HV *) SvRV (converter_in);
html_prepare_converted_output_info (self);
- if (self->added_title_tree)
- build_texinfo_tree (self->title_tree, 1);
-
- if (self->simpletitle_tree)
- build_simpletitle (self, converter_hv);
- hv_store (converter_hv, "title_tree", strlen ("title_tree"),
- newRV_inc ((SV *) self->title_tree->hv), 0);
- hv_store (converter_hv, "title_string", strlen ("title_string"),
- newSVpv_utf8 (self->title_string, 0), 0);
-
- if (self->copying_comment)
- hv_store (converter_hv, "copying_comment",
- strlen ("copying_comment"),
- newSVpv_utf8 (self->copying_comment, 0), 0);
- if (self->documentdescription_string)
- hv_store (converter_hv, "documentdescription_string",
- strlen ("documentdescription_string"),
- newSVpv_utf8 (self->documentdescription_string, 0),
0);
+ if (self->external_references_number > 0)
+ {
+ if (self->added_title_tree)
+ build_texinfo_tree (self->title_tree, 1);
+
+ if (self->simpletitle_tree)
+ build_simpletitle (self, converter_hv);
+
+ hv_store (converter_hv, "title_tree", strlen ("title_tree"),
+ newRV_inc ((SV *) self->title_tree->hv), 0);
+ hv_store (converter_hv, "title_string",
+ strlen ("title_string"),
+ newSVpv_utf8 (self->title_string, 0), 0);
+
+ if (self->copying_comment)
+ hv_store (converter_hv, "copying_comment",
+ strlen ("copying_comment"),
+ newSVpv_utf8 (self->copying_comment, 0), 0);
+ if (self->documentdescription_string)
+ hv_store (converter_hv, "documentdescription_string",
+ strlen ("documentdescription_string"),
+ newSVpv_utf8 (self->documentdescription_string, 0), 0);
+ }
}
void
@@ -2039,27 +2068,20 @@ html_prepare_title_titlepage (SV *converter_in, SV
*output_units_in, output_file
const char *output_filename = (char *)SvPVutf8_nolen($arg);
PREINIT:
CONVERTER *self = 0;
- int output_units_descriptor = 0;
CODE:
self = get_sv_converter (converter_in,
"html_prepare_title_titlepage");
- if (SvOK (output_units_in))
- output_units_descriptor
- = get_sv_output_units_descriptor (output_units_in,
- "html_prepare_title_titlepage output units");
-
if (self)
{
html_converter_prepare_output_sv (converter_in, self);
- html_prepare_title_titlepage (self, output_units_descriptor,
- output_file, output_filename);
+ html_prepare_title_titlepage (self, output_file, output_filename);
if (self->modified_state)
{
build_html_formatting_state (self, self->modified_state);
self->modified_state = 0;
}
/* should always happen as a string is always returned, possibly empty */
- if (self->title_titlepage)
+ if (self->title_titlepage && self->external_references_number > 0)
{
HV *converter_hv = (HV *) SvRV (converter_in);
SV *title_titlepage_sv
@@ -2074,8 +2096,6 @@ html_convert_convert (SV *converter_in, SV *document_in,
SV *output_units_in, SV
PREINIT:
CONVERTER *self = 0;
DOCUMENT *document = 0;
- int output_units_descriptor = 0;
- int special_units_descriptor = 0;
char *result;
CODE:
self = get_sv_converter (converter_in, "html_convert_convert");
@@ -2083,17 +2103,7 @@ html_convert_convert (SV *converter_in, SV *document_in,
SV *output_units_in, SV
do not match. There is no reason why it would happen, though */
document = get_sv_document_document (document_in,
"html_convert_convert");
- if (SvOK (output_units_in))
- output_units_descriptor
- = get_sv_output_units_descriptor (output_units_in,
- "html_convert_convert output units");
- if (SvOK (special_units_in))
- special_units_descriptor
- = get_sv_output_units_descriptor (special_units_in,
- "html_convert_convert special units");
- result = html_convert_convert (self, document->tree,
- output_units_descriptor,
- special_units_descriptor);
+ result = html_convert_convert (self, document->tree);
if (self->modified_state)
{
build_html_formatting_state (self, self->modified_state);
@@ -2142,27 +2152,15 @@ html_convert_output (SV *converter_in, SV *document_in,
SV *output_units_in, SV
PREINIT:
CONVERTER *self = 0;
DOCUMENT *document = 0;
- int output_units_descriptor = 0;
- int special_units_descriptor = 0;
SV *result_sv = 0;
CODE:
/* add warn string? */
self = get_sv_converter (converter_in, "html_convert_output");
document = get_sv_document_document (document_in,
"html_convert_output");
- if (SvOK (output_units_in))
- output_units_descriptor
- = get_sv_output_units_descriptor (output_units_in,
- "html_convert_output output units");
- if (SvOK (special_units_in))
- special_units_descriptor
- = get_sv_output_units_descriptor (special_units_in,
- "html_convert_output special units");
-
if (self && document)
{
char *result = html_convert_output (self, document->tree,
- output_units_descriptor, special_units_descriptor,
output_file, destination_directory, output_filename,
document_name);
diff --git a/tp/Texinfo/XS/convert/build_html_perl_state.c
b/tp/Texinfo/XS/convert/build_html_perl_state.c
index 7c4ecfd189..1447134a3b 100644
--- a/tp/Texinfo/XS/convert/build_html_perl_state.c
+++ b/tp/Texinfo/XS/convert/build_html_perl_state.c
@@ -364,6 +364,9 @@ build_html_formatting_state (CONVERTER *converter, unsigned
long flags)
if (!converter->hv)
return;
+ if (converter->external_references_number <= 0)
+ return;
+
hv = converter->hv;
#define FETCH(key) key##_sv = hv_fetch (hv, #key, strlen (#key), 0);
diff --git a/tp/Texinfo/XS/convert/convert_html.c
b/tp/Texinfo/XS/convert/convert_html.c
index 51d8558608..521a36aff6 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -16371,7 +16371,7 @@ html_converter_initialize (CONVERTER *self)
functions by internal functions in C.
*/
if (self->conf->XS_EXTERNAL_CONVERSION.integer > 0)
- return;
+ goto out;
for (i = 0; types_internal_conversion_table[i].type_conversion; i++)
{
@@ -16620,6 +16620,18 @@ html_converter_initialize (CONVERTER *self)
}
}
}
+
+ out:
+ self->external_references_number = self->conf->BIT_user_function_number
+ + self->file_id_setting_ref_number
+ + external_special_unit_body_formatting_function
+ + external_output_unit_conversion_function
+ + external_command_conversion_function
+ + external_command_open_function
+ + external_type_conversion_function
+ + external_type_open_function
+ + external_formatting_function;
+
/*
fprintf (stderr, "sbf %d ouc %d cc %d co %d tc %d to %d f %d\n",
external_special_unit_body_formatting_function,
@@ -17429,8 +17441,8 @@ html_translate_names (CONVERTER *self)
}
/* self->no_arg_formatted_cmd_translated is used here to hold the translated
- commands, and the information is kept as it is also used to pass
- translated commands results to perl */
+ commands, and the information is kept if it is also used to pass
+ translated commands results to Perl */
if (self->no_arg_formatted_cmd.number)
{
int translated_nr = 0;
@@ -17467,7 +17479,7 @@ html_translate_names (CONVERTER *self)
ELEMENT *translated_tree = 0;
if (format_spec->translated_to_convert)
{/* it is very unlikely to have small strings to add,
- but in case there are is should be ok */
+ but in case there are it should be ok */
translated_tree =
html_cdt_tree (format_spec->translated_to_convert,
self, 0, 0);
@@ -17498,6 +17510,15 @@ html_translate_names (CONVERTER *self)
enum command_id cmd = translated_cmds->list[j];
complete_no_arg_commands_formatting (self, cmd, 1);
}
+
+ /* not passed to Perl in that case, unset to avoid spurious error
+ messages */
+ if (self->external_references_number <= 0)
+ {
+ memset (translated_cmds->list, 0, translated_cmds->number
+ * sizeof (enum command_id));
+ translated_cmds->number = 0;
+ }
}
if (self->conf->DEBUG.integer > 0)
@@ -18446,18 +18467,16 @@ convert_convert_output_unit_internal (CONVERTER
*self, TEXT *result,
}
char *
-html_convert_convert (CONVERTER *self, const ELEMENT *root,
- int output_units_descriptor,
- int special_units_descriptor)
+html_convert_convert (CONVERTER *self, const ELEMENT *root)
{
TEXT result;
int unit_nr = 0;
int i;
- const OUTPUT_UNIT_LIST *output_units
- = retrieve_output_units (output_units_descriptor);
- const OUTPUT_UNIT_LIST *special_units
- = retrieve_output_units (special_units_descriptor);
+ const OUTPUT_UNIT_LIST *output_units = retrieve_output_units
+ (self->output_units_descriptors[OUDT_units]);
+ const OUTPUT_UNIT_LIST *special_units = retrieve_output_units
+ (self->output_units_descriptors[OUDT_special_units]);
text_init (&result);
@@ -18645,12 +18664,11 @@ convert_output_output_unit_internal (CONVERTER *self,
}
void
-html_prepare_title_titlepage (CONVERTER *self, int output_units_descriptor,
- const char *output_file,
+html_prepare_title_titlepage (CONVERTER *self, const char *output_file,
const char *output_filename)
{
- const OUTPUT_UNIT_LIST *output_units
- = retrieve_output_units (output_units_descriptor);
+ const OUTPUT_UNIT_LIST *output_units = retrieve_output_units
+ (self->output_units_descriptors[OUDT_units]);
if (strlen (output_file))
{
@@ -18673,8 +18691,6 @@ html_prepare_title_titlepage (CONVERTER *self, int
output_units_descriptor,
char *
html_convert_output (CONVERTER *self, const ELEMENT *root,
- int output_units_descriptor,
- int special_units_descriptor,
const char *output_file, const char
*destination_directory,
const char *output_filename, const char *document_name)
{
@@ -18682,10 +18698,10 @@ html_convert_output (CONVERTER *self, const ELEMENT
*root,
TEXT result;
TEXT text; /* reused for all the output units */
- const OUTPUT_UNIT_LIST *output_units
- = retrieve_output_units (output_units_descriptor);
- const OUTPUT_UNIT_LIST *special_units
- = retrieve_output_units (special_units_descriptor);
+ const OUTPUT_UNIT_LIST *output_units = retrieve_output_units
+ (self->output_units_descriptors[OUDT_units]);
+ const OUTPUT_UNIT_LIST *special_units = retrieve_output_units
+ (self->output_units_descriptors[OUDT_special_units]);
text_init (&result);
text_init (&text);
diff --git a/tp/Texinfo/XS/convert/convert_html.h
b/tp/Texinfo/XS/convert/convert_html.h
index b60c242b70..f3c6dad7da 100644
--- a/tp/Texinfo/XS/convert/convert_html.h
+++ b/tp/Texinfo/XS/convert/convert_html.h
@@ -205,19 +205,14 @@ void html_translate_names (CONVERTER *self);
void html_prepare_simpletitle (CONVERTER *self);
void html_prepare_converted_output_info (CONVERTER *self);
-void html_prepare_title_titlepage (CONVERTER *self, int
output_units_descriptor,
- const char *output_file,
+void html_prepare_title_titlepage (CONVERTER *self, const char *output_file,
const char *output_filename);
-char *html_convert_convert (CONVERTER *self, const ELEMENT *root,
- int output_units_descriptor,
- int special_units_descriptor);
+char *html_convert_convert (CONVERTER *self, const ELEMENT *root);
char *html_convert_tree (CONVERTER *self, const ELEMENT *tree,
const char *explanation);
char *html_convert_output (CONVERTER *self, const ELEMENT *root,
- int output_units_descriptor,
- int special_units_descriptor,
const char *output_file,
const char *destination_directory,
const char *output_filename,
diff --git a/tp/Texinfo/XS/main/build_perl_info.c
b/tp/Texinfo/XS/main/build_perl_info.c
index 8f6e0dac12..a8e79472d5 100644
--- a/tp/Texinfo/XS/main/build_perl_info.c
+++ b/tp/Texinfo/XS/main/build_perl_info.c
@@ -1783,7 +1783,8 @@ output_unit_to_perl_hash (OUTPUT_UNIT *output_unit)
if (direction_unit->unit_type != OU_external_node_unit)
{
char *msg;
- xasprintf (&msg, "BUG: not external node but no perl ref %s",
+ xasprintf (&msg, "BUG: not external node but no"
+ " output unit Perl ref: %s",
output_unit_texi (direction_unit));
fatal (msg);
free (msg);
@@ -1951,12 +1952,43 @@ build_output_units_list (size_t output_units_descriptor)
output_units_descriptor))
{/* no output unit */
av_undef (av_output_units);
- return newSV(0);
+ return newSV (0);
}
else
return newRV_noinc ((SV *) av_output_units);
}
+/* a fake output units list that only holds a descriptor allowing
+ to retrieve the C data */
+SV *
+setup_output_units_handler (size_t output_units_descriptor)
+{
+ AV *av_output_units;
+ HV *dummy_output_unit;
+ SV *sv;
+ const OUTPUT_UNIT_LIST *output_units;
+
+ dTHX;
+
+ output_units = retrieve_output_units (output_units_descriptor);
+
+ if (!output_units || !output_units->number)
+ return newSV (0);
+
+ av_output_units = newAV ();
+
+ dummy_output_unit = newHV ();
+
+ hv_store (dummy_output_unit, "output_units_descriptor",
+ strlen ("output_units_descriptor"),
+ newSViv (output_units_descriptor), 0);
+
+ sv = newRV_inc ((SV *) dummy_output_unit);
+ av_push (av_output_units, sv);
+
+ return newRV_noinc ((SV *) av_output_units);
+}
+
void
rebuild_output_units_list (SV *output_units_sv, size_t output_units_descriptor)
{
@@ -1967,9 +1999,9 @@ rebuild_output_units_list (SV *output_units_sv, size_t
output_units_descriptor)
if (!SvOK (output_units_sv))
{
const OUTPUT_UNIT_LIST *output_units
- = retrieve_output_units (output_units_descriptor);
+ = retrieve_output_units (output_units_descriptor);
if (output_units && output_units->number)
- fprintf (stderr, "BUG: no input sv for %zu output units (%zu)",
+ fprintf (stderr, "BUG: no input sv for %zu output units (%zu)\n",
output_units->number, output_units_descriptor);
return;
}
@@ -1989,7 +2021,7 @@ rebuild_output_units_list (SV *output_units_sv, size_t
output_units_descriptor)
is better to have more debug messages.
*/
fprintf (stderr, "BUG: rebuild_output_units_list: output unit"
- "descriptor not found: %zu\n", output_units_descriptor);
+ " descriptor not found: %zu\n", output_units_descriptor);
return;
}
}
diff --git a/tp/Texinfo/XS/main/build_perl_info.h
b/tp/Texinfo/XS/main/build_perl_info.h
index 80d881513f..5810daf1b5 100644
--- a/tp/Texinfo/XS/main/build_perl_info.h
+++ b/tp/Texinfo/XS/main/build_perl_info.h
@@ -70,6 +70,7 @@ SV *pass_errors_to_registrar (ERROR_MESSAGE_LIST
*error_messages,
SV *build_output_units_list (size_t output_units_descriptor);
void rebuild_output_units_list (SV *output_units_sv,
size_t output_units_descriptor);
+SV *setup_output_units_handler (size_t output_units_descriptor);
AV *build_integer_stack (const INTEGER_STACK *integer_stack);
AV *build_string_list (const STRING_LIST *strings_list, enum sv_string_type);
diff --git a/tp/Texinfo/XS/main/converter_types.h
b/tp/Texinfo/XS/main/converter_types.h
index 81ed045f4d..08d4a12948 100644
--- a/tp/Texinfo/XS/main/converter_types.h
+++ b/tp/Texinfo/XS/main/converter_types.h
@@ -719,6 +719,8 @@ typedef struct CONVERTER {
/* HTML specific */
/* set for a converter */
+ int external_references_number; /* total number of external references
+ that could be called */
COMMAND_ID_LIST no_arg_formatted_cmd;
COMMAND_ID_LIST style_formatted_cmd;
COMMAND_ID_LIST accent_cmd;