[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: No converter information in converter_defaults, a
From: |
Patrice Dumas |
Subject: |
branch master updated: No converter information in converter_defaults, and XS override |
Date: |
Fri, 04 Oct 2024 19:31:01 -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 d127c503d8 No converter information in converter_defaults, and XS
override
d127c503d8 is described below
commit d127c503d8ae73bc6c743d06ab7c4fbf0321a1b8
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Aug 17 00:09:22 2024 +0200
No converter information in converter_defaults, and XS override
* tp/Texinfo/XS/main/customization_options.c (copy_option): copy
direction_string field.
* tp/Texinfo/XS/main/customization_options.c (add_new_button_option):
add based on tp/Texinfo/XS/teximakehtml.c code.
* tp/Texinfo/XS/convert/get_converter_perl_info.c
(new_numbered_option_from_sv): rename new_option_from_sv as
new_numbered_option_from_sv.
* tp/Texinfo/XS/convert/converter.c
(find_format_name_converter_format): rename find_format_data_index as
find_format_name_converter_format. Update callers.
* tp/Texinfo/XS/convert/converter.c (set_generic_converter_options):
new separate function for clearer code.
* tp/Texinfo/XS/main/utils.c (direction_unit_direction_name),
tp/Texinfo/XS/main/build_perl_info.c (html_build_button): add the
direction_unit_direction_name function that directly uses
html_button_direction_names for directions that are not special units
directions, such as to have a direction name for those directions even
if there is no converter. Use in html_build_button.
* tp/Texinfo/XS/main/build_perl_info.c
(html_build_buttons_specification): update external_references_number
only if there is a converter. With the change in html_build_button,
the function can be used with a NULL converter.
* tp/maintain/regenerate_C_options_info.pl,
tp/Texinfo/XS/convert/html_converter_init_options.c
(add_html_default_buttons_specifications)
(add_texi2html_default_buttons_specifications): generate
add_*_regular_options_defaults that add option categories or converter
options to an option list. Add
add_html_default_buttons_specifications and
add_texi2html_default_buttons_specifications to similarily add buttons
to an option list.
* tp/Texinfo/XS/convert/html_converter_init_options.c
(html_converter_defaults), tp/Texinfo/XS/convert/converter.c
(converter_defaults, converter_converter),
tp/Texinfo/XS/convert/converter.h (CONVERTER_FORMAT_DATA): pass
converter_format instead of converter to converter_defaults. Have
html_converter_defaults return the format_defaults options in the
CONVERTER_INITIALIZATION_INFO return value. Do not consider that
options are numbered in converter_defaults. Call number_options_list
on format_defaults returned by converter_defaults, as without
converter in format_defaults, it is unlikely for options to be
numbered.
* tp/Texinfo/XS/convert/converter.c
(find_perl_converter_class_converter_format),
tp/Texinfo/XS/convert/get_converter_perl_info.c
(get_or_create_sv_converter): add
find_perl_converter_class_converter_format based on
get_or_create_sv_converter code to get converter_format based on Perl
class.
* tp/Texinfo/Convert/HTML.pm (%XS_conversion_overrides),
tp/Texinfo/XS/convert/ConvertXS.xs (converter_defaults),
tp/Texinfo/XS/main/build_perl_info.c
(build_sv_options_from_options_list): rename html_converter_defaults
in ConvertXS.xs as converter_defaults. Add override of
converter_defaults for HTML. Never use a converter to generate the
returned Perl information. For that, determine the class name based on
SvSTASH or the converter_in SV considered as a string, then the
converter_format using find_perl_converter_class_converter_format.
Also setup asorted options without a converter, to be able to call
get_converter_info_from_sv. Call converter_defaults to return a
CONVERTER_INITIALIZATION_INFO. Add build_sv_options_from_options_list
to build Perl options hash based on a OPTIONS_LIST. Call
build_sv_options_from_options_list in ConvertXS.xs converter_defaults
override in to return converter default Perl hash.
* tp/Texinfo/XS/convert/html_converter_init_options.c
(set_html_default_buttons_specifications)
(set_texi2html_default_buttons_specifications): pass converter and
options separately.
---
ChangeLog | 84 +++++
tp/Texinfo/Convert/Converter.pm | 4 +-
tp/Texinfo/Convert/HTML.pm | 5 +-
tp/Texinfo/XS/convert/ConvertXS.xs | 59 ++--
tp/Texinfo/XS/convert/converter.c | 52 ++-
tp/Texinfo/XS/convert/converter.h | 9 +-
tp/Texinfo/XS/convert/converters_defaults.c | 354 +++++++++++++++++++++
tp/Texinfo/XS/convert/converters_defaults.h | 24 ++
tp/Texinfo/XS/convert/get_converter_perl_info.c | 26 +-
tp/Texinfo/XS/convert/html_converter_api.h | 3 +-
.../XS/convert/html_converter_init_options.c | 82 ++++-
tp/Texinfo/XS/convert/texinfo.c | 2 +-
tp/Texinfo/XS/main/build_perl_info.c | 59 +++-
tp/Texinfo/XS/main/build_perl_info.h | 3 +
tp/Texinfo/XS/main/customization_options.c | 25 +-
tp/Texinfo/XS/main/customization_options.h | 3 +
tp/Texinfo/XS/main/utils.c | 29 +-
tp/Texinfo/XS/main/utils.h | 2 +
tp/Texinfo/XS/teximakehtml.c | 13 -
tp/maintain/regenerate_C_options_info.pl | 38 ++-
20 files changed, 764 insertions(+), 112 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c26581fd58..a50b7cfffb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,87 @@
+2024-08-16 Patrice Dumas <pertusus@free.fr>
+
+ No converter information in converter_defaults, and XS override
+
+ * tp/Texinfo/XS/main/customization_options.c (copy_option): copy
+ direction_string field.
+
+ * tp/Texinfo/XS/main/customization_options.c (add_new_button_option):
+ add based on tp/Texinfo/XS/teximakehtml.c code.
+
+ * tp/Texinfo/XS/convert/get_converter_perl_info.c
+ (new_numbered_option_from_sv): rename new_option_from_sv as
+ new_numbered_option_from_sv.
+
+ * tp/Texinfo/XS/convert/converter.c
+ (find_format_name_converter_format): rename find_format_data_index as
+ find_format_name_converter_format. Update callers.
+
+ * tp/Texinfo/XS/convert/converter.c (set_generic_converter_options):
+ new separate function for clearer code.
+
+ * tp/Texinfo/XS/main/utils.c (direction_unit_direction_name),
+ tp/Texinfo/XS/main/build_perl_info.c (html_build_button): add the
+ direction_unit_direction_name function that directly uses
+ html_button_direction_names for directions that are not special units
+ directions, such as to have a direction name for those directions even
+ if there is no converter. Use in html_build_button.
+
+ * tp/Texinfo/XS/main/build_perl_info.c
+ (html_build_buttons_specification): update external_references_number
+ only if there is a converter. With the change in html_build_button,
+ the function can be used with a NULL converter.
+
+ * tp/maintain/regenerate_C_options_info.pl,
+ tp/Texinfo/XS/convert/html_converter_init_options.c
+ (add_html_default_buttons_specifications)
+ (add_texi2html_default_buttons_specifications): generate
+ add_*_regular_options_defaults that add option categories or converter
+ options to an option list. Add
+ add_html_default_buttons_specifications and
+ add_texi2html_default_buttons_specifications to similarily add buttons
+ to an option list.
+
+ * tp/Texinfo/XS/convert/html_converter_init_options.c
+ (html_converter_defaults), tp/Texinfo/XS/convert/converter.c
+ (converter_defaults, converter_converter),
+ tp/Texinfo/XS/convert/converter.h (CONVERTER_FORMAT_DATA): pass
+ converter_format instead of converter to converter_defaults. Have
+ html_converter_defaults return the format_defaults options in the
+ CONVERTER_INITIALIZATION_INFO return value. Do not consider that
+ options are numbered in converter_defaults. Call number_options_list
+ on format_defaults returned by converter_defaults, as without
+ converter in format_defaults, it is unlikely for options to be
+ numbered.
+
+ * tp/Texinfo/XS/convert/converter.c
+ (find_perl_converter_class_converter_format),
+ tp/Texinfo/XS/convert/get_converter_perl_info.c
+ (get_or_create_sv_converter): add
+ find_perl_converter_class_converter_format based on
+ get_or_create_sv_converter code to get converter_format based on Perl
+ class.
+
+ * tp/Texinfo/Convert/HTML.pm (%XS_conversion_overrides),
+ tp/Texinfo/XS/convert/ConvertXS.xs (converter_defaults),
+ tp/Texinfo/XS/main/build_perl_info.c
+ (build_sv_options_from_options_list): rename html_converter_defaults
+ in ConvertXS.xs as converter_defaults. Add override of
+ converter_defaults for HTML. Never use a converter to generate the
+ returned Perl information. For that, determine the class name based on
+ SvSTASH or the converter_in SV considered as a string, then the
+ converter_format using find_perl_converter_class_converter_format.
+ Also setup asorted options without a converter, to be able to call
+ get_converter_info_from_sv. Call converter_defaults to return a
+ CONVERTER_INITIALIZATION_INFO. Add build_sv_options_from_options_list
+ to build Perl options hash based on a OPTIONS_LIST. Call
+ build_sv_options_from_options_list in ConvertXS.xs converter_defaults
+ override in to return converter default Perl hash.
+
+ * tp/Texinfo/XS/convert/html_converter_init_options.c
+ (set_html_default_buttons_specifications)
+ (set_texi2html_default_buttons_specifications): pass converter and
+ options separately.
+
2024-08-16 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/convert/convert_html.h,
diff --git a/tp/Texinfo/Convert/Converter.pm b/tp/Texinfo/Convert/Converter.pm
index e3bfba5725..87ebf2df57 100644
--- a/tp/Texinfo/Convert/Converter.pm
+++ b/tp/Texinfo/Convert/Converter.pm
@@ -2212,12 +2212,12 @@ can define two methods:
=over
-=item \%defaults = $converter->converter_defaults($options)
+=item \%defaults = $converter_or_class->converter_defaults($options)
X<C<converter_defaults>>
The module can provide the reference on a hash with defaults for converter
customization options. The I<$options> hash reference holds options for the
-converter.
+converter. The function can be called both through a class or a converter.
=item converter_initialize
X<C<converter_initialize>>
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 0920485906..efe8d6eabb 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -103,9 +103,8 @@ my %XS_overrides = (
);
my %XS_conversion_overrides = (
-# not ready to be called as Texinfo::Convert::HTML->converter_defaults
-# "Texinfo::Convert::HTML::converter_defaults"
-# => "Texinfo::Convert::ConvertXS::html_converter_defaults",
+ "Texinfo::Convert::HTML::converter_defaults"
+ => "Texinfo::Convert::ConvertXS::converter_defaults",
"Texinfo::Convert::HTML::output"
=> "Texinfo::Convert::ConvertXS::html_output",
"Texinfo::Convert::HTML::convert"
diff --git a/tp/Texinfo/XS/convert/ConvertXS.xs
b/tp/Texinfo/XS/convert/ConvertXS.xs
index e36c412688..ae4210dd11 100644
--- a/tp/Texinfo/XS/convert/ConvertXS.xs
+++ b/tp/Texinfo/XS/convert/ConvertXS.xs
@@ -46,6 +46,7 @@
/* for command_location_names non_perl_free new_string_list ... */
#include "utils.h"
#include "command_stack.h"
+#include "customization_options.h"
/* for call_common_set_output_perl_encoding */
#include "call_perl_function.h"
#include "document.h"
@@ -97,45 +98,53 @@ init (int texinfo_uninstalled, SV *pkgdatadir_sv, SV
*tp_builddir_sv, SV *top_sr
RETVAL
SV *
-html_converter_defaults (SV *converter_in, SV *conf_sv)
+converter_defaults (SV *converter_in, SV *conf_sv)
PREINIT:
- HV *format_defaults_hv;
- HV *converter_hv;
- CONVERTER *self;
CONVERTER_INITIALIZATION_INFO *conf;
+ CONVERTER_INITIALIZATION_INFO *format_defaults;
+ /* we need sorted options to be able to find the type of options
+ in functions called from get_converter_info_from_sv*/
+ OPTIONS *options;
+ OPTION **sorted_options;
+ const char *class_name;
+ enum converter_format converter_format;
/* int has_conf; */
CODE:
- /* FIXME if SvROK (converter_in) == 0, the Perl method should have
- been called like Texinfo::Convert::HTML->converter_defaults
- (from texi2any). In that case, the options should be returned
- even though there is no converter */
+ options = new_options ();
+ sorted_options = setup_sorted_options (options);
+
+ if (SvOK (converter_in))
+ {
+ if (SvROK (converter_in))
+ {
+ HV *stash = SvSTASH (SvRV (converter_in));
+ class_name = HvNAME (stash);
+ }
+ else
+ class_name = SvPV_nolen (converter_in);
+ }
- self = get_or_create_sv_converter (converter_in, 0);
+ converter_format
+ = find_perl_converter_class_converter_format (class_name);
conf = new_converter_initialization_info ();
- /* FIXME check where/if converted_format is set */
- /* conf->converted_format = strdup ("html"); */
/*
has_conf =
*/
- get_converter_info_from_sv (conf_sv, 0, self,
- self->sorted_options, conf);
- html_converter_defaults (self, conf);
+ get_converter_info_from_sv (conf_sv, 0, 0,
+ sorted_options, conf);
+
+ free (sorted_options);
+ free_options (options);
+ free (options);
+
+ format_defaults = converter_defaults (converter_format, conf);
destroy_converter_initialization_info (conf);
- converter_hv = (HV *)SvRV (converter_in);
- hv_store (converter_hv, "converter_descriptor",
- strlen ("converter_descriptor"),
- newSViv ((IV)self->converter_descriptor), 0);
-
- /* return empty options, such that when run through
- generic_converter_init -> set_converter_init_information nothing
- more is set, as the defaults have already been set by
- html_converter_defaults */
- format_defaults_hv = newHV ();
- RETVAL = newRV_noinc ((SV *) format_defaults_hv);
+ RETVAL = build_sv_options_from_options_list (&format_defaults->conf,
0);
+ destroy_converter_initialization_info (format_defaults);
OUTPUT:
RETVAL
diff --git a/tp/Texinfo/XS/convert/converter.c
b/tp/Texinfo/XS/convert/converter.c
index 2c81259505..492a0a4165 100644
--- a/tp/Texinfo/XS/convert/converter.c
+++ b/tp/Texinfo/XS/convert/converter.c
@@ -174,7 +174,7 @@ converter_setup (int texinfo_uninstalled, const char
*tp_builddir,
enum converter_format
-find_format_data_index (const char *format)
+find_format_name_converter_format (const char *format)
{
int i;
@@ -185,6 +185,18 @@ find_format_data_index (const char *format)
return COF_none;
}
+enum converter_format
+find_perl_converter_class_converter_format (const char *class_name)
+{
+ int i;
+
+ for (i = 0; i < TXI_CONVERSION_FORMAT_NR; i++)
+ if (!strcmp (converter_format_data[i].perl_converter_class, class_name))
+ return i;
+
+ return COF_none;
+}
+
CONVERTER *
retrieve_converter (size_t converter_descriptor)
{
@@ -194,6 +206,16 @@ retrieve_converter (size_t converter_descriptor)
return 0;
}
+static void
+set_generic_converter_options (OPTIONS *options)
+{
+ set_converter_cmdline_regular_defaults (options);
+ set_converter_customization_regular_defaults (options);
+ set_unique_at_command_regular_defaults (options);
+ set_multiple_at_command_regular_defaults (options);
+ set_common_regular_options_defaults (options);
+}
+
/* initialize the converter */
static void
init_generic_converter (CONVERTER *self)
@@ -201,11 +223,7 @@ init_generic_converter (CONVERTER *self)
self->conf = new_options ();
self->sorted_options = setup_sorted_options (self->conf);
- set_converter_cmdline_regular_defaults (self->conf);
- set_converter_customization_regular_defaults (self->conf);
- set_unique_at_command_regular_defaults (self->conf);
- set_multiple_at_command_regular_defaults (self->conf);
- set_common_regular_options_defaults (self->conf);
+ set_generic_converter_options (self->conf);
self->init_conf = new_options ();
@@ -408,18 +426,18 @@ copy_converter_initialization_info
(CONVERTER_INITIALIZATION_INFO *dst_info,
for pure C.
*/
/* corresponds to Perl $converter->converter_defaults() Converter */
-static CONVERTER_INITIALIZATION_INFO *
-converter_defaults (CONVERTER *converter,
+CONVERTER_INITIALIZATION_INFO *
+converter_defaults (enum converter_format converter_format,
CONVERTER_INITIALIZATION_INFO *user_conf)
{
- if (converter->format != COF_none
- && converter_format_data[converter->format].converter_defaults)
+ if (converter_format != COF_none
+ && converter_format_data[converter_format].converter_defaults)
{
CONVERTER_INITIALIZATION_INFO *
- (* format_converter_defaults) (CONVERTER *self,
- CONVERTER_INITIALIZATION_INFO *conf)
- = converter_format_data[converter->format].converter_defaults;
- return format_converter_defaults (converter, user_conf);
+ (* format_converter_defaults) (enum converter_format format,
+ CONVERTER_INITIALIZATION_INFO *conf)
+ = converter_format_data[converter_format].converter_defaults;
+ return format_converter_defaults (converter_format, user_conf);
}
return 0;
}
@@ -448,10 +466,14 @@ converter_converter (enum converter_format format,
CONVERTER_INITIALIZATION_INFO *user_conf
= new_converter_initialization_info ();
+
copy_converter_initialization_info (user_conf, input_user_conf);
number_options_list (&user_conf->conf, converter->sorted_options);
- format_defaults = converter_defaults (converter, user_conf);
+ format_defaults = converter_defaults (converter->format, user_conf);
+
+ if (format_defaults)
+ number_options_list (&format_defaults->conf, converter->sorted_options);
set_converter_init_information (converter, format, format_defaults,
user_conf);
diff --git a/tp/Texinfo/XS/convert/converter.h
b/tp/Texinfo/XS/convert/converter.h
index 2ce209178e..537a05efd0 100644
--- a/tp/Texinfo/XS/convert/converter.h
+++ b/tp/Texinfo/XS/convert/converter.h
@@ -94,7 +94,7 @@ typedef struct CONVERTER_FORMAT_DATA {
const char *default_format;
const char *perl_converter_class;
CONVERTER_INITIALIZATION_INFO *
- (* converter_defaults) (CONVERTER *self,
+ (* converter_defaults) (enum converter_format format,
CONVERTER_INITIALIZATION_INFO *conf);
void (* converter_initialize) (CONVERTER *self);
void (* converter_reset) (CONVERTER *self);
@@ -123,7 +123,9 @@ extern CONVERTER_FORMAT_DATA converter_format_data[];
void converter_setup (int texinfo_uninstalled, const char *tp_builddir,
const char *pkgdatadir, const char *top_srcdir);
-enum converter_format find_format_data_index (const char *format);
+enum converter_format find_format_name_converter_format (const char *format);
+enum converter_format find_perl_converter_class_converter_format (
+ const char *class_name);
CONVERTER *retrieve_converter (size_t converter_descriptor);
size_t new_converter (enum converter_format format, unsigned long flags);
@@ -133,6 +135,9 @@ void set_converter_init_information (CONVERTER *converter,
CONVERTER_INITIALIZATION_INFO *format_defaults,
CONVERTER_INITIALIZATION_INFO *user_conf);
+CONVERTER_INITIALIZATION_INFO *converter_defaults (
+ enum converter_format converter_format,
+ CONVERTER_INITIALIZATION_INFO *user_conf);
CONVERTER *converter_converter (enum converter_format format,
const CONVERTER_INITIALIZATION_INFO *user_conf);
diff --git a/tp/Texinfo/XS/convert/converters_defaults.c
b/tp/Texinfo/XS/convert/converters_defaults.c
index 8df7df7f40..340eb025ff 100644
--- a/tp/Texinfo/XS/convert/converters_defaults.c
+++ b/tp/Texinfo/XS/convert/converters_defaults.c
@@ -18,6 +18,14 @@ void set_array_cmdline_regular_defaults (OPTIONS *options)
option_set_conf (&options->TEXINFO_LANGUAGE_DIRECTORIES, -2, 0);
}
+void add_array_cmdline_regular_options_defaults (OPTIONS_LIST *options_list)
+{
+ add_new_option_value (options_list, GOT_bytes_string_list, "CSS_FILES", -2,
0);
+ add_new_option_value (options_list, GOT_char_string_list, "CSS_REFS", -2, 0);
+ add_new_option_value (options_list, GOT_bytes_string_list,
"EXPANDED_FORMATS", -2, 0);
+ add_new_option_value (options_list, GOT_file_string_list,
"INCLUDE_DIRECTORIES", -2, 0);
+}
+
/* converter_cmdline */
@@ -37,6 +45,22 @@ void set_converter_cmdline_regular_defaults (OPTIONS
*options)
option_set_conf (&options->ENABLE_ENCODING, 1, 0);
}
+void add_converter_cmdline_regular_options_defaults (OPTIONS_LIST
*options_list)
+{
+ add_new_option_value (options_list, GOT_integer, "SPLIT_SIZE", 300000, 0);
+ add_new_option_value (options_list, GOT_integer, "FILLCOLUMN", 72, 0);
+ add_new_option_value (options_list, GOT_integer, "NUMBER_SECTIONS", 1, 0);
+ add_new_option_value (options_list, GOT_integer, "NUMBER_FOOTNOTES", 1, 0);
+ add_new_option_value (options_list, GOT_integer, "TRANSLITERATE_FILE_NAMES",
1, 0);
+ add_new_option_value (options_list, GOT_char, "SPLIT", -2, 0);
+ add_new_option_value (options_list, GOT_integer, "HEADERS", 1, 0);
+ add_new_option_value (options_list, GOT_integer, "NODE_FILES", -1, 0);
+ add_new_option_value (options_list, GOT_integer, "VERBOSE", -1, 0);
+ add_new_option_value (options_list, GOT_char, "OUTFILE", -2, 0);
+ add_new_option_value (options_list, GOT_char, "SUBDIR", -2, 0);
+ add_new_option_value (options_list, GOT_integer, "ENABLE_ENCODING", 1, 0);
+}
+
/* converter_customization */
@@ -184,6 +208,148 @@ void set_converter_customization_regular_defaults
(OPTIONS *options)
option_set_conf (&options->_INLINE_STYLE_WIDTH, -1, 0);
}
+void add_converter_customization_regular_options_defaults (OPTIONS_LIST
*options_list)
+{
+ add_new_option_value (options_list, GOT_char, "TOP_NODE_UP", -2, "(dir)");
+ add_new_option_value (options_list, GOT_integer, "BASEFILENAME_LENGTH",
255-10, 0);
+ add_new_option_value (options_list, GOT_integer,
"DOC_ENCODING_FOR_INPUT_FILE_NAME", 1, 0);
+ add_new_option_value (options_list, GOT_integer,
"DOC_ENCODING_FOR_OUTPUT_FILE_NAME", 0, 0);
+ add_new_option_value (options_list, GOT_char, "IMAGE_LINK_PREFIX", -2, 0);
+ add_new_option_value (options_list, GOT_integer,
"CASE_INSENSITIVE_FILENAMES", 0, 0);
+ add_new_option_value (options_list, GOT_integer, "DEBUG", 0, 0);
+ add_new_option_value (options_list, GOT_integer,
"HANDLER_FATAL_ERROR_LEVEL", 100, 0);
+ add_new_option_value (options_list, GOT_integer, "TEST", 0, 0);
+ add_new_option_value (options_list, GOT_integer, "TEXTCONTENT_COMMENT", -1,
0);
+ add_new_option_value (options_list, GOT_char, "TEXINFO_DTD_VERSION", -2,
"7.1");
+ add_new_option_value (options_list, GOT_integer, "USE_UNICODE_COLLATION", 1,
0);
+ add_new_option_value (options_list, GOT_char, "AFTER_BODY_OPEN", -2, 0);
+ add_new_option_value (options_list, GOT_char, "AFTER_SHORT_TOC_LINES", -2,
0);
+ add_new_option_value (options_list, GOT_char, "AFTER_TOC_LINES", -2, 0);
+ add_new_option_value (options_list, GOT_integer, "ASCII_DASHES_AND_QUOTES",
-1, 0);
+ add_new_option_value (options_list, GOT_integer, "ASCII_GLYPH", -1, 0);
+ add_new_option_value (options_list, GOT_integer, "ASCII_PUNCTUATION", -1, 0);
+ add_new_option_value (options_list, GOT_integer,
"AUTO_MENU_DESCRIPTION_ALIGN_COLUMN", -1, 0);
+ add_new_option_value (options_list, GOT_integer, "AUTO_MENU_MAX_WIDTH", -1,
0);
+ add_new_option_value (options_list, GOT_char, "BEFORE_SHORT_TOC_LINES", -2,
0);
+ add_new_option_value (options_list, GOT_char, "BEFORE_TOC_LINES", -2, 0);
+ add_new_option_value (options_list, GOT_char, "BIG_RULE", -2, 0);
+ add_new_option_value (options_list, GOT_char, "BODY_ELEMENT_ATTRIBUTES", -2,
0);
+ add_new_option_value (options_list, GOT_char, "CLASS_BEGIN_USEPACKAGE", -2,
0);
+ add_new_option_value (options_list, GOT_integer, "COPIABLE_LINKS", -1, 0);
+ add_new_option_value (options_list, GOT_integer, "CHAPTER_HEADER_LEVEL", -1,
0);
+ add_new_option_value (options_list, GOT_integer, "CHECK_HTMLXREF", -1, 0);
+ add_new_option_value (options_list, GOT_char, "CLOSE_DOUBLE_QUOTE_SYMBOL",
-2, 0);
+ add_new_option_value (options_list, GOT_char, "CLOSE_QUOTE_SYMBOL", -2, 0);
+ add_new_option_value (options_list, GOT_char, "COLLATION_LANGUAGE", -2, 0);
+ add_new_option_value (options_list, GOT_char, "COMMAND_LINE_ENCODING", -2,
0);
+ add_new_option_value (options_list, GOT_integer,
"INDENTED_BLOCK_COMMANDS_IN_TABLE", -1, 0);
+ add_new_option_value (options_list, GOT_char, "CONTENTS_OUTPUT_LOCATION",
-2, 0);
+ add_new_option_value (options_list, GOT_integer, "CONVERT_TO_LATEX_IN_MATH",
-1, 0);
+ add_new_option_value (options_list, GOT_integer, "DATE_IN_HEADER", -1, 0);
+ add_new_option_value (options_list, GOT_char, "DEFAULT_RULE", -2, 0);
+ add_new_option_value (options_list, GOT_integer, "DEF_TABLE", -1, 0);
+ add_new_option_value (options_list, GOT_integer, "DO_ABOUT", -1, 0);
+ add_new_option_value (options_list, GOT_char, "DOCTYPE", -2, 0);
+ add_new_option_value (options_list, GOT_integer,
"DOCUMENTLANGUAGE_COLLATION", -1, 0);
+ add_new_option_value (options_list, GOT_char, "END_USEPACKAGE", -2, 0);
+ add_new_option_value (options_list, GOT_integer,
"EPUB_CREATE_CONTAINER_FILE", -1, 0);
+ add_new_option_value (options_list, GOT_integer,
"EPUB_KEEP_CONTAINER_FOLDER", -1, 0);
+ add_new_option_value (options_list, GOT_char, "EXTENSION", -2, 0);
+ add_new_option_value (options_list, GOT_char, "EXTERNAL_CROSSREF_EXTENSION",
-2, 0);
+ add_new_option_value (options_list, GOT_char, "EXTERNAL_CROSSREF_SPLIT", -2,
0);
+ add_new_option_value (options_list, GOT_char, "EXTERNAL_DIR", -2, 0);
+ add_new_option_value (options_list, GOT_char, "EXTRA_HEAD", -2, 0);
+ add_new_option_value (options_list, GOT_integer,
"FOOTNOTE_END_HEADER_LEVEL", -1, 0);
+ add_new_option_value (options_list, GOT_integer,
"FOOTNOTE_SEPARATE_HEADER_LEVEL", -1, 0);
+ add_new_option_value (options_list, GOT_integer, "HEADER_IN_TABLE", -1, 0);
+ add_new_option_value (options_list, GOT_char, "HIGHLIGHT_SYNTAX", -2, 0);
+ add_new_option_value (options_list, GOT_char,
"HIGHLIGHT_SYNTAX_DEFAULT_LANGUAGE", -2, 0);
+ add_new_option_value (options_list, GOT_char, "HTML_MATH", -2, 0);
+ add_new_option_value (options_list, GOT_char,
"HTML_ROOT_ELEMENT_ATTRIBUTES", -2, 0);
+ add_new_option_value (options_list, GOT_char, "HTMLXREF_FILE", -2, 0);
+ add_new_option_value (options_list, GOT_char, "HTMLXREF_MODE", -2, 0);
+ add_new_option_value (options_list, GOT_integer, "ICONS", -1, 0);
+ add_new_option_value (options_list, GOT_char, "INDEX_ENTRY_COLON", -2, 0);
+ add_new_option_value (options_list, GOT_integer,
"INDEX_SPECIAL_CHARS_WARNING", -1, 0);
+ add_new_option_value (options_list, GOT_char, "INFO_JS_DIR", -2, 0);
+ add_new_option_value (options_list, GOT_char, "INFO_SPECIAL_CHARS_QUOTE",
-2, 0);
+ add_new_option_value (options_list, GOT_integer,
"INFO_SPECIAL_CHARS_WARNING", -1, 0);
+ add_new_option_value (options_list, GOT_integer,
"IGNORE_REF_TO_TOP_NODE_UP", -1, 0);
+ add_new_option_value (options_list, GOT_integer, "INLINE_CSS_STYLE", -1, 0);
+ add_new_option_value (options_list, GOT_char, "INPUT_FILE_NAME_ENCODING",
-2, 0);
+ add_new_option_value (options_list, GOT_char, "JS_WEBLABELS", -2, 0);
+ add_new_option_value (options_list, GOT_char, "JS_WEBLABELS_FILE", -2, 0);
+ add_new_option_value (options_list, GOT_char, "LATEX_FLOATS_FILE_EXTENSION",
-2, "tfl");
+ add_new_option_value (options_list, GOT_char, "LOCALE_ENCODING", -2, 0);
+ add_new_option_value (options_list, GOT_integer, "L2H_CLEAN", -1, 0);
+ add_new_option_value (options_list, GOT_char, "L2H_FILE", -2, 0);
+ add_new_option_value (options_list, GOT_char, "L2H_HTML_VERSION", -2, 0);
+ add_new_option_value (options_list, GOT_char, "L2H_L2H", -2, 0);
+ add_new_option_value (options_list, GOT_integer, "L2H_SKIP", -1, 0);
+ add_new_option_value (options_list, GOT_char, "L2H_TMP", -2, 0);
+ add_new_option_value (options_list, GOT_char, "MATHJAX_SCRIPT", -2, 0);
+ add_new_option_value (options_list, GOT_char, "MATHJAX_SOURCE", -2, 0);
+ add_new_option_value (options_list, GOT_integer, "MAX_HEADER_LEVEL", -1, 0);
+ add_new_option_value (options_list, GOT_char, "MENU_ENTRY_COLON", -2, 0);
+ add_new_option_value (options_list, GOT_char, "MENU_SYMBOL", -2, 0);
+ add_new_option_value (options_list, GOT_char, "MESSAGE_ENCODING", -2, 0);
+ add_new_option_value (options_list, GOT_integer, "MONOLITHIC", -1, 0);
+ add_new_option_value (options_list, GOT_integer, "NO_CSS", -1, 0);
+ add_new_option_value (options_list, GOT_char, "NO_NUMBER_FOOTNOTE_SYMBOL",
-2, 0);
+ add_new_option_value (options_list, GOT_integer, "NO_CUSTOM_HTML_ATTRIBUTE",
-1, 0);
+ add_new_option_value (options_list, GOT_integer, "NODE_NAME_IN_INDEX", -1,
0);
+ add_new_option_value (options_list, GOT_integer, "NODE_NAME_IN_MENU", -1, 0);
+ add_new_option_value (options_list, GOT_integer, "NO_TOP_NODE_OUTPUT", -1,
0);
+ add_new_option_value (options_list, GOT_char, "OPEN_DOUBLE_QUOTE_SYMBOL",
-2, 0);
+ add_new_option_value (options_list, GOT_char, "OPEN_QUOTE_SYMBOL", -2, 0);
+ add_new_option_value (options_list, GOT_integer, "OUTPUT_CHARACTERS", -1, 0);
+ add_new_option_value (options_list, GOT_char, "OUTPUT_ENCODING_NAME", -2, 0);
+ add_new_option_value (options_list, GOT_char, "OUTPUT_FILE_NAME_ENCODING",
-2, 0);
+ add_new_option_value (options_list, GOT_char, "OUTPUT_PERL_ENCODING", -2, 0);
+ add_new_option_value (options_list, GOT_char, "PACKAGE", -2, 0);
+ add_new_option_value (options_list, GOT_char, "PACKAGE_AND_VERSION", -2, 0);
+ add_new_option_value (options_list, GOT_char, "PACKAGE_NAME", -2, 0);
+ add_new_option_value (options_list, GOT_char, "PACKAGE_URL", -2, 0);
+ add_new_option_value (options_list, GOT_char, "PACKAGE_VERSION", -2, 0);
+ add_new_option_value (options_list, GOT_char, "PRE_BODY_CLOSE", -2, 0);
+ add_new_option_value (options_list, GOT_char, "PREFIX", -2, 0);
+ add_new_option_value (options_list, GOT_char, "PROGRAM", -2, 0);
+ add_new_option_value (options_list, GOT_integer, "PROGRAM_NAME_IN_ABOUT",
-1, 0);
+ add_new_option_value (options_list, GOT_integer, "PROGRAM_NAME_IN_FOOTER",
-1, 0);
+ add_new_option_value (options_list, GOT_integer, "SECTION_NAME_IN_TITLE",
-1, 0);
+ add_new_option_value (options_list, GOT_integer, "SHORT_TOC_LINK_TO_TOC",
-1, 0);
+ add_new_option_value (options_list, GOT_integer, "SHOW_TITLE", -1, 0);
+ add_new_option_value (options_list, GOT_char, "T4H_LATEX_CONVERSION", -2, 0);
+ add_new_option_value (options_list, GOT_char, "T4H_MATH_CONVERSION", -2, 0);
+ add_new_option_value (options_list, GOT_char, "T4H_TEX_CONVERSION", -2, 0);
+ add_new_option_value (options_list, GOT_integer, "TEXI2HTML", -1, 0);
+ add_new_option_value (options_list, GOT_char, "TEXINFO_OUTPUT_FORMAT", -2,
0);
+ add_new_option_value (options_list, GOT_integer,
"TXI_MARKUP_NO_SECTION_EXTENT", -1, 0);
+ add_new_option_value (options_list, GOT_integer, "TOC_LINKS", -1, 0);
+ add_new_option_value (options_list, GOT_char, "TOP_FILE", -2, 0);
+ add_new_option_value (options_list, GOT_char, "TOP_NODE_FILE_TARGET", -2, 0);
+ add_new_option_value (options_list, GOT_char, "TOP_NODE_UP_URL", -2, 0);
+ add_new_option_value (options_list, GOT_integer, "USE_ACCESSKEY", -1, 0);
+ add_new_option_value (options_list, GOT_integer, "USE_ISO", -1, 0);
+ add_new_option_value (options_list, GOT_integer, "USE_LINKS", -1, 0);
+ add_new_option_value (options_list, GOT_integer,
"USE_NEXT_HEADING_FOR_LONE_NODE", -1, 0);
+ add_new_option_value (options_list, GOT_integer, "USE_NODES", -1, 0);
+ add_new_option_value (options_list, GOT_integer, "USE_NODE_DIRECTIONS", -1,
0);
+ add_new_option_value (options_list, GOT_integer, "USE_NUMERIC_ENTITY", -1,
0);
+ add_new_option_value (options_list, GOT_integer, "USE_REL_REV", -1, 0);
+ add_new_option_value (options_list, GOT_integer,
"USE_SETFILENAME_EXTENSION", -1, 0);
+ add_new_option_value (options_list, GOT_integer, "USE_TITLEPAGE_FOR_TITLE",
-1, 0);
+ add_new_option_value (options_list, GOT_integer, "USE_UNIDECODE", -1, 0);
+ add_new_option_value (options_list, GOT_integer, "USE_XML_SYNTAX", -1, 0);
+ add_new_option_value (options_list, GOT_integer, "VERTICAL_HEAD_NAVIGATION",
-1, 0);
+ add_new_option_value (options_list, GOT_integer, "WORDS_IN_PAGE", -1, 0);
+ add_new_option_value (options_list, GOT_integer, "XREF_USE_FLOAT_LABEL", -1,
0);
+ add_new_option_value (options_list, GOT_integer, "XREF_USE_NODE_NAME_ARG",
-1, 0);
+ add_new_option_value (options_list, GOT_integer, "XS_EXTERNAL_CONVERSION",
-1, 0);
+ add_new_option_value (options_list, GOT_integer, "XS_EXTERNAL_FORMATTING",
-1, 0);
+ add_new_option_value (options_list, GOT_char, "XS_STRXFRM_COLLATION_LOCALE",
-2, 0);
+}
+
/* converter_other */
@@ -202,6 +368,21 @@ void set_converter_other_regular_defaults (OPTIONS
*options)
option_set_conf (&options->PASSIVE_ICONS, -2, 0);
}
+void add_converter_other_regular_options_defaults (OPTIONS_LIST *options_list)
+{
+ add_new_option_value (options_list, GOT_buttons, "LINKS_BUTTONS", -2, 0);
+ add_new_option_value (options_list, GOT_buttons, "TOP_BUTTONS", -2, 0);
+ add_new_option_value (options_list, GOT_buttons, "TOP_FOOTER_BUTTONS", -2,
0);
+ add_new_option_value (options_list, GOT_buttons, "SECTION_BUTTONS", -2, 0);
+ add_new_option_value (options_list, GOT_buttons, "CHAPTER_FOOTER_BUTTONS",
-2, 0);
+ add_new_option_value (options_list, GOT_buttons, "SECTION_FOOTER_BUTTONS",
-2, 0);
+ add_new_option_value (options_list, GOT_buttons, "NODE_FOOTER_BUTTONS", -2,
0);
+ add_new_option_value (options_list, GOT_buttons, "MISC_BUTTONS", -2, 0);
+ add_new_option_value (options_list, GOT_buttons, "CHAPTER_BUTTONS", -2, 0);
+ add_new_option_value (options_list, GOT_icons, "ACTIVE_ICONS", -2, 0);
+ add_new_option_value (options_list, GOT_icons, "PASSIVE_ICONS", -2, 0);
+}
+
/* multiple_at_command */
@@ -234,6 +415,35 @@ void set_multiple_at_command_regular_defaults (OPTIONS
*options)
option_set_conf (&options->xrefautomaticsectiontitle, -2, "off");
}
+void add_multiple_at_command_regular_options_defaults (OPTIONS_LIST
*options_list)
+{
+ add_new_option_value (options_list, GOT_char, "allowcodebreaks", -2, "true");
+ add_new_option_value (options_list, GOT_char, "clickstyle", -2, "@arrow");
+ add_new_option_value (options_list, GOT_char, "codequotebacktick", -2,
"off");
+ add_new_option_value (options_list, GOT_char, "codequoteundirected", -2,
"off");
+ add_new_option_value (options_list, GOT_integer, "contents", 0, 0);
+ add_new_option_value (options_list, GOT_char, "deftypefnnewline", -2, "off");
+ add_new_option_value (options_list, GOT_char, "documentencoding", -2,
"utf-8");
+ add_new_option_value (options_list, GOT_char, "documentlanguage", -2, 0);
+ add_new_option_value (options_list, GOT_char, "evenfooting", -2, 0);
+ add_new_option_value (options_list, GOT_char, "evenheading", -2, 0);
+ add_new_option_value (options_list, GOT_char, "everyfooting", -2, 0);
+ add_new_option_value (options_list, GOT_char, "everyheading", -2, 0);
+ add_new_option_value (options_list, GOT_char, "exampleindent", -2, "5");
+ add_new_option_value (options_list, GOT_char, "firstparagraphindent", -2,
"none");
+ add_new_option_value (options_list, GOT_char, "frenchspacing", -2, "off");
+ add_new_option_value (options_list, GOT_char, "headings", -2, "on");
+ add_new_option_value (options_list, GOT_char, "kbdinputstyle", -2,
"distinct");
+ add_new_option_value (options_list, GOT_char, "microtype", -2, 0);
+ add_new_option_value (options_list, GOT_char, "oddheading", -2, 0);
+ add_new_option_value (options_list, GOT_char, "oddfooting", -2, 0);
+ add_new_option_value (options_list, GOT_char, "paragraphindent", -2, "3");
+ add_new_option_value (options_list, GOT_integer, "shortcontents", 0, 0);
+ add_new_option_value (options_list, GOT_integer, "summarycontents", 0, 0);
+ add_new_option_value (options_list, GOT_char, "urefbreakstyle", -2, "after");
+ add_new_option_value (options_list, GOT_char, "xrefautomaticsectiontitle",
-2, "off");
+}
+
/* program_cmdline */
@@ -249,6 +459,18 @@ void set_program_cmdline_regular_defaults (OPTIONS
*options)
option_set_conf (&options->FORMAT_MENU, -2, "menu");
}
+void add_program_cmdline_regular_options_defaults (OPTIONS_LIST *options_list)
+{
+ add_new_option_value (options_list, GOT_bytes, "MACRO_EXPAND", -2, 0);
+ add_new_option_value (options_list, GOT_bytes, "INTERNAL_LINKS", -2, 0);
+ add_new_option_value (options_list, GOT_integer, "ERROR_LIMIT", 100, 0);
+ add_new_option_value (options_list, GOT_integer, "FORCE", -1, 0);
+ add_new_option_value (options_list, GOT_integer, "NO_WARN", -1, 0);
+ add_new_option_value (options_list, GOT_char, "SILENT", -2, 0);
+ add_new_option_value (options_list, GOT_integer, "TRACE_INCLUDES", 0, 0);
+ add_new_option_value (options_list, GOT_char, "FORMAT_MENU", -2, "menu");
+}
+
/* program_customization */
@@ -265,6 +487,19 @@ void set_program_customization_regular_defaults (OPTIONS
*options)
option_set_conf (&options->TREE_TRANSFORMATIONS, -2, 0);
}
+void add_program_customization_regular_options_defaults (OPTIONS_LIST
*options_list)
+{
+ add_new_option_value (options_list, GOT_integer,
"CHECK_NORMAL_MENU_STRUCTURE", 1, 0);
+ add_new_option_value (options_list, GOT_integer, "CHECK_MISSING_MENU_ENTRY",
1, 0);
+ add_new_option_value (options_list, GOT_integer, "DUMP_TREE", -1, 0);
+ add_new_option_value (options_list, GOT_integer, "DUMP_TEXI", -1, 0);
+ add_new_option_value (options_list, GOT_integer, "SHOW_BUILTIN_CSS_RULES",
0, 0);
+ add_new_option_value (options_list, GOT_char, "SORT_ELEMENT_COUNT", -2, 0);
+ add_new_option_value (options_list, GOT_integer, "SORT_ELEMENT_COUNT_WORDS",
-1, 0);
+ add_new_option_value (options_list, GOT_char, "TEXI2DVI", -2, "texi2dvi");
+ add_new_option_value (options_list, GOT_char, "TREE_TRANSFORMATIONS", -2, 0);
+}
+
/* unique_at_command */
@@ -291,6 +526,29 @@ void set_unique_at_command_regular_defaults (OPTIONS
*options)
option_set_conf (&options->smallbook, -2, 0);
}
+void add_unique_at_command_regular_options_defaults (OPTIONS_LIST
*options_list)
+{
+ add_new_option_value (options_list, GOT_char, "afivepaper", -2, 0);
+ add_new_option_value (options_list, GOT_char, "afourpaper", -2, 0);
+ add_new_option_value (options_list, GOT_char, "afourlatex", -2, 0);
+ add_new_option_value (options_list, GOT_char, "afourwide", -2, 0);
+ add_new_option_value (options_list, GOT_char, "bsixpaper", -2, 0);
+ add_new_option_value (options_list, GOT_char, "documentdescription", -2, 0);
+ add_new_option_value (options_list, GOT_char, "evenfootingmarks", -2, 0);
+ add_new_option_value (options_list, GOT_char, "evenheadingmarks", -2, 0);
+ add_new_option_value (options_list, GOT_char, "everyfootingmarks", -2,
"bottom");
+ add_new_option_value (options_list, GOT_char, "everyheadingmarks", -2,
"bottom");
+ add_new_option_value (options_list, GOT_integer, "fonttextsize", 11, 0);
+ add_new_option_value (options_list, GOT_char, "footnotestyle", -2, "end");
+ add_new_option_value (options_list, GOT_integer, "novalidate", 0, 0);
+ add_new_option_value (options_list, GOT_char, "oddfootingmarks", -2, 0);
+ add_new_option_value (options_list, GOT_char, "oddheadingmarks", -2, 0);
+ add_new_option_value (options_list, GOT_char, "pagesizes", -2, 0);
+ add_new_option_value (options_list, GOT_char, "setchapternewpage", -2, "on");
+ add_new_option_value (options_list, GOT_char, "setfilename", -2, 0);
+ add_new_option_value (options_list, GOT_char, "smallbook", -2, 0);
+}
+
void set_common_regular_options_defaults (OPTIONS *options)
{
option_set_conf (&options->PACKAGE_AND_VERSION, -2, "texinfo");
@@ -299,11 +557,24 @@ void set_common_regular_options_defaults (OPTIONS
*options)
option_set_conf (&options->PROGRAM, -2, "");
}
+void add_common_regular_options_defaults (OPTIONS_LIST *options_list)
+{
+ add_new_option_value (options_list, GOT_char, "PACKAGE_AND_VERSION", -2,
"texinfo");
+ add_new_option_value (options_list, GOT_char, "PACKAGE_VERSION", -2, "");
+ add_new_option_value (options_list, GOT_char, "PACKAGE_URL", -2,
"http://www.gnu.org/software/texinfo/");
+ add_new_option_value (options_list, GOT_char, "PROGRAM", -2, "");
+}
+
void set_converter_regular_options_defaults (OPTIONS *options)
{
option_set_conf (&options->documentlanguage, -2, 0);
}
+void add_converter_regular_options_defaults (OPTIONS_LIST *options_list)
+{
+ add_new_option_value (options_list, GOT_char, "documentlanguage", -2, 0);
+}
+
void set_html_regular_options_defaults (OPTIONS *options)
{
option_set_conf (&options->BIG_RULE, -2, "<hr>");
@@ -360,6 +631,62 @@ void set_html_regular_options_defaults (OPTIONS *options)
option_set_conf (&options->xrefautomaticsectiontitle, -2, "on");
}
+void add_html_regular_options_defaults (OPTIONS_LIST *options_list)
+{
+ add_new_option_value (options_list, GOT_char, "BIG_RULE", -2, "<hr>");
+ add_new_option_value (options_list, GOT_char, "BODY_ELEMENT_ATTRIBUTES", -2,
0);
+ add_new_option_value (options_list, GOT_integer, "CHAPTER_HEADER_LEVEL", 2,
0);
+ add_new_option_value (options_list, GOT_char, "CLOSE_QUOTE_SYMBOL", -2, 0);
+ add_new_option_value (options_list, GOT_char, "CONTENTS_OUTPUT_LOCATION",
-2, "after_top");
+ add_new_option_value (options_list, GOT_integer, "CONVERT_TO_LATEX_IN_MATH",
-1, 0);
+ add_new_option_value (options_list, GOT_integer,
"INDENTED_BLOCK_COMMANDS_IN_TABLE", 0, 0);
+ add_new_option_value (options_list, GOT_integer, "COPIABLE_LINKS", 1, 0);
+ add_new_option_value (options_list, GOT_integer, "DATE_IN_HEADER", 0, 0);
+ add_new_option_value (options_list, GOT_char, "DEFAULT_RULE", -2, "<hr>");
+ add_new_option_value (options_list, GOT_char, "documentlanguage", -2, "en");
+ add_new_option_value (options_list, GOT_char, "DOCTYPE", -2, "<!DOCTYPE
html>");
+ add_new_option_value (options_list, GOT_integer, "DO_ABOUT", 0, 0);
+ add_new_option_value (options_list, GOT_integer, "OUTPUT_CHARACTERS", 0, 0);
+ add_new_option_value (options_list, GOT_char, "EXTENSION", -2, "html");
+ add_new_option_value (options_list, GOT_char, "EXTERNAL_CROSSREF_EXTENSION",
-2, 0);
+ add_new_option_value (options_list, GOT_integer,
"FOOTNOTE_END_HEADER_LEVEL", 4, 0);
+ add_new_option_value (options_list, GOT_integer,
"FOOTNOTE_SEPARATE_HEADER_LEVEL", 4, 0);
+ add_new_option_value (options_list, GOT_char, "FORMAT_MENU", -2,
"sectiontoc");
+ add_new_option_value (options_list, GOT_integer, "HEADERS", 1, 0);
+ add_new_option_value (options_list, GOT_char, "INDEX_ENTRY_COLON", -2, "");
+ add_new_option_value (options_list, GOT_integer, "INLINE_CSS_STYLE", 0, 0);
+ add_new_option_value (options_list, GOT_char, "JS_WEBLABELS", -2,
"generate");
+ add_new_option_value (options_list, GOT_char, "JS_WEBLABELS_FILE", -2,
"js_licenses.html");
+ add_new_option_value (options_list, GOT_integer, "MAX_HEADER_LEVEL", 4, 0);
+ add_new_option_value (options_list, GOT_char, "MENU_ENTRY_COLON", -2, ":");
+ add_new_option_value (options_list, GOT_char, "MENU_SYMBOL", -2, 0);
+ add_new_option_value (options_list, GOT_integer, "MONOLITHIC", 1, 0);
+ add_new_option_value (options_list, GOT_integer, "NO_CUSTOM_HTML_ATTRIBUTE",
0, 0);
+ add_new_option_value (options_list, GOT_integer, "NO_CSS", 0, 0);
+ add_new_option_value (options_list, GOT_char, "NO_NUMBER_FOOTNOTE_SYMBOL",
-2, "*");
+ add_new_option_value (options_list, GOT_integer, "NODE_NAME_IN_MENU", 1, 0);
+ add_new_option_value (options_list, GOT_char, "OPEN_QUOTE_SYMBOL", -2, 0);
+ add_new_option_value (options_list, GOT_char, "OUTPUT_ENCODING_NAME", -2,
"utf-8");
+ add_new_option_value (options_list, GOT_integer, "SECTION_NAME_IN_TITLE", 0,
0);
+ add_new_option_value (options_list, GOT_integer, "SHORT_TOC_LINK_TO_TOC", 1,
0);
+ add_new_option_value (options_list, GOT_integer, "SHOW_TITLE", -1, 0);
+ add_new_option_value (options_list, GOT_char, "SPLIT", -2, "node");
+ add_new_option_value (options_list, GOT_char, "TOP_FILE", -2, "index.html");
+ add_new_option_value (options_list, GOT_char, "TOP_NODE_FILE_TARGET", -2,
"index.html");
+ add_new_option_value (options_list, GOT_integer, "USE_ACCESSKEY", 1, 0);
+ add_new_option_value (options_list, GOT_integer,
"USE_NEXT_HEADING_FOR_LONE_NODE", 1, 0);
+ add_new_option_value (options_list, GOT_integer, "USE_ISO", 1, 0);
+ add_new_option_value (options_list, GOT_integer, "USE_LINKS", 1, 0);
+ add_new_option_value (options_list, GOT_integer, "USE_NODES", 1, 0);
+ add_new_option_value (options_list, GOT_integer, "USE_NODE_DIRECTIONS", -1,
0);
+ add_new_option_value (options_list, GOT_integer, "USE_REL_REV", 1, 0);
+ add_new_option_value (options_list, GOT_integer, "USE_TITLEPAGE_FOR_TITLE",
1, 0);
+ add_new_option_value (options_list, GOT_integer, "WORDS_IN_PAGE", 300, 0);
+ add_new_option_value (options_list, GOT_integer, "XREF_USE_NODE_NAME_ARG",
-1, 0);
+ add_new_option_value (options_list, GOT_integer, "XREF_USE_FLOAT_LABEL", 0,
0);
+ add_new_option_value (options_list, GOT_char, "xrefautomaticsectiontitle",
-2, "on");
+}
+
void set_texi2html_regular_options_defaults (OPTIONS *options)
{
option_set_conf (&options->FORMAT_MENU, -2, "menu");
@@ -387,3 +714,30 @@ void set_texi2html_regular_options_defaults (OPTIONS
*options)
option_set_conf (&options->FOOTNOTE_SEPARATE_HEADER_LEVEL, 1, 0);
}
+void add_texi2html_regular_options_defaults (OPTIONS_LIST *options_list)
+{
+ add_new_option_value (options_list, GOT_char, "FORMAT_MENU", -2, "menu");
+ add_new_option_value (options_list, GOT_integer,
"USE_SETFILENAME_EXTENSION", 0, 0);
+ add_new_option_value (options_list, GOT_char, "footnotestyle", -2,
"separate");
+ add_new_option_value (options_list, GOT_char, "CONTENTS_OUTPUT_LOCATION",
-2, "separate_element");
+ add_new_option_value (options_list, GOT_integer, "FORCE", 1, 0);
+ add_new_option_value (options_list, GOT_integer, "USE_ACCESSKEY", 0, 0);
+ add_new_option_value (options_list, GOT_integer, "NODE_NAME_IN_MENU", 0, 0);
+ add_new_option_value (options_list, GOT_integer, "SHORT_TOC_LINK_TO_TOC", 0,
0);
+ add_new_option_value (options_list, GOT_integer, "SHOW_TITLE", 1, 0);
+ add_new_option_value (options_list, GOT_integer, "USE_REL_REV", 0, 0);
+ add_new_option_value (options_list, GOT_integer, "USE_LINKS", 0, 0);
+ add_new_option_value (options_list, GOT_integer, "USE_NODES", 0, 0);
+ add_new_option_value (options_list, GOT_char, "SPLIT", -2, "");
+ add_new_option_value (options_list, GOT_integer, "PROGRAM_NAME_IN_FOOTER",
1, 0);
+ add_new_option_value (options_list, GOT_integer, "PROGRAM_NAME_IN_ABOUT", 1,
0);
+ add_new_option_value (options_list, GOT_integer, "HEADER_IN_TABLE", 1, 0);
+ add_new_option_value (options_list, GOT_char, "MENU_ENTRY_COLON", -2, "");
+ add_new_option_value (options_list, GOT_char, "INDEX_ENTRY_COLON", -2, "");
+ add_new_option_value (options_list, GOT_integer, "DO_ABOUT", -1, 0);
+ add_new_option_value (options_list, GOT_integer, "CHAPTER_HEADER_LEVEL", 1,
0);
+ add_new_option_value (options_list, GOT_char, "BIG_RULE", -2, "<hr
style=\"height: 6px;\">");
+ add_new_option_value (options_list, GOT_integer,
"FOOTNOTE_END_HEADER_LEVEL", 3, 0);
+ add_new_option_value (options_list, GOT_integer,
"FOOTNOTE_SEPARATE_HEADER_LEVEL", 1, 0);
+}
+
diff --git a/tp/Texinfo/XS/convert/converters_defaults.h
b/tp/Texinfo/XS/convert/converters_defaults.h
index 25563a2831..fb4f02d7b3 100644
--- a/tp/Texinfo/XS/convert/converters_defaults.h
+++ b/tp/Texinfo/XS/convert/converters_defaults.h
@@ -14,26 +14,50 @@
void set_array_cmdline_regular_defaults (OPTIONS *options);
+void add_array_cmdline_regular_options_defaults (OPTIONS_LIST *options_list);
+
void set_converter_cmdline_regular_defaults (OPTIONS *options);
+void add_converter_cmdline_regular_options_defaults (OPTIONS_LIST
*options_list);
+
void set_converter_customization_regular_defaults (OPTIONS *options);
+void add_converter_customization_regular_options_defaults (OPTIONS_LIST
*options_list);
+
void set_converter_other_regular_defaults (OPTIONS *options);
+void add_converter_other_regular_options_defaults (OPTIONS_LIST *options_list);
+
void set_multiple_at_command_regular_defaults (OPTIONS *options);
+void add_multiple_at_command_regular_options_defaults (OPTIONS_LIST
*options_list);
+
void set_program_cmdline_regular_defaults (OPTIONS *options);
+void add_program_cmdline_regular_options_defaults (OPTIONS_LIST *options_list);
+
void set_program_customization_regular_defaults (OPTIONS *options);
+void add_program_customization_regular_options_defaults (OPTIONS_LIST
*options_list);
+
void set_unique_at_command_regular_defaults (OPTIONS *options);
+void add_unique_at_command_regular_options_defaults (OPTIONS_LIST
*options_list);
+
void set_common_regular_options_defaults (OPTIONS *options);
+void add_common_regular_options_defaults (OPTIONS_LIST *options_list);
+
void set_converter_regular_options_defaults (OPTIONS *options);
+void add_converter_regular_options_defaults (OPTIONS_LIST *options_list);
+
void set_html_regular_options_defaults (OPTIONS *options);
+void add_html_regular_options_defaults (OPTIONS_LIST *options_list);
+
void set_texi2html_regular_options_defaults (OPTIONS *options);
+void add_texi2html_regular_options_defaults (OPTIONS_LIST *options_list);
+
#endif
diff --git a/tp/Texinfo/XS/convert/get_converter_perl_info.c
b/tp/Texinfo/XS/convert/get_converter_perl_info.c
index 7f060e38f0..ba49f97c26 100644
--- a/tp/Texinfo/XS/convert/get_converter_perl_info.c
+++ b/tp/Texinfo/XS/convert/get_converter_perl_info.c
@@ -85,31 +85,23 @@ get_or_create_sv_converter (SV *converter_in, const char
*input_class)
converter = get_sv_converter (converter_in, 0);
if (!converter)
{
- HV *stash;
- const char *class = 0;
+ const char *class_name = 0;
enum converter_format converter_format = COF_none;
- int i;
if (input_class)
- class = input_class;
+ class_name = input_class;
else
{
+ HV *stash;
stash = SvSTASH (SvRV (converter_in));
- class = HvNAME (stash);
+ class_name = HvNAME (stash);
}
- if (class)
+ if (class_name)
{
/* determine the converter format, if handled in C */
- for (i =0; i < TXI_CONVERSION_FORMAT_NR; i++)
- {
- if (!strcmp (converter_format_data[i].perl_converter_class,
- class))
- {
- converter_format = i;
- break;
- }
- }
+ converter_format
+ = find_perl_converter_class_converter_format (class_name);
}
converter_descriptor = new_converter (converter_format,
@@ -222,7 +214,7 @@ set_translated_commands (SV *translated_commands_sv)
}
static OPTION *
-new_option_from_sv (SV *option_sv, CONVERTER *converter,
+new_numbered_option_from_sv (SV *option_sv, CONVERTER *converter,
OPTION **sorted_options, const char *option_name,
int *status)
{
@@ -273,7 +265,7 @@ get_converter_info_from_sv (SV *conf_sv, const char *class,
char *key;
I32 retlen;
SV *value = hv_iternextsv (conf_hv, &key, &retlen);
- OPTION *option = new_option_from_sv (value, converter,
+ OPTION *option = new_numbered_option_from_sv (value, converter,
sorted_options, key, &status);
if (!status)
diff --git a/tp/Texinfo/XS/convert/html_converter_api.h
b/tp/Texinfo/XS/convert/html_converter_api.h
index fd989f7a07..922ad29fba 100644
--- a/tp/Texinfo/XS/convert/html_converter_api.h
+++ b/tp/Texinfo/XS/convert/html_converter_api.h
@@ -26,7 +26,8 @@
void html_format_setup (void);
/* in html_converter_init_options.c */
-CONVERTER_INITIALIZATION_INFO *html_converter_defaults (CONVERTER *self,
+CONVERTER_INITIALIZATION_INFO *html_converter_defaults (
+ enum converter_format format,
CONVERTER_INITIALIZATION_INFO *format_defaults);
/* implemented in html_converter_api.c using html_conversion_api.h functions */
diff --git a/tp/Texinfo/XS/convert/html_converter_init_options.c
b/tp/Texinfo/XS/convert/html_converter_init_options.c
index da338424ab..19929fc5b5 100644
--- a/tp/Texinfo/XS/convert/html_converter_init_options.c
+++ b/tp/Texinfo/XS/convert/html_converter_init_options.c
@@ -81,10 +81,9 @@ set_option_buttons_specification (OPTION *option,
option->o.buttons = buttons;
}
-static void
-set_html_default_buttons_specifications (CONVERTER *self)
+void
+set_html_default_buttons_specifications (OPTIONS *options, CONVERTER *self)
{
- OPTIONS *options = self->conf;
set_option_buttons_specification (&options->SECTION_BUTTONS,
new_base_navigation_section_buttons
(self));
set_option_buttons_specification (&options->SECTION_FOOTER_BUTTONS,
@@ -106,9 +105,32 @@ set_html_default_buttons_specifications (CONVERTER *self)
}
static void
-set_texi2html_default_buttons_specifications (CONVERTER *self)
+add_html_default_buttons_specifications (OPTIONS_LIST *options, CONVERTER
*self)
+{
+ add_new_button_option (options, "SECTION_BUTTONS",
+ new_base_navigation_section_buttons
(self));
+ add_new_button_option (options, "SECTION_FOOTER_BUTTONS",
+ new_base_navigation_section_footer_buttons (self));
+ add_new_button_option (options, "LINKS_BUTTONS",
+ new_base_links_buttons (self));
+ add_new_button_option (options, "NODE_FOOTER_BUTTONS",
+ new_base_navigation_buttons (self, BFT_type_panel_node_footer, 0));
+ add_new_button_option (options, "CHAPTER_BUTTONS",
+ new_base_navigation_section_buttons
(self));
+ add_new_button_option (options, "MISC_BUTTONS",
+ new_directions_list_buttons_specifications (self, DEFAULT_MISC_BUTTONS));
+ add_new_button_option (options, "TOP_BUTTONS",
+ new_base_navigation_section_buttons
(self));
+ add_new_button_option (options, "CHAPTER_FOOTER_BUTTONS",
+ new_base_navigation_section_footer_buttons (self));
+ add_new_button_option (options, "TOP_FOOTER_BUTTONS",
+ new_base_navigation_section_footer_buttons (self));
+}
+
+void
+set_texi2html_default_buttons_specifications (OPTIONS *options,
+ CONVERTER *self)
{
- OPTIONS *options = self->conf;
set_option_buttons_specification (&options->SECTION_BUTTONS,
new_directions_list_buttons_specifications (self, T2H_SECTION_BUTTONS));
@@ -134,35 +156,63 @@ set_texi2html_default_buttons_specifications (CONVERTER
*self)
new_directions_list_buttons_specifications (self, T2H_SECTION_BUTTONS));
}
-/* TODO we directly set the converter conf, so the conf list of
- returned format_defaults is not set. This should work,
- but this is not the spirit of the corresponding Perl API */
+static void
+add_texi2html_default_buttons_specifications (OPTIONS_LIST *options,
+ CONVERTER *self)
+{
+ add_new_button_option (options, "SECTION_BUTTONS",
+ new_directions_list_buttons_specifications (self, T2H_SECTION_BUTTONS));
+
+ add_new_button_option (options, "TOP_BUTTONS",
+ new_directions_list_buttons_specifications (self, T2H_TOP_BUTTONS));
+
+ add_new_button_option (options, "TOP_FOOTER_BUTTONS",
+ new_directions_list_buttons_specifications (self, T2H_TOP_BUTTONS));
+
+ add_new_button_option (options, "MISC_BUTTONS",
+ new_directions_list_buttons_specifications (self, DEFAULT_MISC_BUTTONS));
+
+ add_new_button_option (options, "CHAPTER_BUTTONS",
+ new_directions_list_buttons_specifications (self, T2H_CHAPTER_BUTTONS));
+
+ add_new_button_option (options, "SECTION_FOOTER_BUTTONS",
+ new_directions_list_buttons_specifications (self,
T2H_SECTION_FOOTER_BUTTONS));
+
+ add_new_button_option (options, "CHAPTER_FOOTER_BUTTONS",
+ new_directions_list_buttons_specifications (self, T2H_CHAPTER_BUTTONS));
+
+ add_new_button_option (options, "NODE_FOOTER_BUTTONS",
+ new_directions_list_buttons_specifications (self, T2H_SECTION_BUTTONS));
+}
+
CONVERTER_INITIALIZATION_INFO *
-html_converter_defaults (CONVERTER *self,
+html_converter_defaults (enum converter_format format,
CONVERTER_INITIALIZATION_INFO *conf)
{
CONVERTER_INITIALIZATION_INFO *format_defaults
= new_converter_initialization_info ();
+
format_defaults->converted_format = strdup ("html");
- set_html_regular_options_defaults (self->conf);
- set_html_default_buttons_specifications (self);
+ add_html_regular_options_defaults (&format_defaults->conf);
+
+ add_html_default_buttons_specifications (&format_defaults->conf, 0);
if (conf)
{
- size_t t2h_conf_number = self->conf->TEXI2HTML.number;
size_t i;
for (i = 0; i < conf->conf.number; i++)
{
OPTION *option = conf->conf.list[i];
- if (option->number == t2h_conf_number)
+ if (!strcmp (option->name, "TEXI2HTML"))
{
if (option->o.integer >= 0)
{
- set_texi2html_regular_options_defaults (self->conf);
- set_texi2html_default_buttons_specifications (self);
- return format_defaults;
+ add_texi2html_regular_options_defaults
+ (&format_defaults->conf);
+ add_texi2html_default_buttons_specifications
+ (&format_defaults->conf, 0);
}
break;
}
diff --git a/tp/Texinfo/XS/convert/texinfo.c b/tp/Texinfo/XS/convert/texinfo.c
index f83acd3390..7623e1a940 100644
--- a/tp/Texinfo/XS/convert/texinfo.c
+++ b/tp/Texinfo/XS/convert/texinfo.c
@@ -285,7 +285,7 @@ txi_converter_setup (const char *format_str,
const char *program_file, OPTIONS_LIST *customizations)
{
enum converter_format converter_format
- = find_format_data_index (format_str);
+ = find_format_name_converter_format (format_str);
CONVERTER_INITIALIZATION_INFO *conf;
CONVERTER *self;
diff --git a/tp/Texinfo/XS/main/build_perl_info.c
b/tp/Texinfo/XS/main/build_perl_info.c
index e80eb5e3d8..8349729070 100644
--- a/tp/Texinfo/XS/main/build_perl_info.c
+++ b/tp/Texinfo/XS/main/build_perl_info.c
@@ -46,6 +46,7 @@
#include "types_data.h"
#include "tree_types.h"
#include "global_commands_types.h"
+#include "option_types.h"
/* for GLOBAL_INFO ERROR_MESSAGE CL_* */
#include "document_types.h"
/* CONVERTER sv_string_type */
@@ -2866,7 +2867,16 @@ html_build_button (const CONVERTER *converter,
BUTTON_SPECIFICATION *button,
direction_name = button->direction_string;
else
direction_name
- = converter->direction_unit_direction_name[button->b.direction];
+ = direction_unit_direction_name (button->b.direction,
+ converter);
+ if (!direction_name)
+ {
+ char *msg;
+ xasprintf (&msg, "No name for button direction %d",
+ button->b.direction);
+ fatal (msg);
+ free (msg);
+ }
return newSVpv_utf8 (direction_name, 0);
break;
@@ -2879,7 +2889,16 @@ html_build_button (const CONVERTER *converter,
BUTTON_SPECIFICATION *button,
direction_name = button->direction_string;
else
direction_name
- = converter->direction_unit_direction_name[button_spec->direction];
+ = direction_unit_direction_name (button_spec->direction,
+ converter);
+ if (!direction_name)
+ {
+ char *msg;
+ xasprintf (&msg, "No name for array button direction %d",
+ button_spec->direction);
+ fatal (msg);
+ free (msg);
+ }
if (button_spec->type == BIT_function)
{
@@ -2940,7 +2959,8 @@ html_build_buttons_specification (CONVERTER *converter,
&user_function_number);
buttons->BIT_user_function_number += user_function_number;
- converter->external_references_number += user_function_number;
+ if (converter)
+ converter->external_references_number += user_function_number;
button->sv = button_sv;
@@ -3060,6 +3080,39 @@ build_sv_option_from_name (OPTION **sorted_options,
CONVERTER *converter,
return newSV (0);
}
+/* not much used, as in general the options are only stored in C and
+ accessed through the API and built when accessed through a converter.
+ This is only used when there is no converter, when a function is called with
+ a class name only and returns an option hash */
+SV *
+build_sv_options_from_options_list (const OPTIONS_LIST *options_list,
+ CONVERTER *converter)
+{
+ size_t i;
+ HV *options_hv;
+
+ dTHX;
+
+ options_hv = newHV ();
+
+ for (i = 0; i < options_list->number; i++)
+ {
+ const OPTION *option = options_list->list[i];
+ const char *key = option->name;
+ SV *option_sv = build_sv_option (option, converter);
+
+ /* we store all values as they appear, the later overriding earlier
+ values, and do not treat undef nor C option configured field
+ especially */
+ if (SvOK (option_sv))
+ SvREFCNT_inc (option_sv);
+
+ hv_store (options_hv, key, strlen (key), option_sv, 0);
+ }
+
+ return newRV_noinc ((SV *)options_hv);
+}
+
/* pass generic converter information to Perl */
diff --git a/tp/Texinfo/XS/main/build_perl_info.h
b/tp/Texinfo/XS/main/build_perl_info.h
index c8ae1e1d49..1de3c58fc6 100644
--- a/tp/Texinfo/XS/main/build_perl_info.h
+++ b/tp/Texinfo/XS/main/build_perl_info.h
@@ -8,6 +8,7 @@
#include "perl.h"
#include "tree_types.h"
+#include "option_types.h"
#include "options_types.h"
#include "document_types.h"
#include "converter_types.h"
@@ -91,6 +92,8 @@ SV *html_build_buttons_specification (CONVERTER *converter,
BUTTON_SPECIFICATION_LIST *buttons);
SV * build_sv_option_from_name (OPTION **sorted_options, CONVERTER *converter,
const char *option_name);
+SV *build_sv_options_from_options_list (const OPTIONS_LIST *options_list,
+ CONVERTER *converter);
void pass_generic_converter_to_converter_sv (SV *converter_sv,
const CONVERTER *converter);
diff --git a/tp/Texinfo/XS/main/customization_options.c
b/tp/Texinfo/XS/main/customization_options.c
index 144e840736..843b6040c1 100644
--- a/tp/Texinfo/XS/main/customization_options.c
+++ b/tp/Texinfo/XS/main/customization_options.c
@@ -319,7 +319,12 @@ copy_option (OPTION *destination, const OPTION *source)
else if (button->type == BST_string)
button->b.string = strdup (s_button->b.string);
else if (button->type == BST_direction)
- button->b.direction = s_button->b.direction;
+ {
+ button->b.direction = s_button->b.direction;
+ if (button->b.direction < 0 &&
s_button->direction_string)
+ button->direction_string
+ = s_button->direction_string;
+ }
else if (button->type == BST_direction_info)
{
BUTTON_SPECIFICATION_INFO *s_button_spec
@@ -332,6 +337,12 @@ copy_option (OPTION *destination, const OPTION *source)
button->b.button_info = button_spec;
button_spec->type = s_button_spec->type;
button_spec->direction = s_button_spec->direction;
+
+ if (button_spec->direction < 0
+ && s_button->direction_string)
+ button->direction_string
+ = s_button->direction_string;
+
if (button_spec->type == BIT_function)
{
button_spec->bi.button_function.type
@@ -507,6 +518,18 @@ add_new_option_value (OPTIONS_LIST *options_list,
return option;
}
+OPTION *
+add_new_button_option (OPTIONS_LIST *options_list, const char *option_name,
+ BUTTON_SPECIFICATION_LIST *buttons)
+{
+ OPTION *option = new_option (GOT_buttons, option_name, 0);
+
+ option->o.buttons = buttons;
+
+ options_list_add_option (options_list, option);
+
+ return option;
+}
void
copy_options_list (OPTIONS_LIST *options_list, const OPTIONS_LIST *options_src)
diff --git a/tp/Texinfo/XS/main/customization_options.h
b/tp/Texinfo/XS/main/customization_options.h
index 886261103a..4255450151 100644
--- a/tp/Texinfo/XS/main/customization_options.h
+++ b/tp/Texinfo/XS/main/customization_options.h
@@ -57,6 +57,9 @@ void options_list_add_option (OPTIONS_LIST *options_list,
OPTION *option);
OPTION *add_new_option_value (OPTIONS_LIST *options_list,
enum global_option_type type, const char *name,
int int_value, const char *char_value);
+OPTION *add_new_button_option (OPTIONS_LIST *options_list,
+ const char *option_name,
+ BUTTON_SPECIFICATION_LIST *buttons);
void copy_options_list (OPTIONS_LIST *options_list,
const OPTIONS_LIST *options_src);
diff --git a/tp/Texinfo/XS/main/utils.c b/tp/Texinfo/XS/main/utils.c
index a165255ebe..c98002b1a1 100644
--- a/tp/Texinfo/XS/main/utils.c
+++ b/tp/Texinfo/XS/main/utils.c
@@ -1700,6 +1700,19 @@ html_get_direction_index (const CONVERTER *converter,
const char *direction)
return -1;
}
+const char *
+direction_unit_direction_name (int direction, const CONVERTER *converter)
+{
+ if (direction < 0)
+ return 0;
+ else if (direction < NON_SPECIAL_DIRECTIONS_NR)
+ return html_button_direction_names[direction];
+ else if (converter && converter->direction_unit_direction_name)
+ return converter->direction_unit_direction_name[direction];
+ else
+ return 0;
+}
+
void
@@ -1726,8 +1739,9 @@ html_fill_button_directions_specification_list (const
CONVERTER *converter,
if (button->b.button_info->direction < 0)
{
fprintf (stderr,
- "BUG: still unknown button %zu array direction: %d: %s\n",
- i, button->b.button_info->direction, direction_name);
+ "BUG: %p: still unknown button %zu array direction: %d:
%s\n",
+ button, i, button->b.button_info->direction,
+ direction_name);
}
*/
}
@@ -1737,15 +1751,16 @@ html_fill_button_directions_specification_list (const
CONVERTER *converter,
if (button->b.direction < 0)
{
direction_name = button->direction_string;
+ if (direction_name)
+ button->b.direction = html_get_direction_index (converter,
+
direction_name);
}
- if (direction_name)
- button->b.direction = html_get_direction_index (converter,
- direction_name);
+
/* this would happen in test with redefined special unit direction
if (button->b.direction < 0)
fprintf (stderr,
- "BUG: still unknown button %zu string direction: %s\n",
- i, direction_name);
+ "BUG: %p: still unknown button %zu string direction:
%s\n",
+ button, i, direction_name);
*/
}
}
diff --git a/tp/Texinfo/XS/main/utils.h b/tp/Texinfo/XS/main/utils.h
index 0457a1ce5e..6f4d358b6b 100644
--- a/tp/Texinfo/XS/main/utils.h
+++ b/tp/Texinfo/XS/main/utils.h
@@ -258,6 +258,8 @@ void html_clear_direction_icons (DIRECTION_ICON_LIST
*direction_icons);
void html_free_direction_icons (DIRECTION_ICON_LIST *direction_icons);
int html_get_direction_index (const CONVERTER *converter,
const char *direction);
+const char *direction_unit_direction_name (int direction,
+ const CONVERTER *converter);
TARGET_FILENAME *new_target_filename (void);
TARGET_CONTENTS_FILENAME *new_target_contents_filename (void);
diff --git a/tp/Texinfo/XS/teximakehtml.c b/tp/Texinfo/XS/teximakehtml.c
index 1d3e2983c2..b7e15e78c4 100644
--- a/tp/Texinfo/XS/teximakehtml.c
+++ b/tp/Texinfo/XS/teximakehtml.c
@@ -58,19 +58,6 @@ add_button_option (OPTIONS_LIST *options_list, OPTION
**sorted_options,
options_list_add_option (options_list, option);
}
-static OPTION *
-add_new_button_option (OPTIONS_LIST *options_list, const char *option_name,
- BUTTON_SPECIFICATION_LIST *buttons)
-{
- OPTION *option = new_option (GOT_buttons, option_name, 0);
-
- option->o.buttons = buttons;
-
- options_list_add_option (options_list, option);
-
- return option;
-}
-
/* this function or a variation could be added to customization_options.c */
static OPTION *
add_new_option_strlist_value (OPTIONS_LIST *options_list,
diff --git a/tp/maintain/regenerate_C_options_info.pl
b/tp/maintain/regenerate_C_options_info.pl
index aa8d52f1c4..6d255d7a96 100755
--- a/tp/maintain/regenerate_C_options_info.pl
+++ b/tp/maintain/regenerate_C_options_info.pl
@@ -401,27 +401,42 @@ print OHDEF "#undef PACKAGE_VERSION\n\n";
foreach my $category (sort(keys(%option_categories))) {
print OCDEF "\n/* ${category} */\n\n";
- my $fun = "void set_${category}_regular_defaults (OPTIONS *options)";
+ my $options_fun = "void set_${category}_regular_defaults (OPTIONS *options)";
+ my $list_fun = "void add_${category}_regular_options_defaults (OPTIONS_LIST
*options_list)";
- print OHDEF "$fun;\n\n";
+ print OHDEF "$options_fun;\n\n";
+ print OHDEF "$list_fun;\n\n";
- print OCDEF "$fun\n{\n";
+ print OCDEF "$options_fun\n{\n";
foreach my $option_info (@{$option_categories{$category}}) {
my ($option, $value, $type) = @$option_info;
my ($int_value, $char_value) = get_value($type, $value);
print OCDEF " option_set_conf (&options->${option}, $int_value,
$char_value);\n";
}
print OCDEF "}\n\n";
+
+ print OCDEF "$list_fun\n{\n";
+ foreach my $option_info (@{$option_categories{$category}}) {
+ my ($option, $value, $type) = @$option_info;
+ my ($int_value, $char_value) = get_value($type, $value);
+ print OCDEF " add_new_option_value (options_list, GOT_$type, "
+ ."\"$option\", $int_value, $char_value);\n";
+ }
+ print OCDEF "}\n\n";
}
my @sorted_formats = sort(keys(%converter_defaults));
foreach my $format (@sorted_formats) {
- my $fun = "void set_${format}_regular_options_defaults (OPTIONS *options)";
+ my $options_fun
+ = "void set_${format}_regular_options_defaults (OPTIONS *options)";
+ my $list_fun
+ = "void add_${format}_regular_options_defaults (OPTIONS_LIST
*options_list)";
- print OHDEF "$fun;\n\n";
+ print OHDEF "$options_fun;\n\n";
+ print OHDEF "$list_fun;\n\n";
- print OCDEF "$fun\n{\n";
+ print OCDEF "$options_fun\n{\n";
foreach my $option_spec (@{$converter_defaults{$format}}) {
my ($option, $value) = @$option_spec;
my $option_info = $options{$option};
@@ -430,6 +445,17 @@ foreach my $format (@sorted_formats) {
print OCDEF " option_set_conf (&options->${option}, $int_value,
$char_value);\n";
}
print OCDEF "}\n\n";
+
+ print OCDEF "$list_fun\n{\n";
+ foreach my $option_spec (@{$converter_defaults{$format}}) {
+ my ($option, $value) = @$option_spec;
+ my $option_info = $options{$option};
+ my ($option_unused, $main_default, $type) = @$option_info;
+ my ($int_value, $char_value) = get_value($type, $value);
+ print OCDEF " add_new_option_value (options_list, GOT_$type, "
+ ."\"$option\", $int_value, $char_value);\n";
+ }
+ print OCDEF "}\n\n";
}
close(OCDEF);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: No converter information in converter_defaults, and XS override,
Patrice Dumas <=