texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Patrice Dumas
Date: Wed, 2 Oct 2024 06:05:16 -0400 (EDT)

branch: master
commit 2d4a0ab5cebd721f7d1c1104188f75c6fd1cf318
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Jul 30 21:35:34 2024 +0200

    * tp/Texinfo/Convert/HTML.pm (converter_initialize),
    tp/Texinfo/XS/convert/ConvertXS.xs (html_converter_initialize_sv),
    tp/Texinfo/XS/convert/convert_html.c (html_free_converter),
    tp/Texinfo/XS/convert/get_html_perl_info.c
    (html_converter_initialize_sv), tp/Texinfo/XS/main/converter_types.h
    (CONVERTER): do not set
    converter->default_converted_directions_strings anymore from Perl, as
    the C defaults are now used.  Remove the
    default_converted_directions_strings argument of
    html_converter_initialize_sv.  Remove the
    default_converted_directions_strings CONVERTER field.
---
 ChangeLog                                  | 14 +++++++
 tp/Texinfo/Convert/HTML.pm                 |  5 +--
 tp/Texinfo/XS/convert/ConvertXS.xs         |  5 +--
 tp/Texinfo/XS/convert/convert_html.c       | 11 -----
 tp/Texinfo/XS/convert/get_html_perl_info.c | 64 +-----------------------------
 tp/Texinfo/XS/convert/get_html_perl_info.h |  3 +-
 tp/Texinfo/XS/main/converter_types.h       |  1 -
 7 files changed, 20 insertions(+), 83 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 770c0cab3c..67f64b3b89 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,20 @@
        (converter_initialize): readd converter_initialize that was mistakenly
        removed.
 
+2024-07-30  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/HTML.pm (converter_initialize),
+       tp/Texinfo/XS/convert/ConvertXS.xs (html_converter_initialize_sv),
+       tp/Texinfo/XS/convert/convert_html.c (html_free_converter),
+       tp/Texinfo/XS/convert/get_html_perl_info.c
+       (html_converter_initialize_sv), tp/Texinfo/XS/main/converter_types.h
+       (CONVERTER): do not set
+       converter->default_converted_directions_strings anymore from Perl, as
+       the C defaults are now used.  Remove the
+       default_converted_directions_strings argument of
+       html_converter_initialize_sv.  Remove the
+       default_converted_directions_strings CONVERTER field.
+
 2024-07-30  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Convert/HTML.pm (converter_initialize): avoid spurious
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 282da44321..c85d8de289 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -8738,7 +8738,7 @@ my %special_characters = (
   'non_breaking_space' => [$xml_named_entity_nbsp, '00A0'],
 );
 
-sub _XS_html_converter_initialize($$$$$$$$$$$$$$$)
+sub _XS_html_converter_initialize($$$$$$$$$$$$$$)
 {
 }
 
@@ -9107,8 +9107,7 @@ sub converter_initialize($)
                              \%defaults_format_special_unit_body_contents,
                              $customized_upper_case_commands,
                              $customized_special_unit_info,
-                             $customized_direction_strings,
-                             \%default_converted_directions_strings
+                             $customized_direction_strings
                             );
   }
 
diff --git a/tp/Texinfo/XS/convert/ConvertXS.xs 
b/tp/Texinfo/XS/convert/ConvertXS.xs
index 6d36dc5b5a..67787b63c0 100644
--- a/tp/Texinfo/XS/convert/ConvertXS.xs
+++ b/tp/Texinfo/XS/convert/ConvertXS.xs
@@ -579,7 +579,7 @@ 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_special_unit_info, SV 
*customized_direction_s [...]
+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_special_unit_info, SV 
*customized_direction_strings)
       PREINIT:
         CONVERTER *self;
       CODE:
@@ -605,8 +605,7 @@ html_converter_initialize_sv (SV *converter_in, SV 
*default_formatting_reference
                           default_output_units_conversion,
                           default_special_unit_body,
                           customized_upper_case_commands,
-                          customized_direction_strings,
-                          default_converted_directions_strings);
+                          customized_direction_strings);
 
 
 void
diff --git a/tp/Texinfo/XS/convert/convert_html.c 
b/tp/Texinfo/XS/convert/convert_html.c
index 86fd6fbead..4b3e4a76fb 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -19561,17 +19561,6 @@ html_free_converter (CONVERTER *self)
     }
   free (self->htmlxref.list);
 
