[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Fri, 4 Oct 2024 05:59:37 -0400 (EDT) |
branch: master
commit b3221df3b28429da0183145abb059c03244e0f31
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Aug 10 19:33:21 2024 +0200
* tp/Texinfo/XS/convert/texinfo.c (txi_parser),
tp/Texinfo/XS/teximakehtml.c (values, main): add a VALUE_LIST argument
to txi_parser.
---
ChangeLog | 30 ++++++++++++++++++------------
tp/Texinfo/XS/convert/texinfo.c | 14 ++++++++++++--
tp/Texinfo/XS/convert/texinfo.h | 2 +-
tp/Texinfo/XS/teximakehtml.c | 6 +++++-
4 files changed, 36 insertions(+), 16 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d808bda9b3..d14a325344 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-08-10 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/convert/texinfo.c (txi_parser),
+ tp/Texinfo/XS/teximakehtml.c (values, main): add a VALUE_LIST argument
+ to txi_parser.
+
2024-10-04 Patrice Dumas <pertusus@free.fr>
Add tp/Texinfo/Commands.pm tp/Texinfo/Options.pm generated files
@@ -16,6 +22,18 @@
Update po files
+2024-08-10 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/convert/texinfo.c (txi_converter),
+ tp/Texinfo/XS/teximakehtml.c (main): create converter before
+ txi_converter such that it may be used to get sorted options.
+
+ * tp/Texinfo/XS/main/utils.c (options_list_add_option): rename
+ list_add_option as options_list_add_option.
+
+ * tp/Texinfo/XS/teximakehtml.c (main, add_button_option): demonstrate
+ passing button and other options to txi_converter.
+
2024-10-04 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/convert/create_buttons.c
@@ -39,18 +57,6 @@
tp/Texinfo/XS/convert/html_converter_init_options.h: move enum
BUTTON_special_unit_directions to create_buttons.h.
-2024-08-10 Patrice Dumas <pertusus@free.fr>
-
- * tp/Texinfo/XS/convert/texinfo.c (txi_converter),
- tp/Texinfo/XS/teximakehtml.c (main): create converter before
- txi_converter such that it may be used to get sorted options.
-
- * tp/Texinfo/XS/main/utils.c (options_list_add_option): rename
- list_add_option as options_list_add_option.
-
- * tp/Texinfo/XS/teximakehtml.c (main, add_button_option): demonstrate
- passing button and other options to txi_converter.
-
2024-08-10 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/convert/create_buttons.c (new_button_specification)
diff --git a/tp/Texinfo/XS/convert/texinfo.c b/tp/Texinfo/XS/convert/texinfo.c
index bbdc2b4713..90bac92f1d 100644
--- a/tp/Texinfo/XS/convert/texinfo.c
+++ b/tp/Texinfo/XS/convert/texinfo.c
@@ -46,11 +46,11 @@ txi_setup (const char *localesdir, int texinfo_uninstalled,
}
/* TODO should pass other options, in particular prepended and appended
- directories, values, expanded formats list, and maybe OPTIONS_LIST
+ directories, and maybe OPTIONS_LIST
for other options known by the parser */
void
txi_parser (const char *file_path, const char *locale_encoding,
- const char **expanded_formats)
+ const char **expanded_formats, const VALUE_LIST *values)
{
char *input_file_name_and_directory[2];
char *input_directory;
@@ -74,6 +74,16 @@ txi_parser (const char *file_path, const char
*locale_encoding,
free (input_directory);
}
+ if (values)
+ {
+ parser_conf_reset_values ();
+ for (i = 0; i < values->number; i++)
+ {
+ parser_conf_add_value (values->list[i].name,
+ values->list[i].value);
+ }
+ }
+
parser_conf_set_LOCALE_ENCODING (locale_encoding);
for (i = 0; expanded_formats[i]; i++)
parser_conf_add_expanded_format (expanded_formats[i]);
diff --git a/tp/Texinfo/XS/convert/texinfo.h b/tp/Texinfo/XS/convert/texinfo.h
index 17cc21abc4..1dc681d5cb 100644
--- a/tp/Texinfo/XS/convert/texinfo.h
+++ b/tp/Texinfo/XS/convert/texinfo.h
@@ -32,7 +32,7 @@ void txi_setup (const char *localesdir, int
texinfo_uninstalled,
void
txi_parser (const char *file_path, const char *locale_encoding,
- const char **expanded_formats);
+ const char **expanded_formats, const VALUE_LIST *values);
void txi_complete_document (DOCUMENT *document, unsigned long flags,
int format_menu);
diff --git a/tp/Texinfo/XS/teximakehtml.c b/tp/Texinfo/XS/teximakehtml.c
index 291b1e5337..1752191f9d 100644
--- a/tp/Texinfo/XS/teximakehtml.c
+++ b/tp/Texinfo/XS/teximakehtml.c
@@ -96,6 +96,10 @@ add_button_option (OPTIONS_LIST *options_list, OPTION
**sorted_options,
}
static const char *expanded_formats[] = {"html", 0};
+static VALUE values_array[] = {
+ {"txicommandconditionals", "1"}
+};
+static const VALUE_LIST values = {1, 1, values_array};
int
main (int argc, char *argv[])
@@ -149,7 +153,7 @@ main (int argc, char *argv[])
input_file_path = argv[1];
/* initialize parser */
- txi_parser (input_file_path, locale_encoding, expanded_formats);
+ txi_parser (input_file_path, locale_encoding, expanded_formats, &values);
/* Texinfo document tree parsing */
document_descriptor = parse_file (input_file_path, &status);