texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Patrice Dumas
Date: Thu, 3 Oct 2024 17:34:52 -0400 (EDT)

branch: master
commit d3bd11531c85d09e299042e43ebcc876cf0b2a90
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Fri Aug 9 23:43:05 2024 +0200

    * tp/maintain/regenerate_C_options_info.pl,
    tp/Texinfo/XS/convert/convert_html.c,
    tp/Texinfo/XS/convert/converter.c,
    tp/Texinfo/XS/convert/html_converter_init_options.c,
    tp/Texinfo/XS/main/utils.c (option_set_conf_internal, option_set_conf)
    (option_force_conf): move set_conf and force_conf to utils.c, rename
    as option_set_conf and option_force_conf.
    
    * tp/Texinfo/XS/convert/texinfo.c (txi_converter),
    tp/Texinfo/XS/main/utils.c (new_option_string_value)
    (add_option_string_value): rename initialize_option_value as
    new_option_string_value and add_option_value as
    add_option_string_value and move to utils.c.
    
    * tp/Texinfo/XS/convert/get_converter_perl_info.c (new_option_from_sv)
    (get_converter_info_from_sv),
    tp/Texinfo/XS/convert/html_converter_init_options.c
    (html_converter_defaults), tp/Texinfo/XS/convert/texinfo.c
    (txi_converter), tp/Texinfo/XS/main/utils.c
    (copy_options_list_options, new_option, new_option_string_value)
    (add_option_string_value, free_options_list),
    tp/Texinfo/XS/main/option_types.h (OPTIONS_LIST): add space field in
    OPTIONS_LIST and make the list a list on pointers, to have the
    possibility to change the list size dynamically and have options
    references remain valid upon reallocation of the list.  Update
    callers, in particular get_converter_info_from_sv abd rename
    get_option_from_sv as new_option_from_sv.
---
 ChangeLog                                          |  30 +
 tp/Texinfo/XS/convert/convert_html.c               |  46 +-
 tp/Texinfo/XS/convert/converter.c                  |  40 --
 tp/Texinfo/XS/convert/converter.h                  |   3 -
 tp/Texinfo/XS/convert/converters_defaults.c        | 619 ++++++++++-----------
 tp/Texinfo/XS/convert/get_converter_perl_info.c    |  40 +-
 .../XS/convert/html_converter_init_options.c       |  16 +-
 tp/Texinfo/XS/convert/texinfo.c                    |  41 +-
 tp/Texinfo/XS/main/option_types.h                  |   3 +-
 tp/Texinfo/XS/main/utils.c                         | 114 +++-
 tp/Texinfo/XS/main/utils.h                         |   8 +
 tp/maintain/regenerate_C_options_info.pl           |   6 +-
 12 files changed, 520 insertions(+), 446 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c914e45d46..ede5ce0ae2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+2024-08-09  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/maintain/regenerate_C_options_info.pl,
+       tp/Texinfo/XS/convert/convert_html.c,
+       tp/Texinfo/XS/convert/converter.c,
+       tp/Texinfo/XS/convert/html_converter_init_options.c,
+       tp/Texinfo/XS/main/utils.c (option_set_conf_internal, option_set_conf)
+       (option_force_conf): move set_conf and force_conf to utils.c, rename
+       as option_set_conf and option_force_conf.
+
+       * tp/Texinfo/XS/convert/texinfo.c (txi_converter),
+       tp/Texinfo/XS/main/utils.c (new_option_string_value)
+       (add_option_string_value): rename initialize_option_value as
+       new_option_string_value and add_option_value as
+       add_option_string_value and move to utils.c.
+
+       * tp/Texinfo/XS/convert/get_converter_perl_info.c (new_option_from_sv)
+       (get_converter_info_from_sv),
+       tp/Texinfo/XS/convert/html_converter_init_options.c
+       (html_converter_defaults), tp/Texinfo/XS/convert/texinfo.c
+       (txi_converter), tp/Texinfo/XS/main/utils.c
+       (copy_options_list_options, new_option, new_option_string_value)
+       (add_option_string_value, free_options_list),
+       tp/Texinfo/XS/main/option_types.h (OPTIONS_LIST): add space field in
+       OPTIONS_LIST and make the list a list on pointers, to have the
+       possibility to change the list size dynamically and have options
+       references remain valid upon reallocation of the list.  Update
+       callers, in particular get_converter_info_from_sv abd rename
+       get_option_from_sv as new_option_from_sv.
+
 2024-08-09  Patrice Dumas  <pertusus@free.fr>
 
        * convert/converter.c (free_generic_converter): call
diff --git a/tp/Texinfo/XS/convert/convert_html.c 
b/tp/Texinfo/XS/convert/convert_html.c
index 6675068dc9..603fa1e454 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -18484,7 +18484,7 @@ close_lone_conf_element (OPTION *option)
       char *closed_lone_element = xhtml_re_close_lone_element (variable_value);
       if (strcmp (closed_lone_element, variable_value))
         {
-          force_conf (option, 0, closed_lone_element);
+          option_force_conf (option, 0, closed_lone_element);
         }
       free (closed_lone_element);
     }
@@ -18562,27 +18562,27 @@ html_initialize_output_state (CONVERTER *self, const 
char *context)
 
   if (!self->conf->OPEN_QUOTE_SYMBOL.o.string)
     {
-      int set = set_conf (&self->conf->OPEN_QUOTE_SYMBOL, 0,
-                          self->special_character[SC_left_quote].string);
+      int set = option_set_conf (&self->conf->OPEN_QUOTE_SYMBOL, 0,
+                                 
self->special_character[SC_left_quote].string);
       /* override undef set in init file/command line */
       if (!set)
-        force_conf (&self->conf->OPEN_QUOTE_SYMBOL, 0, "");
+        option_force_conf (&self->conf->OPEN_QUOTE_SYMBOL, 0, "");
     }
   if (!self->conf->CLOSE_QUOTE_SYMBOL.o.string)
     {
-      int set = set_conf (&self->conf->CLOSE_QUOTE_SYMBOL, 0,
-                          self->special_character[SC_right_quote].string);
+      int set = option_set_conf (&self->conf->CLOSE_QUOTE_SYMBOL, 0,
+                              self->special_character[SC_right_quote].string);
       /* override undef set in init file/command line */
       if (!set)
-        force_conf (&self->conf->CLOSE_QUOTE_SYMBOL, 0, "");
+        option_force_conf (&self->conf->CLOSE_QUOTE_SYMBOL, 0, "");
     }
   if (!self->conf->MENU_SYMBOL.o.string)
     {
-      int set = set_conf (&self->conf->MENU_SYMBOL, 0,
-                          self->special_character[SC_bullet].string);
+      int set = option_set_conf (&self->conf->MENU_SYMBOL, 0,
+                                 self->special_character[SC_bullet].string);
       /* override undef set in init file/command line */
       if (!set)
-        force_conf (&self->conf->MENU_SYMBOL, 0, "");
+        option_force_conf (&self->conf->MENU_SYMBOL, 0, "");
     }
 
   if (self->conf->USE_XML_SYNTAX.o.integer > 0)
@@ -18804,18 +18804,18 @@ html_initialize_output_state (CONVERTER *self, const 
char *context)
     (D_Last + self->special_unit_varieties.number+1) * sizeof (OUTPUT_UNIT));
 
   if (self->conf->NODE_NAME_IN_INDEX.o.integer < 0)
-    set_conf (&self->conf->NODE_NAME_IN_INDEX,
-              self->conf->USE_NODES.o.integer, 0);
+    option_set_conf (&self->conf->NODE_NAME_IN_INDEX,
+                     self->conf->USE_NODES.o.integer, 0);
 
   if (self->conf->HTML_MATH.o.string
       && self->conf->CONVERT_TO_LATEX_IN_MATH.o.integer < 0)
     {
-      set_conf (&self->conf->CONVERT_TO_LATEX_IN_MATH, 1, 0);
+      option_set_conf (&self->conf->CONVERT_TO_LATEX_IN_MATH, 1, 0);
     }
 
   if (self->conf->NO_TOP_NODE_OUTPUT.o.integer > 0
       && self->conf->SHOW_TITLE.o.integer < 0)
-    set_conf (&self->conf->SHOW_TITLE, 1, 0);
+    option_set_conf (&self->conf->SHOW_TITLE, 1, 0);
 
 
   self->current_formatting_references = &self->formatting_references[0];
@@ -19427,15 +19427,15 @@ html_setup_output (CONVERTER *self, char **paths)
         }
       if (need_unsplit)
         {
-          force_conf (&self->conf->SPLIT, 0, "");
-          force_conf (&self->conf->MONOLITHIC, 1, 0);
+          option_force_conf (&self->conf->SPLIT, 0, "");
+          option_force_conf (&self->conf->MONOLITHIC, 1, 0);
         }
     }
 
   if (self->conf->SPLIT.o.string && strlen (self->conf->SPLIT.o.string))
-    set_conf (&self->conf->NODE_FILES, 1, 0);
+    option_set_conf (&self->conf->NODE_FILES, 1, 0);
 