-  for (i = 0; i < (TDS_TYPE_MAX_NR) - (TDS_TRANSLATED_MAX_NR); i++)
-    {
-      int j;
-
-      for (j = 0; j < nr_string_directions; j++)
-        {
-          free (self->default_converted_directions_strings[i][j]);
-        }
-      free (self->default_converted_directions_strings[i]);
-    }
-
   for (i = 0; i < SUI_type_heading+1; i++)
     {
       int k;
diff --git a/tp/Texinfo/XS/convert/get_html_perl_info.c 
b/tp/Texinfo/XS/convert/get_html_perl_info.c
index 94b01d4d50..c09c67dba5 100644
--- a/tp/Texinfo/XS/convert/get_html_perl_info.c
+++ b/tp/Texinfo/XS/convert/get_html_perl_info.c
@@ -226,8 +226,7 @@ html_converter_initialize_sv (SV *converter_sv,
                               SV *default_output_units_conversion,
                               SV *default_special_unit_body,
                               SV *customized_upper_case_commands,
-                              SV *customized_direction_strings,
-                              SV *default_converted_directions_strings
+                              SV *customized_direction_strings
                              )
 {
   int i;
@@ -318,67 +317,6 @@ html_converter_initialize_sv (SV *converter_sv,
         }
     }
 
-  /* Should always be true */
-  if (default_converted_directions_strings
-      && SvOK (default_converted_directions_strings))
-    {
-      HV *default_converted_directions_strings_hv
-         = (HV *) SvRV (default_converted_directions_strings);
-      nr_string_directions = NON_SPECIAL_DIRECTIONS_NR - FIRSTINFILE_NR
-                            + special_unit_varieties->number;
-      int non_translated_directions_strings_nr
-          = (TDS_TYPE_MAX_NR) - (TDS_TRANSLATED_MAX_NR);
-      for (DS_type = 0; DS_type < non_translated_directions_strings_nr;
-           DS_type++)
-        {
-          const char *type_name
-             = direction_string_type_names[TDS_TRANSLATED_MAX_NR + DS_type];
-          SV **direction_sv
-             = hv_fetch (default_converted_directions_strings_hv,
-                                        type_name, strlen (type_name), 0);
-
-          converter->default_converted_directions_strings[DS_type]
-            = (char **) malloc (nr_string_directions * sizeof (char *));
-          memset (converter->default_converted_directions_strings[DS_type],
-                  0, nr_string_directions * sizeof (char *));
-
-          if (direction_sv)
-            {
-              int i;
-              HV *direction_hv = (HV *) SvRV (*direction_sv);
-
-              for (i = 0; i < nr_string_directions; i++)
-                {
-                  const char *direction_name;
-                  SV **spec_sv;
-
-                  if (i < FIRSTINFILE_MIN_IDX)
-                    direction_name = html_button_direction_names[i];
-                  else
-                    direction_name
-                      = converter->special_unit_info[SUI_type_direction]
-                                       [i - FIRSTINFILE_MIN_IDX];
-
-                  spec_sv = hv_fetch (direction_hv, direction_name,
-                                          strlen (direction_name), 0);
-
-                  if (spec_sv && SvOK (*spec_sv))
-                    {
-                      
converter->default_converted_directions_strings[DS_type][i]
-                        = strdup (SvPVutf8_nolen (*spec_sv));
-                    }
-                    /*
-                       No direction strings for Footnotes
-                  else
-                    {
-                      fprintf (stderr, "NNN no string: %s\n", direction_name);
-                    }
-                     */
-                }
-            }
-        }
-    }
-
 #define FETCH(key) key##_sv = hv_fetch (converter_hv, #key, strlen (#key), 0);
   FETCH(htmlxref)
 
diff --git a/tp/Texinfo/XS/convert/get_html_perl_info.h 
b/tp/Texinfo/XS/convert/get_html_perl_info.h
index 2e577e2343..42c04e5e35 100644
--- a/tp/Texinfo/XS/convert/get_html_perl_info.h
+++ b/tp/Texinfo/XS/convert/get_html_perl_info.h
@@ -23,8 +23,7 @@ void html_converter_initialize_sv (SV *converter_sv,
                                   SV *default_output_units_conversion,
                                   SV *default_special_unit_body,
                                   SV *customized_upper_case_commands,
-                                  SV *customized_direction_strings,
-                                  SV *default_converted_directions_strings
+                                  SV *customized_direction_strings
                                   );
 
 void html_conversion_initialization_sv (SV *converter_sv,
diff --git a/tp/Texinfo/XS/main/converter_types.h 
b/tp/Texinfo/XS/main/converter_types.h
index 74d1157066..10043aa304 100644
--- a/tp/Texinfo/XS/main/converter_types.h
+++ b/tp/Texinfo/XS/main/converter_types.h
@@ -811,7 +811,6 @@ typedef struct CONVERTER {
     HTML_COMMAND_CONVERSION 
html_command_conversion[BUILTIN_CMD_NUMBER][HCC_type_css_string+1];
     char ***customized_directions_strings[(TDS_TYPE_MAX_NR) - 
(TDS_TRANSLATED_MAX_NR)];
     char ***directions_strings[TDS_TYPE_MAX_NR];
-    char **default_converted_directions_strings[TDS_TYPE_MAX_NR];
     const char **direction_unit_direction_name;
 
     /* set for a document */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]