texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/XS/convert/texinfo.c (txi_converter_


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/convert/texinfo.c (txi_converter_setup): use add_option_string_value with txi_base_sorted_options instead of add_new_option_value to get the option type based on the name.
Date: Fri, 04 Oct 2024 19:46:04 -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 e631dfec84 * tp/Texinfo/XS/convert/texinfo.c (txi_converter_setup): 
use add_option_string_value with txi_base_sorted_options instead of 
add_new_option_value to get the option type based on the name.
e631dfec84 is described below

commit e631dfec849e378083d98716ad7d6e8d306a3839
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Aug 17 15:08:45 2024 +0200

    * tp/Texinfo/XS/convert/texinfo.c (txi_converter_setup): use
    add_option_string_value with txi_base_sorted_options instead of
    add_new_option_value to get the option type based on the name.
---
 ChangeLog                       |  6 ++++++
 tp/Texinfo/XS/convert/texinfo.c | 37 +++++++++++++++++++++----------------
 2 files changed, 27 insertions(+), 16 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 24c8c15357..6bc446d77c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-08-17  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/convert/texinfo.c (txi_converter_setup): use
+       add_option_string_value with txi_base_sorted_options instead of 
+       add_new_option_value to get the option type based on the name.
+
 2024-08-17  Patrice Dumas  <pertusus@free.fr>
 
        * tp/maintain/regenerate_C_options_info.pl: setup
diff --git a/tp/Texinfo/XS/convert/texinfo.c b/tp/Texinfo/XS/convert/texinfo.c
index 7623e1a940..d09f745f19 100644
--- a/tp/Texinfo/XS/convert/texinfo.c
+++ b/tp/Texinfo/XS/convert/texinfo.c
@@ -14,7 +14,8 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
 /* Interface similar to the Perl modules interface for Texinfo parsing,
-   Document structure and transformations and conversion */
+   and higher-level interface for document structure and transformations
+   and conversion */
 
 /* not used in code called from texi2any/Perl, meant to be used exclusively
    from C code */
@@ -27,6 +28,8 @@
 #include <stdio.h>
 
 #include "document_types.h"
+/* txi_base_sorted_options */
+#include "options_types.h"
 #include "api.h"
 #include "conf.h"
 #include "errors.h"
@@ -54,7 +57,9 @@ txi_setup (const char *localesdir, int texinfo_uninstalled,
   html_format_setup ();
 }
 
-/* parser initialization, similar to Texinfo::Parser::parser in Perl */
+/* parser initialization, similar to Texinfo::Parser::parser in Perl.
+   Also sets INCLUDE_DIRECTORIES minimally if not specified in options.
+   The implementation is similar to parsetexi/Parsetexi.pm on purpose. */
 void
 txi_parser (const char *file_path, const char *locale_encoding,
             const char **expanded_formats, const VALUE_LIST *values,
@@ -300,28 +305,28 @@ txi_converter_setup (const char *format_str,
   initialize_options_list (&conf->conf, 10);
 
   /* similar to options coming from texi2any */
-  add_new_option_value (&conf->conf, GOT_char, "PROGRAM", 0,
-                        program_file);
+  add_option_string_value (&conf->conf, txi_base_sorted_options,
+                           "PROGRAM", 0, program_file);
    /*
     */
   /* comment the line above and uncomment below to compare with
      texi2any output
                         "texi2any");
-  add_new_option_value (&conf->conf, GOT_char,
-                    "PACKAGE_AND_VERSION", 0, "Texinfo 7.1.90+dev");
+  add_option_string_value (&conf->conf, txi_base_sorted_options,
+                      "PACKAGE_AND_VERSION", 0, "Texinfo 7.1.90+dev");
    */
-  add_new_option_value (&conf->conf, GOT_char,
-                    "COMMAND_LINE_ENCODING", 0, locale_encoding);
-  add_new_option_value (&conf->conf, GOT_char,
-                    "MESSAGE_ENCODING", 0, locale_encoding);
-  add_new_option_value (&conf->conf, GOT_char,
-                    "LOCALE_ENCODING", 0, locale_encoding);
+  add_option_string_value (&conf->conf, txi_base_sorted_options,
+                        "COMMAND_LINE_ENCODING", 0, locale_encoding);
+  add_option_string_value (&conf->conf, txi_base_sorted_options,
+                        "MESSAGE_ENCODING", 0, locale_encoding);
+  add_option_string_value (&conf->conf, txi_base_sorted_options,
+                        "LOCALE_ENCODING", 0, locale_encoding);
   /* filled here because it is the best we have in C */
-  add_new_option_value (&conf->conf, GOT_char,
-                    "XS_STRXFRM_COLLATION_LOCALE", 0, "en_US");
+  add_option_string_value (&conf->conf, txi_base_sorted_options,
+                        "XS_STRXFRM_COLLATION_LOCALE", 0, "en_US");
   /*
-  add_new_option_value (&conf->conf, GOT_integer,
-                    "DEBUG", 1, 0);
+  add_option_string_value (&conf->conf, txi_base_sorted_options,
+                           "DEBUG", 1, 0);
    */
 
   if (customizations)



reply via email to

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