texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/XS/main/get_perl_info.c (converter_i


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/main/get_perl_info.c (converter_initialize) (html_converter_initialize_sv): split generic converter initialization out of html_converter_initialize_sv to converter_initialize.
Date: Sun, 05 Nov 2023 17:34:30 -0500

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 fdbb0ffb2a * tp/Texinfo/XS/main/get_perl_info.c (converter_initialize) 
(html_converter_initialize_sv): split generic converter initialization out of 
html_converter_initialize_sv to converter_initialize.
fdbb0ffb2a is described below

commit fdbb0ffb2a9013f4d95277129c51912d93440f59
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Nov 5 23:34:19 2023 +0100

    * tp/Texinfo/XS/main/get_perl_info.c (converter_initialize)
    (html_converter_initialize_sv): split generic converter initialization
    out of html_converter_initialize_sv to converter_initialize.
---
 ChangeLog                          |  6 ++++
 tp/Texinfo/XS/main/get_perl_info.c | 66 +++++++++++++++++++++++---------------
 2 files changed, 46 insertions(+), 26 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9a920261f1..3fa97232a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-11-05  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/main/get_perl_info.c (converter_initialize)
+       (html_converter_initialize_sv): split generic converter initialization 
+       out of html_converter_initialize_sv to converter_initialize.
+
 2023-11-05  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Convert/Converter.pm, tp/Texinfo/Convert/HTML.pm
diff --git a/tp/Texinfo/XS/main/get_perl_info.c 
b/tp/Texinfo/XS/main/get_perl_info.c
index 5414aff17d..d398b0a8bb 100644
--- a/tp/Texinfo/XS/main/get_perl_info.c
+++ b/tp/Texinfo/XS/main/get_perl_info.c
@@ -474,6 +474,42 @@ register_formatting_reference_with_default (char 
*type_string,
     */
 }
 
+CONVERTER *
+converter_initialize (SV *converter_sv)
+{
+  HV *hv_in;
+  SV **converter_init_conf_sv;
+  CONVERTER *converter = new_converter ();
+  DOCUMENT *document;
+
+  dTHX;
+
+  hv_in = (HV *)SvRV (converter_sv);
+
+  document = get_sv_document_document (converter_sv, 0);
+  converter->document = document;
+
+  converter_init_conf_sv
+    = hv_fetch (hv_in, "converter_init_conf",
+                strlen ("converter_init_conf"), 0);
+
+  if (converter_init_conf_sv && SvOK (*converter_init_conf_sv))
+    {
+      converter->init_conf
+         = copy_sv_options (*converter_init_conf_sv);
+    }
+
+  converter->error_messages
+    = (ERROR_MESSAGE_LIST *) malloc (sizeof (ERROR_MESSAGE_LIST));
+  memset (converter->error_messages, 0, sizeof (ERROR_MESSAGE_LIST));
+
+  set_translated_commands (converter, hv_in);
+
+  get_expanded_formats (hv_in, &converter->expanded_formats);
+
+  return converter;
+}
+
 int
 html_converter_initialize_sv (SV *converter_sv,
                               SV *default_formatting_references,
@@ -497,7 +533,6 @@ html_converter_initialize_sv (SV *converter_sv,
   HV *default_types_conversion_hv;
   HV *default_css_string_types_conversion_hv;
   HV *default_output_units_conversion_hv;
-  SV **converter_init_conf_sv;
   SV **formatting_function_sv;
   SV **sorted_special_unit_varieties_sv;
   SV **no_arg_commands_formatting_sv;
@@ -515,42 +550,21 @@ html_converter_initialize_sv (SV *converter_sv,
   HV *types_open_hv;
   HV *types_conversion_hv;
   HV *output_units_conversion_hv;
-  CONVERTER *converter = new_converter ();
   int converter_descriptor = 0;
-  DOCUMENT *document;
+  CONVERTER *converter;
 
   dTHX;
 
+  converter = converter_initialize (converter_sv);
+
   hv_in = (HV *)SvRV (converter_sv);
+
   default_formatting_references_hv
     = (HV *)SvRV (default_formatting_references);
   default_css_string_formatting_references_hv
     = (HV *)SvRV (default_css_string_formatting_references);
 
-  /* generic */
-
-  document = get_sv_document_document (converter_sv, 0);
-  converter->document = document;
-
 #define FETCH(key) key##_sv = hv_fetch (hv_in, #key, strlen(#key), 0);
-  FETCH(converter_init_conf);
-
-  if (converter_init_conf_sv && SvOK (*converter_init_conf_sv))
-    {
-      converter->init_conf
-         = copy_sv_options (*converter_init_conf_sv);
-    }
-
-  converter->error_messages
-    = (ERROR_MESSAGE_LIST *) malloc (sizeof (ERROR_MESSAGE_LIST));
-  memset (converter->error_messages, 0, sizeof (ERROR_MESSAGE_LIST));
-
-  set_translated_commands (converter, hv_in);
-
-  get_expanded_formats (hv_in, &converter->expanded_formats);
-
-  /* HTML specific */
-
   FETCH(formatting_function);
 
   /* no need to check if it exists */



reply via email to

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