[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Fri, 15 Nov 2024 18:35:53 -0500 (EST) |
branch: master
commit f37e4b8ddea2c6c6372c8fd0f9fb0f85a90d3497
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Fri Nov 15 23:00:24 2024 +0100
* tp/Texinfo/XS/convert/build_html_perl_state.c,
tp/Texinfo/XS/convert/call_html_perl_function.c
(html_argument_formatting_type_names)
(build_html_command_formatted_args),
tp/Texinfo/XS/convert/convert_html.c: move
html_argument_formatting_type_names and
build_html_command_formatted_args to call_html_perl_function.c.
* tp/Texinfo/XS/convert/build_html_perl_state.c: make
build_html_translated_names static.
---
ChangeLog | 13 ++++++
tp/Texinfo/XS/convert/build_html_perl_state.c | 55 ++++---------------------
tp/Texinfo/XS/convert/build_html_perl_state.h | 3 --
tp/Texinfo/XS/convert/call_html_perl_function.c | 51 ++++++++++++++++++++++-
tp/Texinfo/XS/convert/convert_html.c | 6 ---
tp/Texinfo/XS/convert/get_converter_perl_info.c | 2 +
tp/Texinfo/XS/convert/html_converter_api.c | 1 +
tp/Texinfo/XS/convert/html_converter_types.h | 1 -
tp/Texinfo/XS/main/IndicesXS.xs | 1 +
9 files changed, 74 insertions(+), 59 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ced05284b1..5337e1637d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,19 @@
Remove use of LONG_TESTS variable (same change made in
tp/tests/Makefile.am on 2016-10-23 but this file was missed).
+2024-11-15 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/convert/build_html_perl_state.c,
+ tp/Texinfo/XS/convert/call_html_perl_function.c
+ (html_argument_formatting_type_names)
+ (build_html_command_formatted_args),
+ tp/Texinfo/XS/convert/convert_html.c: move
+ html_argument_formatting_type_names and
+ build_html_command_formatted_args to call_html_perl_function.c.
+
+ * tp/Texinfo/XS/convert/build_html_perl_state.c: make
+ build_html_translated_names static.
+
2024-11-15 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/convert/html_prepare_converter.c
diff --git a/tp/Texinfo/XS/convert/build_html_perl_state.c
b/tp/Texinfo/XS/convert/build_html_perl_state.c
index 93a4b7a957..baa43aaf7b 100644
--- a/tp/Texinfo/XS/convert/build_html_perl_state.c
+++ b/tp/Texinfo/XS/convert/build_html_perl_state.c
@@ -15,6 +15,9 @@
#include <config.h>
+#include <string.h>
+#include <stdio.h>
+
/* Avoid namespace conflicts. */
#define context perl_context
@@ -36,10 +39,11 @@
#include "builtin_commands.h"
/* for fatal HMSF_* */
#include "utils.h"
-#include "extra.h"
-/* for debugging */
+/* next two could be interesting for debugging */
+/*
#include "debug.h"
#include "convert_to_texinfo.h"
+ */
#include "output_unit.h"
#include "command_stack.h"
/* for call_common_set_output_perl_encoding */
@@ -57,8 +61,6 @@
#include "html_prepare_converter.h"
#include "build_html_perl_state.h"
-#define LOCALEDIR DATADIR "/locale"
-
/* See the NOTE in build_perl_info.c on use of functions related to
memory allocation */
@@ -622,7 +624,7 @@ html_pass_output_units_global_targets (CONVERTER *self, SV
*output_units_sv,
}
}
-void
+static void
build_html_translated_names (HV *hv, CONVERTER *converter)
{
int j;
@@ -783,49 +785,6 @@ build_html_formatting_state (CONVERTER *converter)
converter->modified_state = 0;
}
-SV *
-build_html_command_formatted_args (const HTML_ARGS_FORMATTED *args_formatted)
-{
- AV *av;
- size_t i;
-
- dTHX;
-
- if (!args_formatted)
- return newSV (0);
-
- av = newAV ();
-
- for (i = 0; i < args_formatted->number; i++)
- {
- const HTML_ARG_FORMATTED *arg_formatted = &args_formatted->args[i];
- if (arg_formatted->arg_tree)
- {
- int j;
- HV *arg_formated_hv = newHV ();
- av_push (av, newRV_noinc ((SV *) arg_formated_hv));
-
- hv_store (arg_formated_hv, "arg_tree", strlen ("arg_tree"),
- newRV_inc ((SV *) arg_formatted->arg_tree->hv), 0);
-
- for (j = 0; j < AFT_type_raw+1; j++)
- {
- if (arg_formatted->formatted[j])
- {
- const char *format_name
- = html_argument_formatting_type_names[j];
- hv_store (arg_formated_hv, format_name, strlen (format_name),
- newSVpv_utf8 (arg_formatted->formatted[j], 0), 0);
- }
- }
- }
- else
- av_push (av, newSV(0));
- }
-
- return newRV_noinc ((SV *) av);
-}
-
SV *
build_replaced_substrings (NAMED_STRING_ELEMENT_LIST *replaced_substrings)
{
diff --git a/tp/Texinfo/XS/convert/build_html_perl_state.h
b/tp/Texinfo/XS/convert/build_html_perl_state.h
index 6e5a5ecdce..f54019742d 100644
--- a/tp/Texinfo/XS/convert/build_html_perl_state.h
+++ b/tp/Texinfo/XS/convert/build_html_perl_state.h
@@ -13,7 +13,6 @@
void html_pass_xtmlxref (HTMLXREF_MANUAL_LIST *htmlxref_list, SV
*converter_sv);
HV *build_html_target (const HTML_TARGET *html_target);
-void build_html_translated_names (HV *hv, CONVERTER *converter);
void html_pass_conversion_initialization (CONVERTER *converter,
SV *converter_sv, SV *document_in);
@@ -46,8 +45,6 @@ void pass_html_elements_in_file_count (SV *converter_sv,
void build_html_formatting_state (CONVERTER *converter);
-SV *build_html_command_formatted_args
- (const HTML_ARGS_FORMATTED *args_formatted);
SV *build_replaced_substrings (NAMED_STRING_ELEMENT_LIST *replaced_substrings);
void build_pending_footnotes (AV *av, HTML_PENDING_FOOTNOTE_STACK *stack);
diff --git a/tp/Texinfo/XS/convert/call_html_perl_function.c
b/tp/Texinfo/XS/convert/call_html_perl_function.c
index 7c610f030e..2d8591d7d3 100644
--- a/tp/Texinfo/XS/convert/call_html_perl_function.c
+++ b/tp/Texinfo/XS/convert/call_html_perl_function.c
@@ -48,7 +48,7 @@
#include "debug.h"
/* for newSVpv_utf8 build_tree_to_build */
#include "build_perl_info.h"
-/* build_html_formatting_state build_html_command_formatted_args */
+/* build_html_formatting_state */
#include "build_html_perl_state.h"
#include "call_html_perl_function.h"
@@ -1905,6 +1905,55 @@ call_types_open (CONVERTER *self, const enum
element_type type,
LEAVE;
}
+static const char *html_argument_formatting_type_names[] = {
+ #define html_aft_type(name) #name,
+ HTML_ARGUMENTS_FORMATTED_FORMAT_TYPE
+ #undef html_aft_type
+};
+
+static SV *
+build_html_command_formatted_args (const HTML_ARGS_FORMATTED *args_formatted)
+{
+ AV *av;
+ size_t i;
+
+ dTHX;
+
+ if (!args_formatted)
+ return newSV (0);
+
+ av = newAV ();
+
+ for (i = 0; i < args_formatted->number; i++)
+ {
+ const HTML_ARG_FORMATTED *arg_formatted = &args_formatted->args[i];
+ if (arg_formatted->arg_tree)
+ {
+ int j;
+ HV *arg_formated_hv = newHV ();
+ av_push (av, newRV_noinc ((SV *) arg_formated_hv));
+
+ hv_store (arg_formated_hv, "arg_tree", strlen ("arg_tree"),
+ newRV_inc ((SV *) arg_formatted->arg_tree->hv), 0);
+
+ for (j = 0; j < AFT_type_raw+1; j++)
+ {
+ if (arg_formatted->formatted[j])
+ {
+ const char *format_name
+ = html_argument_formatting_type_names[j];
+ hv_store (arg_formated_hv, format_name, strlen (format_name),
+ newSVpv_utf8 (arg_formatted->formatted[j], 0), 0);
+ }
+ }
+ }
+ else
+ av_push (av, newSV(0));
+ }
+
+ return newRV_noinc ((SV *) av);
+}
+
void
call_commands_conversion (CONVERTER *self, const enum command_id cmd,
const FORMATTING_REFERENCE *formatting_reference,
diff --git a/tp/Texinfo/XS/convert/convert_html.c
b/tp/Texinfo/XS/convert/convert_html.c
index d08954543e..881bcbd2bc 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -72,12 +72,6 @@ const char *html_conversion_context_type_names[] = {
#undef cctx_type
};
-const char *html_argument_formatting_type_names[] = {
- #define html_aft_type(name) #name,
- HTML_ARGUMENTS_FORMATTED_FORMAT_TYPE
- #undef html_aft_type
-};
-
const char *html_stage_handler_stage_type_names[] = {
#define html_hsht_type(name) #name,
HTML_STAGE_HANDLER_STAGE_TYPE
diff --git a/tp/Texinfo/XS/convert/get_converter_perl_info.c
b/tp/Texinfo/XS/convert/get_converter_perl_info.c
index 883517cab5..9913acb5a9 100644
--- a/tp/Texinfo/XS/convert/get_converter_perl_info.c
+++ b/tp/Texinfo/XS/convert/get_converter_perl_info.c
@@ -41,6 +41,8 @@
#include "customization_options.h"
#include "convert_to_text.h"
#include "get_perl_info.h"
+/* retrieve_converter find_perl_converter_class_converter_format
+ new_converter converter_set_document new_converter_initialization_info */
#include "converter.h"
#include "get_converter_perl_info.h"
diff --git a/tp/Texinfo/XS/convert/html_converter_api.c
b/tp/Texinfo/XS/convert/html_converter_api.c
index 7911e832d1..d5e7e47c14 100644
--- a/tp/Texinfo/XS/convert/html_converter_api.c
+++ b/tp/Texinfo/XS/convert/html_converter_api.c
@@ -22,6 +22,7 @@
#include <stdio.h>
#include "document_types.h"
+/* converter_set_document */
#include "converter.h"
#include "html_conversion_api.h"
#include "html_converter_api.h"
diff --git a/tp/Texinfo/XS/convert/html_converter_types.h
b/tp/Texinfo/XS/convert/html_converter_types.h
index f70e0781d6..678370dbac 100644
--- a/tp/Texinfo/XS/convert/html_converter_types.h
+++ b/tp/Texinfo/XS/convert/html_converter_types.h
@@ -84,7 +84,6 @@ extern const char *direction_string_context_names[];
/* in convert_html.c */
extern const char *html_conversion_context_type_names[];
-extern const char *html_argument_formatting_type_names[];
extern const char *html_stage_handler_stage_type_names[];
extern COMMAND_ARGS_SPECIFICATION html_command_args_flags[BUILTIN_CMD_NUMBER];
diff --git a/tp/Texinfo/XS/main/IndicesXS.xs b/tp/Texinfo/XS/main/IndicesXS.xs
index 1f1a19a8c0..62821f3d82 100644
--- a/tp/Texinfo/XS/main/IndicesXS.xs
+++ b/tp/Texinfo/XS/main/IndicesXS.xs
@@ -31,6 +31,7 @@
#include "document.h"
#include "manipulate_indices.h"
#include "get_perl_info.h"
+/* get_sv_converter copy_sv_options_for_convert_text */
#include "get_converter_perl_info.h"
/* for newSVpv_utf8 */
#include "build_perl_info.h"