[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/maintain/regenerate_C_options_info.pl: renam
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/maintain/regenerate_C_options_info.pl: rename functions setting options defaults. Set correctly non integer/string options. Add a function to set all options defaults. |
Date: |
Fri, 04 Oct 2024 20:08:00 -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 2191d37b0d * tp/maintain/regenerate_C_options_info.pl: rename
functions setting options defaults. Set correctly non integer/string options.
Add a function to set all options defaults.
2191d37b0d is described below
commit 2191d37b0d628bdcc07e1a60ba42af03af52f216
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Aug 18 11:42:27 2024 +0200
* tp/maintain/regenerate_C_options_info.pl: rename functions setting
options defaults. Set correctly non integer/string options. Add a
function to set all options defaults.
---
ChangeLog | 6 ++
tp/Texinfo/XS/convert/converter.c | 8 +-
tp/Texinfo/XS/convert/converters_defaults.c | 24 +++--
tp/Texinfo/XS/main/builtin_commands.c | 2 +
tp/Texinfo/XS/main/options_defaults.c | 145 +++++++++++++++++++---------
tp/Texinfo/XS/main/options_defaults.h | 34 ++++---
tp/maintain/regenerate_C_options_info.pl | 64 ++++++++----
7 files changed, 190 insertions(+), 93 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9504f0b24f..2a956ad456 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-08-18 Patrice Dumas <pertusus@free.fr>
+
+ * tp/maintain/regenerate_C_options_info.pl: rename functions setting
+ options defaults. Set correctly non integer/string options. Add a
+ function to set all options defaults.
+
2024-08-18 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/main/customization_options.c: reorder code, add
diff --git a/tp/Texinfo/XS/convert/converter.c
b/tp/Texinfo/XS/convert/converter.c
index ffc11d0100..ec9499563d 100644
--- a/tp/Texinfo/XS/convert/converter.c
+++ b/tp/Texinfo/XS/convert/converter.c
@@ -210,10 +210,10 @@ retrieve_converter (size_t converter_descriptor)
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_converter_cmdline_options_defaults (options);
+ set_converter_customization_options_defaults (options);
+ set_unique_at_command_options_defaults (options);
+ set_multiple_at_command_options_defaults (options);
set_common_regular_options_defaults (options);
}
diff --git a/tp/Texinfo/XS/convert/converters_defaults.c
b/tp/Texinfo/XS/convert/converters_defaults.c
index 8fe2d8994b..34ed8e52a3 100644
--- a/tp/Texinfo/XS/convert/converters_defaults.c
+++ b/tp/Texinfo/XS/convert/converters_defaults.c
@@ -7,7 +7,8 @@
#include "customization_options.h"
#include "converters_defaults.h"
-void set_common_regular_options_defaults (OPTIONS *options)
+void
+set_common_regular_options_defaults (OPTIONS *options)
{
option_set_conf (&options->PACKAGE_AND_VERSION, -2, "texinfo");
option_set_conf (&options->PACKAGE_VERSION, -2, "");
@@ -15,7 +16,8 @@ void set_common_regular_options_defaults (OPTIONS *options)
option_set_conf (&options->PROGRAM, -2, "");
}
-void add_common_regular_options_defaults (OPTIONS_LIST *options_list)
+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, "");
@@ -23,17 +25,20 @@ void add_common_regular_options_defaults (OPTIONS_LIST
*options_list)
add_new_option_value (options_list, GOT_char, "PROGRAM", -2, "");
}
-void set_converter_regular_options_defaults (OPTIONS *options)
+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)
+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)
+void
+set_html_regular_options_defaults (OPTIONS *options)
{
option_set_conf (&options->BIG_RULE, -2, "<hr>");
option_set_conf (&options->BODY_ELEMENT_ATTRIBUTES, -2, 0);
@@ -89,7 +94,8 @@ 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)
+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);
@@ -145,7 +151,8 @@ void add_html_regular_options_defaults (OPTIONS_LIST
*options_list)
add_new_option_value (options_list, GOT_char, "xrefautomaticsectiontitle",
-2, "on");
}
-void set_texi2html_regular_options_defaults (OPTIONS *options)
+void
+set_texi2html_regular_options_defaults (OPTIONS *options)
{
option_set_conf (&options->FORMAT_MENU, -2, "menu");
option_set_conf (&options->USE_SETFILENAME_EXTENSION, 0, 0);
@@ -172,7 +179,8 @@ 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)
+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);
diff --git a/tp/Texinfo/XS/main/builtin_commands.c
b/tp/Texinfo/XS/main/builtin_commands.c
index 6fd0aff826..ed3b344601 100644
--- a/tp/Texinfo/XS/main/builtin_commands.c
+++ b/tp/Texinfo/XS/main/builtin_commands.c
@@ -145,6 +145,8 @@ compare_type_index_fn (const void *a, const void *b)
return strcmp (ta->name, tb->name);
}
+/* Setup sorted type name and identifier pairs to find identifier associated
+ with name with bsearch */
void
set_element_type_name_info (void)
{
diff --git a/tp/Texinfo/XS/main/options_defaults.c
b/tp/Texinfo/XS/main/options_defaults.c
index 170af206b1..26a98d273c 100644
--- a/tp/Texinfo/XS/main/options_defaults.c
+++ b/tp/Texinfo/XS/main/options_defaults.c
@@ -10,28 +10,38 @@
/* array_cmdline */
-void set_array_cmdline_regular_defaults (OPTIONS *options)
+void
+set_array_cmdline_options_defaults (OPTIONS *options)
{
- 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);
+ clear_option (&options->CSS_FILES);
+ clear_option (&options->CSS_REFS);
+ clear_option (&options->EXPANDED_FORMATS);
+ clear_option (&options->INCLUDE_DIRECTORIES);
+ clear_option (&options->TEXINFO_LANGUAGE_DIRECTORIES);
}
-void add_array_cmdline_regular_defaults (OPTIONS_LIST *options_list)
+void
+add_array_cmdline_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);
- add_new_option_value (options_list, GOT_file_string_list,
"TEXINFO_LANGUAGE_DIRECTORIES", -2, 0);
+ OPTION *option;
+
+ option = new_option (GOT_bytes_string_list, "CSS_FILES", 0);
+ options_list_add_option (options_list, option);
+ option = new_option (GOT_char_string_list, "CSS_REFS", 0);
+ options_list_add_option (options_list, option);
+ option = new_option (GOT_bytes_string_list, "EXPANDED_FORMATS", 0);
+ options_list_add_option (options_list, option);
+ option = new_option (GOT_file_string_list, "INCLUDE_DIRECTORIES", 0);
+ options_list_add_option (options_list, option);
+ option = new_option (GOT_file_string_list, "TEXINFO_LANGUAGE_DIRECTORIES",
0);
+ options_list_add_option (options_list, option);
}
/* converter_cmdline */
-void set_converter_cmdline_regular_defaults (OPTIONS *options)
+void
+set_converter_cmdline_options_defaults (OPTIONS *options)
{
option_set_conf (&options->SPLIT_SIZE, 300000, 0);
option_set_conf (&options->FILLCOLUMN, 72, 0);
@@ -47,7 +57,8 @@ void set_converter_cmdline_regular_defaults (OPTIONS *options)
option_set_conf (&options->ENABLE_ENCODING, 1, 0);
}
-void add_converter_cmdline_regular_defaults (OPTIONS_LIST *options_list)
+void
+add_converter_cmdline_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);
@@ -66,7 +77,8 @@ void add_converter_cmdline_regular_defaults (OPTIONS_LIST
*options_list)
/* converter_customization */
-void set_converter_customization_regular_defaults (OPTIONS *options)
+void
+set_converter_customization_options_defaults (OPTIONS *options)
{
option_set_conf (&options->TOP_NODE_UP, -2, "(dir)");
option_set_conf (&options->BASEFILENAME_LENGTH, 255-10, 0);
@@ -210,7 +222,8 @@ void set_converter_customization_regular_defaults (OPTIONS
*options)
option_set_conf (&options->_INLINE_STYLE_WIDTH, -1, 0);
}
-void add_converter_customization_regular_defaults (OPTIONS_LIST *options_list)
+void
+add_converter_customization_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);
@@ -357,40 +370,56 @@ void add_converter_customization_regular_defaults
(OPTIONS_LIST *options_list)
/* converter_other */
-void set_converter_other_regular_defaults (OPTIONS *options)
+void
+set_converter_other_options_defaults (OPTIONS *options)
{
- 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);
+ clear_option (&options->LINKS_BUTTONS);
+ clear_option (&options->TOP_BUTTONS);
+ clear_option (&options->TOP_FOOTER_BUTTONS);
+ clear_option (&options->SECTION_BUTTONS);
+ clear_option (&options->CHAPTER_FOOTER_BUTTONS);
+ clear_option (&options->SECTION_FOOTER_BUTTONS);
+ clear_option (&options->NODE_FOOTER_BUTTONS);
+ clear_option (&options->MISC_BUTTONS);
+ clear_option (&options->CHAPTER_BUTTONS);
+ clear_option (&options->ACTIVE_ICONS);
+ clear_option (&options->PASSIVE_ICONS);
}
-void add_converter_other_regular_defaults (OPTIONS_LIST *options_list)
+void
+add_converter_other_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);
+ OPTION *option;
+
+ option = new_option (GOT_buttons, "LINKS_BUTTONS", 0);
+ options_list_add_option (options_list, option);
+ option = new_option (GOT_buttons, "TOP_BUTTONS", 0);
+ options_list_add_option (options_list, option);
+ option = new_option (GOT_buttons, "TOP_FOOTER_BUTTONS", 0);
+ options_list_add_option (options_list, option);
+ option = new_option (GOT_buttons, "SECTION_BUTTONS", 0);
+ options_list_add_option (options_list, option);
+ option = new_option (GOT_buttons, "CHAPTER_FOOTER_BUTTONS", 0);
+ options_list_add_option (options_list, option);
+ option = new_option (GOT_buttons, "SECTION_FOOTER_BUTTONS", 0);
+ options_list_add_option (options_list, option);
+ option = new_option (GOT_buttons, "NODE_FOOTER_BUTTONS", 0);
+ options_list_add_option (options_list, option);
+ option = new_option (GOT_buttons, "MISC_BUTTONS", 0);
+ options_list_add_option (options_list, option);
+ option = new_option (GOT_buttons, "CHAPTER_BUTTONS", 0);
+ options_list_add_option (options_list, option);
+ option = new_option (GOT_icons, "ACTIVE_ICONS", 0);
+ options_list_add_option (options_list, option);
+ option = new_option (GOT_icons, "PASSIVE_ICONS", 0);
+ options_list_add_option (options_list, option);
}
/* multiple_at_command */
-void set_multiple_at_command_regular_defaults (OPTIONS *options)
+void
+set_multiple_at_command_options_defaults (OPTIONS *options)
{
option_set_conf (&options->allowcodebreaks, -2, "true");
option_set_conf (&options->clickstyle, -2, "@arrow");
@@ -419,7 +448,8 @@ void set_multiple_at_command_regular_defaults (OPTIONS
*options)
option_set_conf (&options->xrefautomaticsectiontitle, -2, "off");
}
-void add_multiple_at_command_regular_defaults (OPTIONS_LIST *options_list)
+void
+add_multiple_at_command_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");
@@ -451,7 +481,8 @@ void add_multiple_at_command_regular_defaults (OPTIONS_LIST
*options_list)
/* program_cmdline */
-void set_program_cmdline_regular_defaults (OPTIONS *options)
+void
+set_program_cmdline_options_defaults (OPTIONS *options)
{
option_set_conf (&options->MACRO_EXPAND, -2, 0);
option_set_conf (&options->INTERNAL_LINKS, -2, 0);
@@ -463,7 +494,8 @@ void set_program_cmdline_regular_defaults (OPTIONS *options)
option_set_conf (&options->FORMAT_MENU, -2, "menu");
}
-void add_program_cmdline_regular_defaults (OPTIONS_LIST *options_list)
+void
+add_program_cmdline_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);
@@ -478,7 +510,8 @@ void add_program_cmdline_regular_defaults (OPTIONS_LIST
*options_list)
/* program_customization */
-void set_program_customization_regular_defaults (OPTIONS *options)
+void
+set_program_customization_options_defaults (OPTIONS *options)
{
option_set_conf (&options->CHECK_NORMAL_MENU_STRUCTURE, 1, 0);
option_set_conf (&options->CHECK_MISSING_MENU_ENTRY, 1, 0);
@@ -491,7 +524,8 @@ void set_program_customization_regular_defaults (OPTIONS
*options)
option_set_conf (&options->TREE_TRANSFORMATIONS, -2, 0);
}
-void add_program_customization_regular_defaults (OPTIONS_LIST *options_list)
+void
+add_program_customization_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);
@@ -507,7 +541,8 @@ void add_program_customization_regular_defaults
(OPTIONS_LIST *options_list)
/* unique_at_command */
-void set_unique_at_command_regular_defaults (OPTIONS *options)
+void
+set_unique_at_command_options_defaults (OPTIONS *options)
{
option_set_conf (&options->afivepaper, -2, 0);
option_set_conf (&options->afourpaper, -2, 0);
@@ -530,7 +565,8 @@ void set_unique_at_command_regular_defaults (OPTIONS
*options)
option_set_conf (&options->smallbook, -2, 0);
}
-void add_unique_at_command_regular_defaults (OPTIONS_LIST *options_list)
+void
+add_unique_at_command_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);
@@ -553,3 +589,16 @@ void add_unique_at_command_regular_defaults (OPTIONS_LIST
*options_list)
add_new_option_value (options_list, GOT_char, "smallbook", -2, 0);
}
+void
+set_all_options_defaults (OPTIONS *options)
+{
+ set_array_cmdline_options_defaults (options);
+ set_converter_cmdline_options_defaults (options);
+ set_converter_customization_options_defaults (options);
+ set_converter_other_options_defaults (options);
+ set_multiple_at_command_options_defaults (options);
+ set_program_cmdline_options_defaults (options);
+ set_program_customization_options_defaults (options);
+ set_unique_at_command_options_defaults (options);
+}
+
diff --git a/tp/Texinfo/XS/main/options_defaults.h
b/tp/Texinfo/XS/main/options_defaults.h
index c11d3c256b..357d3afede 100644
--- a/tp/Texinfo/XS/main/options_defaults.h
+++ b/tp/Texinfo/XS/main/options_defaults.h
@@ -13,36 +13,38 @@
#undef PACKAGE_URL
#undef PACKAGE_VERSION
-void set_array_cmdline_regular_defaults (OPTIONS *options);
+void set_array_cmdline_options_defaults (OPTIONS *options);
-void add_array_cmdline_regular_defaults (OPTIONS_LIST *options_list);
+void add_array_cmdline_options_defaults (OPTIONS_LIST *options_list);
-void set_converter_cmdline_regular_defaults (OPTIONS *options);
+void set_converter_cmdline_options_defaults (OPTIONS *options);
-void add_converter_cmdline_regular_defaults (OPTIONS_LIST *options_list);
+void add_converter_cmdline_options_defaults (OPTIONS_LIST *options_list);
-void set_converter_customization_regular_defaults (OPTIONS *options);
+void set_converter_customization_options_defaults (OPTIONS *options);
-void add_converter_customization_regular_defaults (OPTIONS_LIST *options_list);
+void add_converter_customization_options_defaults (OPTIONS_LIST *options_list);
-void set_converter_other_regular_defaults (OPTIONS *options);
+void set_converter_other_options_defaults (OPTIONS *options);
-void add_converter_other_regular_defaults (OPTIONS_LIST *options_list);
+void add_converter_other_options_defaults (OPTIONS_LIST *options_list);
-void set_multiple_at_command_regular_defaults (OPTIONS *options);
+void set_multiple_at_command_options_defaults (OPTIONS *options);
-void add_multiple_at_command_regular_defaults (OPTIONS_LIST *options_list);
+void add_multiple_at_command_options_defaults (OPTIONS_LIST *options_list);
-void set_program_cmdline_regular_defaults (OPTIONS *options);
+void set_program_cmdline_options_defaults (OPTIONS *options);
-void add_program_cmdline_regular_defaults (OPTIONS_LIST *options_list);
+void add_program_cmdline_options_defaults (OPTIONS_LIST *options_list);
-void set_program_customization_regular_defaults (OPTIONS *options);
+void set_program_customization_options_defaults (OPTIONS *options);
-void add_program_customization_regular_defaults (OPTIONS_LIST *options_list);
+void add_program_customization_options_defaults (OPTIONS_LIST *options_list);
-void set_unique_at_command_regular_defaults (OPTIONS *options);
+void set_unique_at_command_options_defaults (OPTIONS *options);
-void add_unique_at_command_regular_defaults (OPTIONS_LIST *options_list);
+void add_unique_at_command_options_defaults (OPTIONS_LIST *options_list);
+
+void set_all_options_defaults (OPTIONS *options);
#endif
diff --git a/tp/maintain/regenerate_C_options_info.pl
b/tp/maintain/regenerate_C_options_info.pl
index ad6dbca5e4..836138f7fa 100755
--- a/tp/maintain/regenerate_C_options_info.pl
+++ b/tp/maintain/regenerate_C_options_info.pl
@@ -417,32 +417,62 @@ print ODHF "#undef PACKAGE_NAME\n";
print ODHF "#undef PACKAGE_URL\n";
print ODHF "#undef PACKAGE_VERSION\n\n";
+my $call_all_options_defaults = '';
+
foreach my $category (sort(keys(%option_categories))) {
print ODCF "\n/* ${category} */\n\n";
- my $options_fun = "void set_${category}_regular_defaults (OPTIONS *options)";
- my $list_fun = "void add_${category}_regular_defaults (OPTIONS_LIST
*options_list)";
+ my $options_fun = "set_${category}_options_defaults (OPTIONS *options)";
+ my $list_fun = "add_${category}_options_defaults (OPTIONS_LIST
*options_list)";
+
+ print ODHF "void $options_fun;\n\n";
+ print ODHF "void $list_fun;\n\n";
- print ODHF "$options_fun;\n\n";
- print ODHF "$list_fun;\n\n";
+ my $fun_call = $options_fun;
+ $fun_call =~ s/OPTIONS \*//;
+ $call_all_options_defaults .= " $fun_call;\n";
- print ODCF "$options_fun\n{\n";
+ # determine if an option declaration is needed for the next file, ie non
+ # string nor integer options are present.
+ my $need_option_declaration = 0;
+
+ print ODCF "void\n$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 ODCF " option_set_conf (&options->${option}, $int_value,
$char_value);\n";
+ if ($type eq 'char' or $type eq 'bytes' or $type eq 'integer') {
+ my ($int_value, $char_value) = get_value($type, $value);
+ print ODCF " option_set_conf (&options->${option}, $int_value,
$char_value);\n";
+ } else {
+ $need_option_declaration = 1;
+ print ODCF " clear_option (&options->${option});\n";
+ }
}
print ODCF "}\n\n";
- print ODCF "$list_fun\n{\n";
+ print ODCF "void\n$list_fun\n{\n";
+ if ($need_option_declaration) {
+ print ODCF " OPTION *option;\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 ODCF " add_new_option_value (options_list, GOT_$type, "
- ."\"$option\", $int_value, $char_value);\n";
+ if ($type eq 'char' or $type eq 'bytes' or $type eq 'integer') {
+ my ($int_value, $char_value) = get_value($type, $value);
+ print ODCF " add_new_option_value (options_list, GOT_$type, "
+ ."\"$option\", $int_value, $char_value);\n";
+ } else {
+ print ODCF " option = new_option (GOT_$type, \"$option\", 0);\n";
+ print ODCF " options_list_add_option (options_list, option);\n";
+ }
}
print ODCF "}\n\n";
}
+my $all_options_fun = 'set_all_options_defaults (OPTIONS *options)';
+print ODCF "void\n$all_options_fun\n{\n";
+print ODCF $call_all_options_defaults;
+print ODCF "}\n\n";
+
+print ODHF "void $all_options_fun;\n\n";
+
close (ODCF);
print ODHF "#endif\n";
@@ -482,14 +512,14 @@ my @sorted_formats = sort(keys(%converter_defaults));
foreach my $format (@sorted_formats) {
my $options_fun
- = "void set_${format}_regular_options_defaults (OPTIONS *options)";
+ = "set_${format}_regular_options_defaults (OPTIONS *options)";
my $list_fun
- = "void add_${format}_regular_options_defaults (OPTIONS_LIST
*options_list)";
+ = "add_${format}_regular_options_defaults (OPTIONS_LIST *options_list)";
- print CDHF "$options_fun;\n\n";
- print CDHF "$list_fun;\n\n";
+ print CDHF "void $options_fun;\n\n";
+ print CDHF "void $list_fun;\n\n";
- print CDCF "$options_fun\n{\n";
+ print CDCF "void\n$options_fun\n{\n";
foreach my $option_spec (@{$converter_defaults{$format}}) {
my ($option, $value) = @$option_spec;
my $option_info = $options{$option};
@@ -499,7 +529,7 @@ foreach my $format (@sorted_formats) {
}
print CDCF "}\n\n";
- print CDCF "$list_fun\n{\n";
+ print CDCF "void\n$list_fun\n{\n";
foreach my $option_spec (@{$converter_defaults{$format}}) {
my ($option, $value) = @$option_spec;
my $option_info = $options{$option};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/maintain/regenerate_C_options_info.pl: rename functions setting options defaults. Set correctly non integer/string options. Add a function to set all options defaults.,
Patrice Dumas <=