-  set_conf (&self->conf->EXTERNAL_CROSSREF_SPLIT, 0,
+  option_set_conf (&self->conf->EXTERNAL_CROSSREF_SPLIT, 0,
             self->conf->SPLIT.o.string);
 
   handler_fatal_error_level = self->conf->HANDLER_FATAL_ERROR_LEVEL.o.integer;
@@ -19443,8 +19443,8 @@ html_setup_output (CONVERTER *self, char **paths)
     {
       handler_fatal_error_level = 100;
       /* see options_data.txt. TODO automate? */
-      force_conf (&self->conf->HANDLER_FATAL_ERROR_LEVEL,
-                  handler_fatal_error_level, 0);
+      option_force_conf (&self->conf->HANDLER_FATAL_ERROR_LEVEL,
+                         handler_fatal_error_level, 0);
     }
 
   if (self->conf->HTML_MATH.o.string
@@ -19458,11 +19458,11 @@ html_setup_output (CONVERTER *self, char **paths)
      its preferred form of modification.
       */
        if (!self->conf->MATHJAX_SCRIPT.o.string)
-         set_conf (&self->conf->MATHJAX_SCRIPT, 0,
+         option_set_conf (&self->conf->MATHJAX_SCRIPT, 0,
             "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js";);
 
        if (!self->conf->MATHJAX_SOURCE.o.string)
-         set_conf (&self->conf->MATHJAX_SOURCE, 0,
+         option_set_conf (&self->conf->MATHJAX_SOURCE, 0,
  "http://docs.mathjax.org/en/latest/web/hosting.html#getting-mathjax-via-git";);
 
        if (!self->conf->MATHJAX_CONFIGURATION.o.string)
@@ -19501,7 +19501,7 @@ html_setup_output (CONVERTER *self, char **paths)
       char *body_element_attributes;
       xasprintf (&body_element_attributes, "lang=\"%s\"",
                  structure_preamble_document_language);
-      set_conf (&self->conf->BODY_ELEMENT_ATTRIBUTES,
+      option_set_conf (&self->conf->BODY_ELEMENT_ATTRIBUTES,
                 0, body_element_attributes);
       free (body_element_attributes);
     }
diff --git a/tp/Texinfo/XS/convert/converter.c 
b/tp/Texinfo/XS/convert/converter.c
index 3fd43ebd8f..fc1fb16b1e 100644
--- a/tp/Texinfo/XS/convert/converter.c
+++ b/tp/Texinfo/XS/convert/converter.c
@@ -392,46 +392,6 @@ converter_set_document (CONVERTER *converter, DOCUMENT 
*document)
 
 
 
-static void
-set_conf_internal (OPTION *option, int int_value, const char *char_value)
-{
-  switch (option->type)
-    {
-      case GOT_integer:
-        option->o.integer = int_value;
-        break;
-      case GOT_char:
-      case GOT_bytes:
-        free (option->o.string);
-        if (!char_value)
-          option->o.string = 0;
-        else
-          option->o.string = strdup (char_value);
-        break;
-
-      default:
-        fprintf (stderr, "BUG: set_conf type not handled: %d\n",
-                 option->type);
-    }
-}
-
-int
-set_conf (OPTION *option, int int_value, const char *char_value)
-{
-  if (option->configured > 0)
-    return 0;
-  set_conf_internal (option, int_value, char_value);
-  return 1;
-}
-
-void
-force_conf (OPTION *option, int int_value, const char *char_value)
-{
-  set_conf_internal (option, int_value, char_value);
-}
-
-
-
 /* result to be freed */
 static char *
 remove_extension (const char *input_string)
diff --git a/tp/Texinfo/XS/convert/converter.h 
b/tp/Texinfo/XS/convert/converter.h
index 9e9b9fc779..84445e18fe 100644
--- a/tp/Texinfo/XS/convert/converter.h
+++ b/tp/Texinfo/XS/convert/converter.h
@@ -142,9 +142,6 @@ void destroy_converter_initialization_info (
 
 void converter_set_document (CONVERTER *converter, DOCUMENT *document);
 
-int set_conf (OPTION *option, int int_value, const char *char_value);
-void force_conf (OPTION *option, int int_value, const char *char_value);
-
 void determine_files_and_directory (CONVERTER *self, const char *output_format,
                                     char **result);
 int create_destination_directory (CONVERTER *self,
diff --git a/tp/Texinfo/XS/convert/converters_defaults.c 
b/tp/Texinfo/XS/convert/converters_defaults.c
index 863ec1ab4a..c1dc927bb6 100644
--- a/tp/Texinfo/XS/convert/converters_defaults.c
+++ b/tp/Texinfo/XS/convert/converters_defaults.c
@@ -3,7 +3,7 @@
 #include <config.h>
 
 #include "options_types.h"
-#include "converter.h"
+#include "utils.h"
 #include "converters_defaults.h"
 
 
@@ -11,11 +11,11 @@
 
 void set_array_cmdline_regular_defaults (OPTIONS *options)
 {
-  set_conf (&options->CSS_FILES, -2, 0);
-  set_conf (&options->CSS_REFS, -2, 0);
-  set_conf (&options->EXPANDED_FORMATS, -2, 0);
-  set_conf (&options->INCLUDE_DIRECTORIES, -2, 0);
-  set_conf (&options->TEXINFO_LANGUAGE_DIRECTORIES, -2, 0);
+  option_set_conf (&options->CSS_FILES, -2, 0);
+  option_set_conf (&options->CSS_REFS, -2, 0);
+  option_set_conf (&options->EXPANDED_FORMATS, -2, 0);
+  option_set_conf (&options->INCLUDE_DIRECTORIES, -2, 0);
+  option_set_conf (&options->TEXINFO_LANGUAGE_DIRECTORIES, -2, 0);
 }
 
 
@@ -23,18 +23,18 @@ void set_array_cmdline_regular_defaults (OPTIONS *options)
 
 void set_converter_cmdline_regular_defaults (OPTIONS *options)
 {
-  set_conf (&options->SPLIT_SIZE, 300000, 0);
-  set_conf (&options->FILLCOLUMN, 72, 0);
-  set_conf (&options->NUMBER_SECTIONS, 1, 0);
-  set_conf (&options->NUMBER_FOOTNOTES, 1, 0);
-  set_conf (&options->TRANSLITERATE_FILE_NAMES, 1, 0);
-  set_conf (&options->SPLIT, -2, 0);
-  set_conf (&options->HEADERS, 1, 0);
-  set_conf (&options->NODE_FILES, -1, 0);
-  set_conf (&options->VERBOSE, -1, 0);
-  set_conf (&options->OUTFILE, -2, 0);
-  set_conf (&options->SUBDIR, -2, 0);
-  set_conf (&options->ENABLE_ENCODING, 1, 0);
+  option_set_conf (&options->SPLIT_SIZE, 300000, 0);
+  option_set_conf (&options->FILLCOLUMN, 72, 0);
+  option_set_conf (&options->NUMBER_SECTIONS, 1, 0);
+  option_set_conf (&options->NUMBER_FOOTNOTES, 1, 0);
+  option_set_conf (&options->TRANSLITERATE_FILE_NAMES, 1, 0);
+  option_set_conf (&options->SPLIT, -2, 0);
+  option_set_conf (&options->HEADERS, 1, 0);
+  option_set_conf (&options->NODE_FILES, -1, 0);
+  option_set_conf (&options->VERBOSE, -1, 0);
+  option_set_conf (&options->OUTFILE, -2, 0);
+  option_set_conf (&options->SUBDIR, -2, 0);
+  option_set_conf (&options->ENABLE_ENCODING, 1, 0);
 }
 
 
@@ -42,146 +42,145 @@ void set_converter_cmdline_regular_defaults (OPTIONS 
*options)
 
 void set_converter_customization_regular_defaults (OPTIONS *options)
 {
-  set_conf (&options->TOP_NODE_UP, -2, "(dir)");
-  set_conf (&options->BASEFILENAME_LENGTH, 255-10, 0);
-  set_conf (&options->DOC_ENCODING_FOR_INPUT_FILE_NAME, 1, 0);
-  set_conf (&options->DOC_ENCODING_FOR_OUTPUT_FILE_NAME, 0, 0);
-  set_conf (&options->IMAGE_LINK_PREFIX, -2, 0);
-  set_conf (&options->CASE_INSENSITIVE_FILENAMES, 0, 0);
-  set_conf (&options->DEBUG, 0, 0);
-  set_conf (&options->HANDLER_FATAL_ERROR_LEVEL, 100, 0);
-  set_conf (&options->TEST, 0, 0);
-  set_conf (&options->TEXTCONTENT_COMMENT, -1, 0);
-  set_conf (&options->TEXINFO_DTD_VERSION, -2, "7.1");
-  set_conf (&options->USE_UNICODE_COLLATION, 1, 0);
-  set_conf (&options->AFTER_BODY_OPEN, -2, 0);
-  set_conf (&options->AFTER_SHORT_TOC_LINES, -2, 0);
-  set_conf (&options->AFTER_TOC_LINES, -2, 0);
-  set_conf (&options->ASCII_DASHES_AND_QUOTES, -1, 0);
-  set_conf (&options->ASCII_GLYPH, -1, 0);
-  set_conf (&options->ASCII_PUNCTUATION, -1, 0);
-  set_conf (&options->AUTO_MENU_DESCRIPTION_ALIGN_COLUMN, -1, 0);
-  set_conf (&options->AUTO_MENU_MAX_WIDTH, -1, 0);
-  set_conf (&options->BEFORE_SHORT_TOC_LINES, -2, 0);
-  set_conf (&options->BEFORE_TOC_LINES, -2, 0);
-  set_conf (&options->BIG_RULE, -2, 0);
-  set_conf (&options->BODY_ELEMENT_ATTRIBUTES, -2, 0);
-  set_conf (&options->CLASS_BEGIN_USEPACKAGE, -2, 0);
-  set_conf (&options->COPIABLE_LINKS, -1, 0);
-  set_conf (&options->CHAPTER_HEADER_LEVEL, -1, 0);
-  set_conf (&options->CHECK_HTMLXREF, -1, 0);
-  set_conf (&options->CLOSE_DOUBLE_QUOTE_SYMBOL, -2, 0);
-  set_conf (&options->CLOSE_QUOTE_SYMBOL, -2, 0);
-  set_conf (&options->COLLATION_LANGUAGE, -2, 0);
-  set_conf (&options->COMMAND_LINE_ENCODING, -2, 0);
-  set_conf (&options->INDENTED_BLOCK_COMMANDS_IN_TABLE, -1, 0);
-  set_conf (&options->CONTENTS_OUTPUT_LOCATION, -2, 0);
-  set_conf (&options->CONVERT_TO_LATEX_IN_MATH, -1, 0);
-  set_conf (&options->DATE_IN_HEADER, -1, 0);
-  set_conf (&options->DEFAULT_RULE, -2, 0);
-  set_conf (&options->DEF_TABLE, -1, 0);
-  set_conf (&options->DO_ABOUT, -1, 0);
-  set_conf (&options->DOCTYPE, -2, 0);
-  set_conf (&options->DOCUMENTLANGUAGE_COLLATION, -1, 0);
-  set_conf (&options->END_USEPACKAGE, -2, 0);
-  set_conf (&options->EPUB_CREATE_CONTAINER_FILE, -1, 0);
-  set_conf (&options->EPUB_KEEP_CONTAINER_FOLDER, -1, 0);
-  set_conf (&options->EXTENSION, -2, 0);
-  set_conf (&options->EXTERNAL_CROSSREF_EXTENSION, -2, 0);
-  set_conf (&options->EXTERNAL_CROSSREF_SPLIT, -2, 0);
-  set_conf (&options->EXTERNAL_DIR, -2, 0);
-  set_conf (&options->EXTRA_HEAD, -2, 0);
-  set_conf (&options->FOOTNOTE_END_HEADER_LEVEL, -1, 0);
-  set_conf (&options->FOOTNOTE_SEPARATE_HEADER_LEVEL, -1, 0);
-  set_conf (&options->HEADER_IN_TABLE, -1, 0);
-  set_conf (&options->HIGHLIGHT_SYNTAX, -2, 0);
-  set_conf (&options->HIGHLIGHT_SYNTAX_DEFAULT_LANGUAGE, -2, 0);
-  set_conf (&options->HTML_MATH, -2, 0);
-  set_conf (&options->HTML_ROOT_ELEMENT_ATTRIBUTES, -2, 0);
-  set_conf (&options->HTMLXREF_FILE, -2, 0);
-  set_conf (&options->HTMLXREF_MODE, -2, 0);
-  set_conf (&options->ICONS, -1, 0);
-  set_conf (&options->INDEX_ENTRY_COLON, -2, 0);
-  set_conf (&options->INDEX_SPECIAL_CHARS_WARNING, -1, 0);
-  set_conf (&options->INFO_JS_DIR, -2, 0);
-  set_conf (&options->INFO_SPECIAL_CHARS_QUOTE, -2, 0);
-  set_conf (&options->INFO_SPECIAL_CHARS_WARNING, -1, 0);
-  set_conf (&options->IGNORE_REF_TO_TOP_NODE_UP, -1, 0);
-  set_conf (&options->INLINE_CSS_STYLE, -1, 0);
-  set_conf (&options->INPUT_FILE_NAME_ENCODING, -2, 0);
-  set_conf (&options->JS_WEBLABELS, -2, 0);
-  set_conf (&options->JS_WEBLABELS_FILE, -2, 0);
-  set_conf (&options->LATEX_FLOATS_FILE_EXTENSION, -2, "tfl");
-  set_conf (&options->LOCALE_ENCODING, -2, 0);
-  set_conf (&options->L2H_CLEAN, -1, 0);
-  set_conf (&options->L2H_FILE, -2, 0);
-  set_conf (&options->L2H_HTML_VERSION, -2, 0);
-  set_conf (&options->L2H_L2H, -2, 0);
-  set_conf (&options->L2H_SKIP, -1, 0);
-  set_conf (&options->L2H_TMP, -2, 0);
-  set_conf (&options->MATHJAX_CONFIGURATION, -2, 0);
-  set_conf (&options->MATHJAX_SCRIPT, -2, 0);
-  set_conf (&options->MATHJAX_SOURCE, -2, 0);
-  set_conf (&options->MAX_HEADER_LEVEL, -1, 0);
-  set_conf (&options->MENU_ENTRY_COLON, -2, 0);
-  set_conf (&options->MENU_SYMBOL, -2, 0);
-  set_conf (&options->MESSAGE_ENCODING, -2, 0);
-  set_conf (&options->MONOLITHIC, -1, 0);
-  set_conf (&options->NO_CSS, -1, 0);
-  set_conf (&options->NO_NUMBER_FOOTNOTE_SYMBOL, -2, 0);
-  set_conf (&options->NO_CUSTOM_HTML_ATTRIBUTE, -1, 0);
-  set_conf (&options->NODE_NAME_IN_INDEX, -1, 0);
-  set_conf (&options->NODE_NAME_IN_MENU, -1, 0);
-  set_conf (&options->NO_TOP_NODE_OUTPUT, -1, 0);
-  set_conf (&options->OPEN_DOUBLE_QUOTE_SYMBOL, -2, 0);
-  set_conf (&options->OPEN_QUOTE_SYMBOL, -2, 0);
-  set_conf (&options->OUTPUT_CHARACTERS, -1, 0);
-  set_conf (&options->OUTPUT_ENCODING_NAME, -2, 0);
-  set_conf (&options->OUTPUT_FILE_NAME_ENCODING, -2, 0);
-  set_conf (&options->OUTPUT_PERL_ENCODING, -2, 0);
-  set_conf (&options->PACKAGE, -2, 0);
-  set_conf (&options->PACKAGE_AND_VERSION, -2, 0);
-  set_conf (&options->PACKAGE_NAME, -2, 0);
-  set_conf (&options->PACKAGE_URL, -2, 0);
-  set_conf (&options->PACKAGE_VERSION, -2, 0);
-  set_conf (&options->PRE_BODY_CLOSE, -2, 0);
-  set_conf (&options->PREFIX, -2, 0);
-  set_conf (&options->PROGRAM, -2, 0);
-  set_conf (&options->PROGRAM_NAME_IN_ABOUT, -1, 0);
-  set_conf (&options->PROGRAM_NAME_IN_FOOTER, -1, 0);
-  set_conf (&options->SECTION_NAME_IN_TITLE, -1, 0);
-  set_conf (&options->SHORT_TOC_LINK_TO_TOC, -1, 0);
-  set_conf (&options->SHOW_TITLE, -1, 0);
-  set_conf (&options->T4H_LATEX_CONVERSION, -2, 0);
-  set_conf (&options->T4H_MATH_CONVERSION, -2, 0);
-  set_conf (&options->T4H_TEX_CONVERSION, -2, 0);
-  set_conf (&options->TEXI2HTML, -1, 0);
-  set_conf (&options->TEXINFO_OUTPUT_FORMAT, -2, 0);
-  set_conf (&options->TXI_MARKUP_NO_SECTION_EXTENT, -1, 0);
-  set_conf (&options->TOC_LINKS, -1, 0);
-  set_conf (&options->TOP_FILE, -2, 0);
-  set_conf (&options->TOP_NODE_FILE_TARGET, -2, 0);
-  set_conf (&options->TOP_NODE_UP_URL, -2, 0);
-  set_conf (&options->USE_ACCESSKEY, -1, 0);
-  set_conf (&options->USE_ISO, -1, 0);
-  set_conf (&options->USE_LINKS, -1, 0);
-  set_conf (&options->USE_NEXT_HEADING_FOR_LONE_NODE, -1, 0);
-  set_conf (&options->USE_NODES, -1, 0);
-  set_conf (&options->USE_NODE_DIRECTIONS, -1, 0);
-  set_conf (&options->USE_NUMERIC_ENTITY, -1, 0);
-  set_conf (&options->USE_REL_REV, -1, 0);
-  set_conf (&options->USE_SETFILENAME_EXTENSION, -1, 0);
-  set_conf (&options->USE_TITLEPAGE_FOR_TITLE, -1, 0);
-  set_conf (&options->USE_UNIDECODE, -1, 0);
-  set_conf (&options->USE_XML_SYNTAX, -1, 0);
-  set_conf (&options->VERTICAL_HEAD_NAVIGATION, -1, 0);
-  set_conf (&options->WORDS_IN_PAGE, -1, 0);
-  set_conf (&options->XREF_USE_FLOAT_LABEL, -1, 0);
-  set_conf (&options->XREF_USE_NODE_NAME_ARG, -1, 0);
-  set_conf (&options->XS_EXTERNAL_CONVERSION, -1, 0);
-  set_conf (&options->XS_EXTERNAL_FORMATTING, -1, 0);
-  set_conf (&options->XS_STRXFRM_COLLATION_LOCALE, -2, 0);
-  set_conf (&options->_INLINE_STYLE_WIDTH, -1, 0);
+  option_set_conf (&options->TOP_NODE_UP, -2, "(dir)");
+  option_set_conf (&options->BASEFILENAME_LENGTH, 255-10, 0);
+  option_set_conf (&options->DOC_ENCODING_FOR_INPUT_FILE_NAME, 1, 0);
+  option_set_conf (&options->DOC_ENCODING_FOR_OUTPUT_FILE_NAME, 0, 0);
+  option_set_conf (&options->IMAGE_LINK_PREFIX, -2, 0);
+  option_set_conf (&options->CASE_INSENSITIVE_FILENAMES, 0, 0);
+  option_set_conf (&options->DEBUG, 0, 0);
+  option_set_conf (&options->HANDLER_FATAL_ERROR_LEVEL, 100, 0);
+  option_set_conf (&options->TEST, 0, 0);
+  option_set_conf (&options->TEXTCONTENT_COMMENT, -1, 0);
+  option_set_conf (&options->TEXINFO_DTD_VERSION, -2, "7.1");
+  option_set_conf (&options->USE_UNICODE_COLLATION, 1, 0);
+  option_set_conf (&options->AFTER_BODY_OPEN, -2, 0);
+  option_set_conf (&options->AFTER_SHORT_TOC_LINES, -2, 0);
+  option_set_conf (&options->AFTER_TOC_LINES, -2, 0);
+  option_set_conf (&options->ASCII_DASHES_AND_QUOTES, -1, 0);
+  option_set_conf (&options->ASCII_GLYPH, -1, 0);
+  option_set_conf (&options->ASCII_PUNCTUATION, -1, 0);
+  option_set_conf (&options->AUTO_MENU_DESCRIPTION_ALIGN_COLUMN, -1, 0);
+  option_set_conf (&options->AUTO_MENU_MAX_WIDTH, -1, 0);
+  option_set_conf (&options->BEFORE_SHORT_TOC_LINES, -2, 0);
+  option_set_conf (&options->BEFORE_TOC_LINES, -2, 0);
+  option_set_conf (&options->BIG_RULE, -2, 0);
+  option_set_conf (&options->BODY_ELEMENT_ATTRIBUTES, -2, 0);
+  option_set_conf (&options->CLASS_BEGIN_USEPACKAGE, -2, 0);
+  option_set_conf (&options->COPIABLE_LINKS, -1, 0);
+  option_set_conf (&options->CHAPTER_HEADER_LEVEL, -1, 0);
+  option_set_conf (&options->CHECK_HTMLXREF, -1, 0);
+  option_set_conf (&options->CLOSE_DOUBLE_QUOTE_SYMBOL, -2, 0);
+  option_set_conf (&options->CLOSE_QUOTE_SYMBOL, -2, 0);
+  option_set_conf (&options->COLLATION_LANGUAGE, -2, 0);
+  option_set_conf (&options->COMMAND_LINE_ENCODING, -2, 0);
+  option_set_conf (&options->INDENTED_BLOCK_COMMANDS_IN_TABLE, -1, 0);
+  option_set_conf (&options->CONTENTS_OUTPUT_LOCATION, -2, 0);
+  option_set_conf (&options->CONVERT_TO_LATEX_IN_MATH, -1, 0);
+  option_set_conf (&options->DATE_IN_HEADER, -1, 0);
+  option_set_conf (&options->DEFAULT_RULE, -2, 0);
+  option_set_conf (&options->DEF_TABLE, -1, 0);
+  option_set_conf (&options->DO_ABOUT, -1, 0);
+  option_set_conf (&options->DOCTYPE, -2, 0);
+  option_set_conf (&options->DOCUMENTLANGUAGE_COLLATION, -1, 0);
+  option_set_conf (&options->END_USEPACKAGE, -2, 0);
+  option_set_conf (&options->EPUB_CREATE_CONTAINER_FILE, -1, 0);
+  option_set_conf (&options->EPUB_KEEP_CONTAINER_FOLDER, -1, 0);
+  option_set_conf (&options->EXTENSION, -2, 0);
+  option_set_conf (&options->EXTERNAL_CROSSREF_EXTENSION, -2, 0);
+  option_set_conf (&options->EXTERNAL_CROSSREF_SPLIT, -2, 0);
+  option_set_conf (&options->EXTERNAL_DIR, -2, 0);
+  option_set_conf (&options->EXTRA_HEAD, -2, 0);
+  option_set_conf (&options->FOOTNOTE_END_HEADER_LEVEL, -1, 0);
+  option_set_conf (&options->FOOTNOTE_SEPARATE_HEADER_LEVEL, -1, 0);
+  option_set_conf (&options->HEADER_IN_TABLE, -1, 0);
+  option_set_conf (&options->HIGHLIGHT_SYNTAX, -2, 0);
+  option_set_conf (&options->HIGHLIGHT_SYNTAX_DEFAULT_LANGUAGE, -2, 0);
+  option_set_conf (&options->HTML_MATH, -2, 0);
+  option_set_conf (&options->HTML_ROOT_ELEMENT_ATTRIBUTES, -2, 0);
+  option_set_conf (&options->HTMLXREF_FILE, -2, 0);
+  option_set_conf (&options->HTMLXREF_MODE, -2, 0);
+  option_set_conf (&options->ICONS, -1, 0);
+  option_set_conf (&options->INDEX_ENTRY_COLON, -2, 0);
+  option_set_conf (&options->INDEX_SPECIAL_CHARS_WARNING, -1, 0);
+  option_set_conf (&options->INFO_JS_DIR, -2, 0);
+  option_set_conf (&options->INFO_SPECIAL_CHARS_QUOTE, -2, 0);
+  option_set_conf (&options->INFO_SPECIAL_CHARS_WARNING, -1, 0);
+  option_set_conf (&options->IGNORE_REF_TO_TOP_NODE_UP, -1, 0);
+  option_set_conf (&options->INLINE_CSS_STYLE, -1, 0);
+  option_set_conf (&options->INPUT_FILE_NAME_ENCODING, -2, 0);
+  option_set_conf (&options->JS_WEBLABELS, -2, 0);
+  option_set_conf (&options->JS_WEBLABELS_FILE, -2, 0);
+  option_set_conf (&options->LATEX_FLOATS_FILE_EXTENSION, -2, "tfl");
+  option_set_conf (&options->LOCALE_ENCODING, -2, 0);
+  option_set_conf (&options->L2H_CLEAN, -1, 0);
+  option_set_conf (&options->L2H_FILE, -2, 0);
+  option_set_conf (&options->L2H_HTML_VERSION, -2, 0);
+  option_set_conf (&options->L2H_L2H, -2, 0);
+  option_set_conf (&options->L2H_SKIP, -1, 0);
+  option_set_conf (&options->L2H_TMP, -2, 0);
+  option_set_conf (&options->MATHJAX_SCRIPT, -2, 0);
+  option_set_conf (&options->MATHJAX_SOURCE, -2, 0);
+  option_set_conf (&options->MAX_HEADER_LEVEL, -1, 0);
+  option_set_conf (&options->MENU_ENTRY_COLON, -2, 0);
+  option_set_conf (&options->MENU_SYMBOL, -2, 0);
+  option_set_conf (&options->MESSAGE_ENCODING, -2, 0);
+  option_set_conf (&options->MONOLITHIC, -1, 0);
+  option_set_conf (&options->NO_CSS, -1, 0);
+  option_set_conf (&options->NO_NUMBER_FOOTNOTE_SYMBOL, -2, 0);
+  option_set_conf (&options->NO_CUSTOM_HTML_ATTRIBUTE, -1, 0);
+  option_set_conf (&options->NODE_NAME_IN_INDEX, -1, 0);
+  option_set_conf (&options->NODE_NAME_IN_MENU, -1, 0);
+  option_set_conf (&options->NO_TOP_NODE_OUTPUT, -1, 0);
+  option_set_conf (&options->OPEN_DOUBLE_QUOTE_SYMBOL, -2, 0);
+  option_set_conf (&options->OPEN_QUOTE_SYMBOL, -2, 0);
+  option_set_conf (&options->OUTPUT_CHARACTERS, -1, 0);
+  option_set_conf (&options->OUTPUT_ENCODING_NAME, -2, 0);
+  option_set_conf (&options->OUTPUT_FILE_NAME_ENCODING, -2, 0);
+  option_set_conf (&options->OUTPUT_PERL_ENCODING, -2, 0);
+  option_set_conf (&options->PACKAGE, -2, 0);
+  option_set_conf (&options->PACKAGE_AND_VERSION, -2, 0);
+  option_set_conf (&options->PACKAGE_NAME, -2, 0);
+  option_set_conf (&options->PACKAGE_URL, -2, 0);
+  option_set_conf (&options->PACKAGE_VERSION, -2, 0);
+  option_set_conf (&options->PRE_BODY_CLOSE, -2, 0);
+  option_set_conf (&options->PREFIX, -2, 0);
+  option_set_conf (&options->PROGRAM, -2, 0);
+  option_set_conf (&options->PROGRAM_NAME_IN_ABOUT, -1, 0);
+  option_set_conf (&options->PROGRAM_NAME_IN_FOOTER, -1, 0);
+  option_set_conf (&options->SECTION_NAME_IN_TITLE, -1, 0);
+  option_set_conf (&options->SHORT_TOC_LINK_TO_TOC, -1, 0);
+  option_set_conf (&options->SHOW_TITLE, -1, 0);
+  option_set_conf (&options->T4H_LATEX_CONVERSION, -2, 0);
+  option_set_conf (&options->T4H_MATH_CONVERSION, -2, 0);
+  option_set_conf (&options->T4H_TEX_CONVERSION, -2, 0);
+  option_set_conf (&options->TEXI2HTML, -1, 0);
+  option_set_conf (&options->TEXINFO_OUTPUT_FORMAT, -2, 0);
+  option_set_conf (&options->TXI_MARKUP_NO_SECTION_EXTENT, -1, 0);
+  option_set_conf (&options->TOC_LINKS, -1, 0);
+  option_set_conf (&options->TOP_FILE, -2, 0);
+  option_set_conf (&options->TOP_NODE_FILE_TARGET, -2, 0);
+  option_set_conf (&options->TOP_NODE_UP_URL, -2, 0);
+  option_set_conf (&options->USE_ACCESSKEY, -1, 0);
+  option_set_conf (&options->USE_ISO, -1, 0);
+  option_set_conf (&options->USE_LINKS, -1, 0);
+  option_set_conf (&options->USE_NEXT_HEADING_FOR_LONE_NODE, -1, 0);
+  option_set_conf (&options->USE_NODES, -1, 0);
+  option_set_conf (&options->USE_NODE_DIRECTIONS, -1, 0);
+  option_set_conf (&options->USE_NUMERIC_ENTITY, -1, 0);
+  option_set_conf (&options->USE_REL_REV, -1, 0);
+  option_set_conf (&options->USE_SETFILENAME_EXTENSION, -1, 0);
+  option_set_conf (&options->USE_TITLEPAGE_FOR_TITLE, -1, 0);
+  option_set_conf (&options->USE_UNIDECODE, -1, 0);
+  option_set_conf (&options->USE_XML_SYNTAX, -1, 0);
+  option_set_conf (&options->VERTICAL_HEAD_NAVIGATION, -1, 0);
+  option_set_conf (&options->WORDS_IN_PAGE, -1, 0);
+  option_set_conf (&options->XREF_USE_FLOAT_LABEL, -1, 0);
+  option_set_conf (&options->XREF_USE_NODE_NAME_ARG, -1, 0);
+  option_set_conf (&options->XS_EXTERNAL_CONVERSION, -1, 0);
+  option_set_conf (&options->XS_EXTERNAL_FORMATTING, -1, 0);
+  option_set_conf (&options->XS_STRXFRM_COLLATION_LOCALE, -2, 0);
+  option_set_conf (&options->_INLINE_STYLE_WIDTH, -1, 0);
 }
 
 
@@ -189,17 +188,17 @@ void set_converter_customization_regular_defaults 
(OPTIONS *options)
 
 void set_converter_other_regular_defaults (OPTIONS *options)
 {
-  set_conf (&options->LINKS_BUTTONS, -2, 0);
-  set_conf (&options->TOP_BUTTONS, -2, 0);
-  set_conf (&options->TOP_FOOTER_BUTTONS, -2, 0);
-  set_conf (&options->SECTION_BUTTONS, -2, 0);
-  set_conf (&options->CHAPTER_FOOTER_BUTTONS, -2, 0);
-  set_conf (&options->SECTION_FOOTER_BUTTONS, -2, 0);
-  set_conf (&options->NODE_FOOTER_BUTTONS, -2, 0);
-  set_conf (&options->MISC_BUTTONS, -2, 0);
-  set_conf (&options->CHAPTER_BUTTONS, -2, 0);
-  set_conf (&options->ACTIVE_ICONS, -2, 0);
-  set_conf (&options->PASSIVE_ICONS, -2, 0);
+  option_set_conf (&options->LINKS_BUTTONS, -2, 0);
+  option_set_conf (&options->TOP_BUTTONS, -2, 0);
+  option_set_conf (&options->TOP_FOOTER_BUTTONS, -2, 0);
+  option_set_conf (&options->SECTION_BUTTONS, -2, 0);
+  option_set_conf (&options->CHAPTER_FOOTER_BUTTONS, -2, 0);
+  option_set_conf (&options->SECTION_FOOTER_BUTTONS, -2, 0);
+  option_set_conf (&options->NODE_FOOTER_BUTTONS, -2, 0);
+  option_set_conf (&options->MISC_BUTTONS, -2, 0);
+  option_set_conf (&options->CHAPTER_BUTTONS, -2, 0);
+  option_set_conf (&options->ACTIVE_ICONS, -2, 0);
+  option_set_conf (&options->PASSIVE_ICONS, -2, 0);
 }
 
 
@@ -207,31 +206,31 @@ void set_converter_other_regular_defaults (OPTIONS 
*options)
 
 void set_multiple_at_command_regular_defaults (OPTIONS *options)
 {
-  set_conf (&options->allowcodebreaks, -2, "true");
-  set_conf (&options->clickstyle, -2, "@arrow");
-  set_conf (&options->codequotebacktick, -2, "off");
-  set_conf (&options->codequoteundirected, -2, "off");
-  set_conf (&options->contents, 0, 0);
-  set_conf (&options->deftypefnnewline, -2, "off");
-  set_conf (&options->documentencoding, -2, "utf-8");
-  set_conf (&options->documentlanguage, -2, 0);
-  set_conf (&options->evenfooting, -2, 0);
-  set_conf (&options->evenheading, -2, 0);
-  set_conf (&options->everyfooting, -2, 0);
-  set_conf (&options->everyheading, -2, 0);
-  set_conf (&options->exampleindent, -2, "5");
-  set_conf (&options->firstparagraphindent, -2, "none");
-  set_conf (&options->frenchspacing, -2, "off");
-  set_conf (&options->headings, -2, "on");
-  set_conf (&options->kbdinputstyle, -2, "distinct");
-  set_conf (&options->microtype, -2, 0);
-  set_conf (&options->oddheading, -2, 0);
-  set_conf (&options->oddfooting, -2, 0);
-  set_conf (&options->paragraphindent, -2, "3");
-  set_conf (&options->shortcontents, 0, 0);
-  set_conf (&options->summarycontents, 0, 0);
-  set_conf (&options->urefbreakstyle, -2, "after");
-  set_conf (&options->xrefautomaticsectiontitle, -2, "off");
+  option_set_conf (&options->allowcodebreaks, -2, "true");
+  option_set_conf (&options->clickstyle, -2, "@arrow");
+  option_set_conf (&options->codequotebacktick, -2, "off");
+  option_set_conf (&options->codequoteundirected, -2, "off");
+  option_set_conf (&options->contents, 0, 0);
+  option_set_conf (&options->deftypefnnewline, -2, "off");
+  option_set_conf (&options->documentencoding, -2, "utf-8");
+  option_set_conf (&options->documentlanguage, -2, 0);
+  option_set_conf (&options->evenfooting, -2, 0);
+  option_set_conf (&options->evenheading, -2, 0);
+  option_set_conf (&options->everyfooting, -2, 0);
+  option_set_conf (&options->everyheading, -2, 0);
+  option_set_conf (&options->exampleindent, -2, "5");
+  option_set_conf (&options->firstparagraphindent, -2, "none");
+  option_set_conf (&options->frenchspacing, -2, "off");
+  option_set_conf (&options->headings, -2, "on");
+  option_set_conf (&options->kbdinputstyle, -2, "distinct");
+  option_set_conf (&options->microtype, -2, 0);
+  option_set_conf (&options->oddheading, -2, 0);
+  option_set_conf (&options->oddfooting, -2, 0);
+  option_set_conf (&options->paragraphindent, -2, "3");
+  option_set_conf (&options->shortcontents, 0, 0);
+  option_set_conf (&options->summarycontents, 0, 0);
+  option_set_conf (&options->urefbreakstyle, -2, "after");
+  option_set_conf (&options->xrefautomaticsectiontitle, -2, "off");
 }
 
 
@@ -239,14 +238,14 @@ void set_multiple_at_command_regular_defaults (OPTIONS 
*options)
 
 void set_program_cmdline_regular_defaults (OPTIONS *options)
 {
-  set_conf (&options->MACRO_EXPAND, -2, 0);
-  set_conf (&options->INTERNAL_LINKS, -2, 0);
-  set_conf (&options->ERROR_LIMIT, 100, 0);
-  set_conf (&options->FORCE, -1, 0);
-  set_conf (&options->NO_WARN, -1, 0);
-  set_conf (&options->SILENT, -2, 0);
-  set_conf (&options->TRACE_INCLUDES, 0, 0);
-  set_conf (&options->FORMAT_MENU, -2, "menu");
+  option_set_conf (&options->MACRO_EXPAND, -2, 0);
+  option_set_conf (&options->INTERNAL_LINKS, -2, 0);
+  option_set_conf (&options->ERROR_LIMIT, 100, 0);
+  option_set_conf (&options->FORCE, -1, 0);
+  option_set_conf (&options->NO_WARN, -1, 0);
+  option_set_conf (&options->SILENT, -2, 0);
+  option_set_conf (&options->TRACE_INCLUDES, 0, 0);
+  option_set_conf (&options->FORMAT_MENU, -2, "menu");
 }
 
 
@@ -254,15 +253,15 @@ void set_program_cmdline_regular_defaults (OPTIONS 
*options)
 
 void set_program_customization_regular_defaults (OPTIONS *options)
 {
-  set_conf (&options->CHECK_NORMAL_MENU_STRUCTURE, 1, 0);
-  set_conf (&options->CHECK_MISSING_MENU_ENTRY, 1, 0);
-  set_conf (&options->DUMP_TREE, -1, 0);
-  set_conf (&options->DUMP_TEXI, -1, 0);
-  set_conf (&options->SHOW_BUILTIN_CSS_RULES, 0, 0);
-  set_conf (&options->SORT_ELEMENT_COUNT, -2, 0);
-  set_conf (&options->SORT_ELEMENT_COUNT_WORDS, -1, 0);
-  set_conf (&options->TEXI2DVI, -2, "texi2dvi");
-  set_conf (&options->TREE_TRANSFORMATIONS, -2, 0);
+  option_set_conf (&options->CHECK_NORMAL_MENU_STRUCTURE, 1, 0);
+  option_set_conf (&options->CHECK_MISSING_MENU_ENTRY, 1, 0);
+  option_set_conf (&options->DUMP_TREE, -1, 0);
+  option_set_conf (&options->DUMP_TEXI, -1, 0);
+  option_set_conf (&options->SHOW_BUILTIN_CSS_RULES, 0, 0);
+  option_set_conf (&options->SORT_ELEMENT_COUNT, -2, 0);
+  option_set_conf (&options->SORT_ELEMENT_COUNT_WORDS, -1, 0);
+  option_set_conf (&options->TEXI2DVI, -2, "texi2dvi");
+  option_set_conf (&options->TREE_TRANSFORMATIONS, -2, 0);
 }
 
 
@@ -270,120 +269,120 @@ void set_program_customization_regular_defaults 
(OPTIONS *options)
 
 void set_unique_at_command_regular_defaults (OPTIONS *options)
 {
-  set_conf (&options->afivepaper, -2, 0);
-  set_conf (&options->afourpaper, -2, 0);
-  set_conf (&options->afourlatex, -2, 0);
-  set_conf (&options->afourwide, -2, 0);
-  set_conf (&options->bsixpaper, -2, 0);
-  set_conf (&options->documentdescription, -2, 0);
-  set_conf (&options->evenfootingmarks, -2, 0);
-  set_conf (&options->evenheadingmarks, -2, 0);
-  set_conf (&options->everyfootingmarks, -2, "bottom");
-  set_conf (&options->everyheadingmarks, -2, "bottom");
-  set_conf (&options->fonttextsize, 11, 0);
-  set_conf (&options->footnotestyle, -2, "end");
-  set_conf (&options->novalidate, 0, 0);
-  set_conf (&options->oddfootingmarks, -2, 0);
-  set_conf (&options->oddheadingmarks, -2, 0);
-  set_conf (&options->pagesizes, -2, 0);
-  set_conf (&options->setchapternewpage, -2, "on");
-  set_conf (&options->setfilename, -2, 0);
-  set_conf (&options->smallbook, -2, 0);
+  option_set_conf (&options->afivepaper, -2, 0);
+  option_set_conf (&options->afourpaper, -2, 0);
+  option_set_conf (&options->afourlatex, -2, 0);
+  option_set_conf (&options->afourwide, -2, 0);
+  option_set_conf (&options->bsixpaper, -2, 0);
+  option_set_conf (&options->documentdescription, -2, 0);
+  option_set_conf (&options->evenfootingmarks, -2, 0);
+  option_set_conf (&options->evenheadingmarks, -2, 0);
+  option_set_conf (&options->everyfootingmarks, -2, "bottom");
+  option_set_conf (&options->everyheadingmarks, -2, "bottom");
+  option_set_conf (&options->fonttextsize, 11, 0);
+  option_set_conf (&options->footnotestyle, -2, "end");
+  option_set_conf (&options->novalidate, 0, 0);
+  option_set_conf (&options->oddfootingmarks, -2, 0);
+  option_set_conf (&options->oddheadingmarks, -2, 0);
+  option_set_conf (&options->pagesizes, -2, 0);
+  option_set_conf (&options->setchapternewpage, -2, "on");
+  option_set_conf (&options->setfilename, -2, 0);
+  option_set_conf (&options->smallbook, -2, 0);
 }
 
 void set_common_regular_options_defaults (OPTIONS *options)
 {
-  set_conf (&options->PACKAGE_AND_VERSION, -2, "texinfo");
-  set_conf (&options->PACKAGE_VERSION, -2, "");
-  set_conf (&options->PACKAGE_URL, -2, "http://www.gnu.org/software/texinfo/";);
-  set_conf (&options->PROGRAM, -2, "");
+  option_set_conf (&options->PACKAGE_AND_VERSION, -2, "texinfo");
+  option_set_conf (&options->PACKAGE_VERSION, -2, "");
+  option_set_conf (&options->PACKAGE_URL, -2, 
"http://www.gnu.org/software/texinfo/";);
+  option_set_conf (&options->PROGRAM, -2, "");
 }
 
 void set_converter_regular_options_defaults (OPTIONS *options)
 {
-  set_conf (&options->documentlanguage, -2, 0);
+  option_set_conf (&options->documentlanguage, -2, 0);
 }
 
 void set_html_regular_options_defaults (OPTIONS *options)
 {
-  set_conf (&options->BIG_RULE, -2, "<hr>");
-  set_conf (&options->BODY_ELEMENT_ATTRIBUTES, -2, 0);
-  set_conf (&options->CHAPTER_HEADER_LEVEL, 2, 0);
-  set_conf (&options->CLOSE_QUOTE_SYMBOL, -2, 0);
-  set_conf (&options->CONTENTS_OUTPUT_LOCATION, -2, "after_top");
-  set_conf (&options->CONVERT_TO_LATEX_IN_MATH, -1, 0);
-  set_conf (&options->INDENTED_BLOCK_COMMANDS_IN_TABLE, 0, 0);
-  set_conf (&options->COPIABLE_LINKS, 1, 0);
-  set_conf (&options->DATE_IN_HEADER, 0, 0);
-  set_conf (&options->DEFAULT_RULE, -2, "<hr>");
-  set_conf (&options->documentlanguage, -2, "en");
-  set_conf (&options->DOCTYPE, -2, "<!DOCTYPE html>");
-  set_conf (&options->DO_ABOUT, 0, 0);
-  set_conf (&options->OUTPUT_CHARACTERS, 0, 0);
-  set_conf (&options->EXTENSION, -2, "html");
-  set_conf (&options->EXTERNAL_CROSSREF_EXTENSION, -2, 0);
-  set_conf (&options->FOOTNOTE_END_HEADER_LEVEL, 4, 0);
-  set_conf (&options->FOOTNOTE_SEPARATE_HEADER_LEVEL, 4, 0);
-  set_conf (&options->FORMAT_MENU, -2, "sectiontoc");
-  set_conf (&options->HEADERS, 1, 0);
-  set_conf (&options->INDEX_ENTRY_COLON, -2, "");
-  set_conf (&options->INLINE_CSS_STYLE, 0, 0);
-  set_conf (&options->JS_WEBLABELS, -2, "generate");
-  set_conf (&options->JS_WEBLABELS_FILE, -2, "js_licenses.html");
-  set_conf (&options->MAX_HEADER_LEVEL, 4, 0);
-  set_conf (&options->MENU_ENTRY_COLON, -2, ":");
-  set_conf (&options->MENU_SYMBOL, -2, 0);
-  set_conf (&options->MONOLITHIC, 1, 0);
-  set_conf (&options->NO_CUSTOM_HTML_ATTRIBUTE, 0, 0);
-  set_conf (&options->NO_CSS, 0, 0);
-  set_conf (&options->NO_NUMBER_FOOTNOTE_SYMBOL, -2, "*");
-  set_conf (&options->NODE_NAME_IN_MENU, 1, 0);
-  set_conf (&options->OPEN_QUOTE_SYMBOL, -2, 0);
-  set_conf (&options->OUTPUT_ENCODING_NAME, -2, "utf-8");
-  set_conf (&options->SECTION_NAME_IN_TITLE, 0, 0);
-  set_conf (&options->SHORT_TOC_LINK_TO_TOC, 1, 0);
-  set_conf (&options->SHOW_TITLE, -1, 0);
-  set_conf (&options->SPLIT, -2, "node");
-  set_conf (&options->TOP_FILE, -2, "index.html");
-  set_conf (&options->TOP_NODE_FILE_TARGET, -2, "index.html");
-  set_conf (&options->USE_ACCESSKEY, 1, 0);
-  set_conf (&options->USE_NEXT_HEADING_FOR_LONE_NODE, 1, 0);
-  set_conf (&options->USE_ISO, 1, 0);
-  set_conf (&options->USE_LINKS, 1, 0);
-  set_conf (&options->USE_NODES, 1, 0);
-  set_conf (&options->USE_NODE_DIRECTIONS, -1, 0);
-  set_conf (&options->USE_REL_REV, 1, 0);
-  set_conf (&options->USE_TITLEPAGE_FOR_TITLE, 1, 0);
-  set_conf (&options->WORDS_IN_PAGE, 300, 0);
-  set_conf (&options->XREF_USE_NODE_NAME_ARG, -1, 0);
-  set_conf (&options->XREF_USE_FLOAT_LABEL, 0, 0);
-  set_conf (&options->xrefautomaticsectiontitle, -2, "on");
+  option_set_conf (&options->BIG_RULE, -2, "<hr>");
+  option_set_conf (&options->BODY_ELEMENT_ATTRIBUTES, -2, 0);
+  option_set_conf (&options->CHAPTER_HEADER_LEVEL, 2, 0);
+  option_set_conf (&options->CLOSE_QUOTE_SYMBOL, -2, 0);
+  option_set_conf (&options->CONTENTS_OUTPUT_LOCATION, -2, "after_top");
+  option_set_conf (&options->CONVERT_TO_LATEX_IN_MATH, -1, 0);
+  option_set_conf (&options->INDENTED_BLOCK_COMMANDS_IN_TABLE, 0, 0);
+  option_set_conf (&options->COPIABLE_LINKS, 1, 0);
+  option_set_conf (&options->DATE_IN_HEADER, 0, 0);
+  option_set_conf (&options->DEFAULT_RULE, -2, "<hr>");
+  option_set_conf (&options->documentlanguage, -2, "en");
+  option_set_conf (&options->DOCTYPE, -2, "<!DOCTYPE html>");
+  option_set_conf (&options->DO_ABOUT, 0, 0);
+  option_set_conf (&options->OUTPUT_CHARACTERS, 0, 0);
+  option_set_conf (&options->EXTENSION, -2, "html");
+  option_set_conf (&options->EXTERNAL_CROSSREF_EXTENSION, -2, 0);
+  option_set_conf (&options->FOOTNOTE_END_HEADER_LEVEL, 4, 0);
+  option_set_conf (&options->FOOTNOTE_SEPARATE_HEADER_LEVEL, 4, 0);
+  option_set_conf (&options->FORMAT_MENU, -2, "sectiontoc");
+  option_set_conf (&options->HEADERS, 1, 0);
+  option_set_conf (&options->INDEX_ENTRY_COLON, -2, "");
+  option_set_conf (&options->INLINE_CSS_STYLE, 0, 0);
+  option_set_conf (&options->JS_WEBLABELS, -2, "generate");
+  option_set_conf (&options->JS_WEBLABELS_FILE, -2, "js_licenses.html");
+  option_set_conf (&options->MAX_HEADER_LEVEL, 4, 0);
+  option_set_conf (&options->MENU_ENTRY_COLON, -2, ":");
+  option_set_conf (&options->MENU_SYMBOL, -2, 0);
+  option_set_conf (&options->MONOLITHIC, 1, 0);
+  option_set_conf (&options->NO_CUSTOM_HTML_ATTRIBUTE, 0, 0);
+  option_set_conf (&options->NO_CSS, 0, 0);
+  option_set_conf (&options->NO_NUMBER_FOOTNOTE_SYMBOL, -2, "*");
+  option_set_conf (&options->NODE_NAME_IN_MENU, 1, 0);
+  option_set_conf (&options->OPEN_QUOTE_SYMBOL, -2, 0);
+  option_set_conf (&options->OUTPUT_ENCODING_NAME, -2, "utf-8");
+  option_set_conf (&options->SECTION_NAME_IN_TITLE, 0, 0);
+  option_set_conf (&options->SHORT_TOC_LINK_TO_TOC, 1, 0);
+  option_set_conf (&options->SHOW_TITLE, -1, 0);
+  option_set_conf (&options->SPLIT, -2, "node");
+  option_set_conf (&options->TOP_FILE, -2, "index.html");
+  option_set_conf (&options->TOP_NODE_FILE_TARGET, -2, "index.html");
+  option_set_conf (&options->USE_ACCESSKEY, 1, 0);
+  option_set_conf (&options->USE_NEXT_HEADING_FOR_LONE_NODE, 1, 0);
+  option_set_conf (&options->USE_ISO, 1, 0);
+  option_set_conf (&options->USE_LINKS, 1, 0);
+  option_set_conf (&options->USE_NODES, 1, 0);
+  option_set_conf (&options->USE_NODE_DIRECTIONS, -1, 0);
+  option_set_conf (&options->USE_REL_REV, 1, 0);
+  option_set_conf (&options->USE_TITLEPAGE_FOR_TITLE, 1, 0);
+  option_set_conf (&options->WORDS_IN_PAGE, 300, 0);
+  option_set_conf (&options->XREF_USE_NODE_NAME_ARG, -1, 0);
+  option_set_conf (&options->XREF_USE_FLOAT_LABEL, 0, 0);
+  option_set_conf (&options->xrefautomaticsectiontitle, -2, "on");
 }
 
 void set_texi2html_regular_options_defaults (OPTIONS *options)
 {
-  set_conf (&options->FORMAT_MENU, -2, "menu");
-  set_conf (&options->USE_SETFILENAME_EXTENSION, 0, 0);
-  set_conf (&options->footnotestyle, -2, "separate");
-  set_conf (&options->CONTENTS_OUTPUT_LOCATION, -2, "separate_element");
-  set_conf (&options->FORCE, 1, 0);
-  set_conf (&options->USE_ACCESSKEY, 0, 0);
-  set_conf (&options->NODE_NAME_IN_MENU, 0, 0);
-  set_conf (&options->SHORT_TOC_LINK_TO_TOC, 0, 0);
-  set_conf (&options->SHOW_TITLE, 1, 0);
-  set_conf (&options->USE_REL_REV, 0, 0);
-  set_conf (&options->USE_LINKS, 0, 0);
-  set_conf (&options->USE_NODES, 0, 0);
-  set_conf (&options->SPLIT, -2, "");
-  set_conf (&options->PROGRAM_NAME_IN_FOOTER, 1, 0);
-  set_conf (&options->PROGRAM_NAME_IN_ABOUT, 1, 0);
-  set_conf (&options->HEADER_IN_TABLE, 1, 0);
-  set_conf (&options->MENU_ENTRY_COLON, -2, "");
-  set_conf (&options->INDEX_ENTRY_COLON, -2, "");
-  set_conf (&options->DO_ABOUT, -1, 0);
-  set_conf (&options->CHAPTER_HEADER_LEVEL, 1, 0);
-  set_conf (&options->BIG_RULE, -2, "<hr style=\"height: 6px;\">");
-  set_conf (&options->FOOTNOTE_END_HEADER_LEVEL, 3, 0);
-  set_conf (&options->FOOTNOTE_SEPARATE_HEADER_LEVEL, 1, 0);
+  option_set_conf (&options->FORMAT_MENU, -2, "menu");
+  option_set_conf (&options->USE_SETFILENAME_EXTENSION, 0, 0);
+  option_set_conf (&options->footnotestyle, -2, "separate");
+  option_set_conf (&options->CONTENTS_OUTPUT_LOCATION, -2, "separate_element");
+  option_set_conf (&options->FORCE, 1, 0);
+  option_set_conf (&options->USE_ACCESSKEY, 0, 0);
+  option_set_conf (&options->NODE_NAME_IN_MENU, 0, 0);
+  option_set_conf (&options->SHORT_TOC_LINK_TO_TOC, 0, 0);
+  option_set_conf (&options->SHOW_TITLE, 1, 0);
+  option_set_conf (&options->USE_REL_REV, 0, 0);
+  option_set_conf (&options->USE_LINKS, 0, 0);
+  option_set_conf (&options->USE_NODES, 0, 0);
+  option_set_conf (&options->SPLIT, -2, "");
+  option_set_conf (&options->PROGRAM_NAME_IN_FOOTER, 1, 0);
+  option_set_conf (&options->PROGRAM_NAME_IN_ABOUT, 1, 0);
+  option_set_conf (&options->HEADER_IN_TABLE, 1, 0);
+  option_set_conf (&options->MENU_ENTRY_COLON, -2, "");
+  option_set_conf (&options->INDEX_ENTRY_COLON, -2, "");
+  option_set_conf (&options->DO_ABOUT, -1, 0);
+  option_set_conf (&options->CHAPTER_HEADER_LEVEL, 1, 0);
+  option_set_conf (&options->BIG_RULE, -2, "<hr style=\"height: 6px;\">");
+  option_set_conf (&options->FOOTNOTE_END_HEADER_LEVEL, 3, 0);
+  option_set_conf (&options->FOOTNOTE_SEPARATE_HEADER_LEVEL, 1, 0);
 }
 
diff --git a/tp/Texinfo/XS/convert/get_converter_perl_info.c 
b/tp/Texinfo/XS/convert/get_converter_perl_info.c
index ff31573156..d48279dcaa 100644
--- a/tp/Texinfo/XS/convert/get_converter_perl_info.c
+++ b/tp/Texinfo/XS/convert/get_converter_perl_info.c
@@ -173,23 +173,25 @@ set_translated_commands (SV *translated_commands_sv)
   return translated_commands;
 }
 
-/* OPTION should be already allocated but otherwise set to 0 */
-static int
-get_option_from_sv (OPTION *option, SV *option_sv, CONVERTER *converter,
-                    OPTION **sorted_options, const char *option_name)
+static OPTION *
+new_option_from_sv (SV *option_sv, CONVERTER *converter,
+                    OPTION **sorted_options, const char *option_name,
+                    int *status)
 {
-  int status;
+  OPTION *option = 0;
 
   const OPTION *ref_option = find_option_string (sorted_options, option_name);
   if (!ref_option)
-    return -2;
-
-  initialize_option (option, ref_option->type, ref_option->name);
-  option->number = ref_option->number;
+    *status = -2;
+  else
+    {
+      option
+        = new_option (ref_option->type, ref_option->name, ref_option->number);
 
-  status = get_sv_option (option, option_sv, 0, 0, converter);
+      *status = get_sv_option (option, option_sv, 0, 0, converter);
+    }
 
-  return status;
+  return option;
 }
 
 /* class is Perl converter class for warning message */
@@ -218,20 +220,21 @@ get_converter_info_from_sv (SV *conf_sv, const char 
*class,
 
       for (i = 0; i < hv_number; i++)
         {
-          OPTION *option
-            = 
&initialization_info->conf.list[initialization_info->conf.number];
+          int status;
           char *key;
           I32 retlen;
           SV *value = hv_iternextsv (conf_hv, &key, &retlen);
-          int status = get_option_from_sv (option, value, converter,
-                                           sorted_options, key);
+          OPTION *option = new_option_from_sv (value, converter,
+                                               sorted_options, key, &status);
+
           if (!status)
             {
+              initialization_info->conf.list[initialization_info->conf.number]
+                = option;
               initialization_info->conf.number++;
             }
           else
             {
-              memset (option, 0, sizeof (OPTION));
               if (status == -2)
                 {
                   add_string (key,
@@ -261,7 +264,10 @@ get_converter_info_from_sv (SV *conf_sv, const char *class,
                     }
                 }
               else
-                fprintf (stderr, "ERROR: %s unexpected conf error\n", key);
+                {
+                  free_option (option);
+                  fprintf (stderr, "ERROR: %s unexpected conf error\n", key);
+                }
             }
         }
       return 1;
diff --git a/tp/Texinfo/XS/convert/html_converter_init_options.c 
b/tp/Texinfo/XS/convert/html_converter_init_options.c
index 9892052349..fa63c84f87 100644
--- a/tp/Texinfo/XS/convert/html_converter_init_options.c
+++ b/tp/Texinfo/XS/convert/html_converter_init_options.c
@@ -352,7 +352,7 @@ html_converter_defaults (CONVERTER *self,
 
       for (i = 0; i < conf->conf.number; i++)
         {
-          OPTION *option = &conf->conf.list[i];
+          OPTION *option = conf->conf.list[i];
           if (option->number == t2h_conf_number)
             {
               if (option->o.integer >= 0)
@@ -376,7 +376,7 @@ html_converter_initialize (CONVERTER *self)
   int max_header_level = self->conf->MAX_HEADER_LEVEL.o.integer;
 
   if (!self->conf->FORMAT_MENU.o.string)
-    force_conf (&self->conf->FORMAT_MENU, 0, "");
+    option_force_conf (&self->conf->FORMAT_MENU, 0, "");
 
  /* NOTE we reset silently if the split specification is not one known.
     The main program warns if the specific command line option value is
@@ -385,12 +385,12 @@ html_converter_initialize (CONVERTER *self)
   */
   if (split && strlen (split) && strcmp (split, "chapter")
       && strcmp (split, "section") && strcmp (split, "node"))
-    force_conf (&self->conf->SPLIT, 0, "node");
+    option_force_conf (&self->conf->SPLIT, 0, "node");
 
   if (max_header_level < 0)
-    force_conf (&self->conf->MAX_HEADER_LEVEL, 4, 0);
+    option_force_conf (&self->conf->MAX_HEADER_LEVEL, 4, 0);
   else if (max_header_level < 1)
-    force_conf (&self->conf->MAX_HEADER_LEVEL, 1, 0);
+    option_force_conf (&self->conf->MAX_HEADER_LEVEL, 1, 0);
 
   /* For CONTENTS_OUTPUT_LOCATION
      should lead to contents not output, but if not, it is not an issue,
@@ -399,9 +399,9 @@ html_converter_initialize (CONVERTER *self)
    */
 
   if (!self->conf->CONTENTS_OUTPUT_LOCATION.o.string)
-    force_conf (&self->conf->CONTENTS_OUTPUT_LOCATION, 0, "");
+    option_force_conf (&self->conf->CONTENTS_OUTPUT_LOCATION, 0, "");
   if (!self->conf->INDEX_ENTRY_COLON.o.string)
-    force_conf (&self->conf->INDEX_ENTRY_COLON, 0, "");
+    option_force_conf (&self->conf->INDEX_ENTRY_COLON, 0, "");
   if (!self->conf->MENU_ENTRY_COLON.o.string)
-    force_conf (&self->conf->MENU_ENTRY_COLON, 0, "");
+    option_force_conf (&self->conf->MENU_ENTRY_COLON, 0, "");
 }
diff --git a/tp/Texinfo/XS/convert/texinfo.c b/tp/Texinfo/XS/convert/texinfo.c
index ac22f26a64..fe987e6d67 100644
--- a/tp/Texinfo/XS/convert/texinfo.c
+++ b/tp/Texinfo/XS/convert/texinfo.c
@@ -140,32 +140,6 @@ txi_complete_document (DOCUMENT *document, unsigned long 
flags,
                                          document->options);
 }
 
-static void
-initialize_option_value (OPTION *option, OPTION **sorted_options,
-                         const char *option_name, int int_value,
-                         const char *char_value)
-{
-  const OPTION *ref_option = find_option_string (sorted_options, option_name);
-  if (!ref_option)
-    return;
-  
-  initialize_option (option, ref_option->type, ref_option->name);
-  option->number = ref_option->number;
-  
-  set_conf (option, int_value, char_value);
-} 
-
-static void
-add_option_value (OPTIONS_LIST *options_list,  OPTION **sorted_options,
-                  const char *option_name, int int_value,
-                  const char *char_value)
-{   
-  OPTION *option = &options_list->list[options_list->number];
-  initialize_option_value (option, sorted_options, option_name, int_value,
-                           char_value);
-  options_list->number++;
-} 
-
 /* TODO add other options argument */
 CONVERTER *
 txi_converter (const char *format, const char *locale_encoding,
@@ -191,29 +165,28 @@ txi_converter (const char *format, const char 
*locale_encoding,
 
   conf = new_converter_initialization_info ();
   initialize_options_list (&conf->conf, 10);
-  conf->conf.number = 0;
 
-  add_option_value (&conf->conf, converter->sorted_options,
+  add_option_string_value (&conf->conf, converter->sorted_options,
    /*
     */
                     "PROGRAM", 0, program_file);
   /* comment the line above and uncomment below to compare with
      texi2any output
                     "PROGRAM", 0, "texi2any");
-  add_option_value (&conf->conf, converter->sorted_options,
+  add_option_string_value (&conf->conf, converter->sorted_options,
                     "PACKAGE_AND_VERSION", 0, "Texinfo 7.1.90+dev");
    */
-  add_option_value (&conf->conf, converter->sorted_options,
+  add_option_string_value (&conf->conf, converter->sorted_options,
                     "COMMAND_LINE_ENCODING", 0, locale_encoding);
   /* this option is not used, it is filled to mimic texi2any */
-  add_option_value (&conf->conf, converter->sorted_options,
+  add_option_string_value (&conf->conf, converter->sorted_options,
                     "MESSAGE_ENCODING", 0, locale_encoding);
-  add_option_value (&conf->conf, converter->sorted_options,
+  add_option_string_value (&conf->conf, converter->sorted_options,
                     "LOCALE_ENCODING", 0, locale_encoding);
-  add_option_value (&conf->conf, converter->sorted_options,
+  add_option_string_value (&conf->conf, converter->sorted_options,
                     "XS_STRXFRM_COLLATION_LOCALE", 0, "en_US");
   /*
-  add_option_value (&conf->conf, converter->sorted_options,
+  add_option_string_value (&conf->conf, converter->sorted_options,
                     "DEBUG", 1, 0);
    */
 
diff --git a/tp/Texinfo/XS/main/option_types.h 
b/tp/Texinfo/XS/main/option_types.h
index b2c0e8af31..b1446a9304 100644
--- a/tp/Texinfo/XS/main/option_types.h
+++ b/tp/Texinfo/XS/main/option_types.h
@@ -176,7 +176,8 @@ typedef struct OPTION {
 
 typedef struct OPTIONS_LIST {
     size_t number;
-    OPTION *list;
+    size_t space;
+    OPTION **list;
 } OPTIONS_LIST;
 
 #endif
diff --git a/tp/Texinfo/XS/main/utils.c b/tp/Texinfo/XS/main/utils.c
index 6795e9f907..5d7be31797 100644
--- a/tp/Texinfo/XS/main/utils.c
+++ b/tp/Texinfo/XS/main/utils.c
@@ -1857,6 +1857,45 @@ initialize_option (OPTION *option, enum 
global_option_type type,
     }
 }
 
+/* only for strings and integers */
+static void
+option_set_conf_internal (OPTION *option, int int_value, const char 
*char_value)
+{
+  switch (option->type)
+    {
+      case GOT_integer:
+        option->o.integer = int_value;
+        break;
+      case GOT_char:
+      case GOT_bytes:
+        free (option->o.string);
+        if (!char_value)
+          option->o.string = 0;
+        else
+          option->o.string = strdup (char_value);
+        break;
+
+      default:
+        fprintf (stderr, "BUG: set_conf type not handled: %d\n",
+                 option->type);
+    }
+}
+
+int
+option_set_conf (OPTION *option, int int_value, const char *char_value)
+{
+  if (option->configured > 0)
+    return 0;
+  option_set_conf_internal (option, int_value, char_value);
+  return 1;
+}
+
+void
+option_force_conf (OPTION *option, int int_value, const char *char_value)
+{
+  option_set_conf_internal (option, int_value, char_value);
+}
+
 void
 copy_option (OPTION *destination, const OPTION *source)
 {
@@ -2008,6 +2047,20 @@ set_sorted_option_key_configured (OPTION 
**sorted_options, const char *key,
     }
 }
 
+void
+initialize_options_list (OPTIONS_LIST *options_list, size_t number)
+{
+  options_list->number = 0;
+  options_list->space = number;
+  if (number > 0)
+    {
+      options_list->list = (OPTION **) malloc (sizeof (OPTION *) * number);
+      memset (options_list->list, 0, sizeof (OPTION *) * number);
+    }
+  else
+    options_list->list = 0;
+}
+
 /* copy OPTIONS_LIST options to an OPTIONS structure, using the sorted options
    to find the struct fields. */
 void
@@ -2018,7 +2071,7 @@ copy_options_list_options (OPTIONS *options, OPTION 
**sorted_options,
 
   for (i = 0; i < options_list->number; i++)
     {
-      OPTION *src_option = &options_list->list[i];
+      OPTION *src_option = options_list->list[i];
       if (src_option->number > 0)
         {
           size_t index = src_option->number - 1;
@@ -2037,12 +2090,56 @@ copy_options_list_options (OPTIONS *options, OPTION 
**sorted_options,
     }
 }
 
-void
-initialize_options_list (OPTIONS_LIST *options_list, size_t number)
+/* note that the value in union o is not initialized */
+OPTION *
+new_option (enum global_option_type type, const char *name, size_t number)
 {
-  options_list->number = number;
-  options_list->list = (OPTION *) malloc (sizeof (OPTION) * number);
-  memset (options_list->list, 0, sizeof (OPTION) * number);
+  OPTION *option = (OPTION *) malloc (sizeof (OPTION));
+
+  initialize_option (option, type, name);
+  option->number = number;
+  option->configured = 0;
+
+  return option;
+}
+
+static OPTION *
+new_option_string_value (OPTION **sorted_options,
+                         const char *option_name, int int_value,
+                         const char *char_value)
+{
+  OPTION *option;
+  const OPTION *ref_option = find_option_string (sorted_options, option_name);
+  if (!ref_option)
+    return 0;
+
+  option = new_option (ref_option->type, ref_option->name, ref_option->number);
+
+  option_set_conf (option, int_value, char_value);
+
+  return option;
+}
+
+OPTION *
+add_option_string_value (OPTIONS_LIST *options_list,  OPTION **sorted_options,
+                         const char *option_name, int int_value,
+                         const char *char_value)
+{
+  OPTION *option = new_option_string_value (sorted_options, option_name,
+                                            int_value, char_value);
+
+  if (option)
+    {
+      if (options_list->number >= options_list->space)
+        {
+          options_list->list = realloc (options_list->list,
+                  (options_list->space += 5) * sizeof (OPTION *));
+        }
+      options_list->list[options_list->number] = option;
+      options_list->number++;
+    }
+
+  return option;
 }
 
 void
@@ -2052,12 +2149,15 @@ free_options_list (OPTIONS_LIST *options_list)
 
   for (i = 0; i < options_list->number; i++)
     {
-      free_option (&options_list->list[i]);
+      free_option (options_list->list[i]);
+      free (options_list->list[i]);
     }
 
   free (options_list->list);
 }
 
+
+
 void
 html_fill_button_directions_specification_list (const CONVERTER *converter,
                                               BUTTON_SPECIFICATION_LIST 
*result)
diff --git a/tp/Texinfo/XS/main/utils.h b/tp/Texinfo/XS/main/utils.h
index edd845d02c..43c451065d 100644
--- a/tp/Texinfo/XS/main/utils.h
+++ b/tp/Texinfo/XS/main/utils.h
@@ -279,9 +279,17 @@ int html_get_direction_index (const CONVERTER *converter,
 
 void initialize_option (OPTION *option, enum global_option_type type,
                         const char *name);
+OPTION *new_option (enum global_option_type type, const char *name,
+                    size_t number);
 void clear_option (OPTION *option);
 void free_option (OPTION *option);
 void copy_option (OPTION *destination, const OPTION *source);
+int option_set_conf (OPTION *option, int int_value, const char *char_value);
+void option_force_conf (OPTION *option, int int_value, const char *char_value);
+OPTION *add_option_string_value (OPTIONS_LIST *options_list,
+                         OPTION **sorted_options,
+                         const char *option_name, int int_value,
+                         const char *char_value);
 
 TARGET_FILENAME *new_target_filename (void);
 TARGET_CONTENTS_FILENAME *new_target_contents_filename (void);
diff --git a/tp/maintain/regenerate_C_options_info.pl 
b/tp/maintain/regenerate_C_options_info.pl
index 9a9131c5bd..f80d634cad 100755
--- a/tp/maintain/regenerate_C_options_info.pl
+++ b/tp/maintain/regenerate_C_options_info.pl
@@ -378,7 +378,7 @@ print OCDEF "/* Automatically generated from $program_name 
*/\n\n";
 print OCDEF '#include <config.h>'."\n\n";
 
 print OCDEF '#include "options_types.h"'."\n";
-print OCDEF '#include "converter.h"'."\n";
+print OCDEF '#include "utils.h"'."\n";
 print OCDEF '#include "converters_defaults.h"'."\n\n";
 
 open(OHDEF, ">$converter_defaults_header_file")
@@ -407,7 +407,7 @@ foreach my $category (sort(keys(%option_categories))) {
   foreach my $option_info (@{$option_categories{$category}}) {
     my ($option, $value, $type) = @$option_info;
     my ($int_value, $char_value) = get_value($type, $value);
-    print OCDEF "  set_conf (&options->${option}, $int_value, $char_value);\n";
+    print OCDEF "  option_set_conf (&options->${option}, $int_value, 
$char_value);\n";
   }
   print OCDEF "}\n\n";
 }
@@ -425,7 +425,7 @@ foreach my $format (@sorted_formats) {
     my $option_info = $options{$option};
     my ($option_unused, $main_default, $type) = @$option_info;
     my ($int_value, $char_value) = get_value($type, $value);
-    print OCDEF "  set_conf (&options->${option}, $int_value, $char_value);\n";
+    print OCDEF "  option_set_conf (&options->${option}, $int_value, 
$char_value);\n";
   }
   print OCDEF "}\n\n";
 }



reply via email to

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