[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Sun, 5 May 2024 03:18:22 -0400 (EDT) |
branch: master
commit 08ad4f11ff3d3e0dc9d972085a6c7363b5a66282
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun May 5 00:22:38 2024 +0200
* tp/maintain/regenerate_C_options_info.pl,
tp/Texinfo/XS/main/option_types.h (global_option_type),
tp/Texinfo/XS/main/utils.c, tp/Texinfo/XS/convert/converter.c:
prefix global_option_type enums with GOT_ instead of GO_ to be able to
add other global options enum.
---
ChangeLog | 8 +++++
tp/Texinfo/XS/convert/converter.c | 16 +++++-----
tp/Texinfo/XS/main/option_types.h | 18 +++++------
tp/Texinfo/XS/main/utils.c | 52 ++++++++++++++++----------------
tp/maintain/regenerate_C_options_info.pl | 6 ++--
5 files changed, 54 insertions(+), 46 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 8120890c27..6f72be0c8d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-05-04 Patrice Dumas <pertusus@free.fr>
+
+ * tp/maintain/regenerate_C_options_info.pl,
+ tp/Texinfo/XS/main/option_types.h (global_option_type),
+ tp/Texinfo/XS/main/utils.c, tp/Texinfo/XS/convert/converter.c:
+ prefix global_option_type enums with GOT_ instead of GO_ to be able to
+ add other global options enum.
+
2024-05-04 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/convert/ConvertXS.xs
diff --git a/tp/Texinfo/XS/convert/converter.c
b/tp/Texinfo/XS/convert/converter.c
index 816a5d2975..ce6a84e30e 100644
--- a/tp/Texinfo/XS/convert/converter.c
+++ b/tp/Texinfo/XS/convert/converter.c
@@ -128,12 +128,12 @@ copy_option (OPTION *destination, OPTION *source)
{
switch (source->type)
{
- case GO_integer:
+ case GOT_integer:
destination->integer = source->integer;
break;
- case GO_char:
- case GO_bytes:
+ case GOT_char:
+ case GOT_bytes:
free (destination->string);
if (!source->string)
destination->string = 0;
@@ -154,7 +154,7 @@ new_option_value (enum global_option_type type, int
int_value, char *char_value)
OPTION *result = (OPTION *) malloc (sizeof (OPTION));
memset (result, 0, sizeof (OPTION));
result->type = type;
- if (type == GO_integer)
+ if (type == GOT_integer)
result->integer = int_value;
else
result->string = char_value;
@@ -180,15 +180,15 @@ command_init (enum command_id cmd, OPTIONS *init_conf)
}
}
option_default = &command_option_default_table[cmd];
- if (option_default->type == GO_integer)
+ if (option_default->type == GOT_integer)
{
if (option_default->value >= 0)
- option_value = new_option_value (GO_integer, option_default->value, 0);
+ option_value = new_option_value (GOT_integer, option_default->value,
0);
}
- else if (option_default->type == GO_char)
+ else if (option_default->type == GOT_char)
{
if (option_default->string)
- option_value = new_option_value (GO_char, -1, option_default->string);
+ option_value = new_option_value (GOT_char, -1, option_default->string);
}
return 0;
}
diff --git a/tp/Texinfo/XS/main/option_types.h
b/tp/Texinfo/XS/main/option_types.h
index 6fd10e7225..82df5b7cc2 100644
--- a/tp/Texinfo/XS/main/option_types.h
+++ b/tp/Texinfo/XS/main/option_types.h
@@ -22,15 +22,15 @@
#include "tree_types.h"
enum global_option_type {
- GO_NONE,
- GO_integer,
- GO_char,
- GO_bytes,
- GO_icons,
- GO_buttons,
- GO_bytes_string_list,
- GO_file_string_list,
- GO_char_string_list,
+ GOT_NONE,
+ GOT_integer,
+ GOT_char,
+ GOT_bytes,
+ GOT_icons,
+ GOT_buttons,
+ GOT_bytes_string_list,
+ GOT_file_string_list,
+ GOT_char_string_list,
};
/* button directions are not often used as enum, but it can be useful
diff --git a/tp/Texinfo/XS/main/utils.c b/tp/Texinfo/XS/main/utils.c
index 41a203a891..f48a9afb5e 100644
--- a/tp/Texinfo/XS/main/utils.c
+++ b/tp/Texinfo/XS/main/utils.c
@@ -1028,7 +1028,7 @@ destroy_strings_list (STRING_LIST *strings)
void
set_conf_string (OPTION *option, const char *value)
{
- if (option->type != GO_char && option->type != GO_bytes)
+ if (option->type != GOT_char && option->type != GOT_bytes)
fatal ("set_conf_string bad option type\n");
if (option->configured > 0)
@@ -1210,7 +1210,7 @@ set_informative_command_value (OPTIONS *options, const
ELEMENT *element)
option = get_command_option (options, cmd);
if (option)
{
- if (option->type == GO_integer)
+ if (option->type == GOT_integer)
{
if (option->configured <= 0)
option->integer = strtoul (value, NULL, 10);
@@ -1571,28 +1571,28 @@ clear_option (OPTION *option)
{
switch (option->type)
{
- case GO_char:
- case GO_bytes:
+ case GOT_char:
+ case GOT_bytes:
free (option->string);
option->string = 0;
break;
- case GO_bytes_string_list:
- case GO_file_string_list:
- case GO_char_string_list:
+ case GOT_bytes_string_list:
+ case GOT_file_string_list:
+ case GOT_char_string_list:
clear_strings_list (option->strlist);
break;
- case GO_buttons:
+ case GOT_buttons:
html_free_button_specification_list (option->buttons);
option->buttons = 0;
break;
- case GO_icons:
+ case GOT_icons:
html_clear_direction_icons (option->icons);
break;
- case GO_integer:
+ case GOT_integer:
option->integer = -1;
default:
@@ -1605,27 +1605,27 @@ free_option (OPTION *option)
{
switch (option->type)
{
- case GO_char:
- case GO_bytes:
+ case GOT_char:
+ case GOT_bytes:
free (option->string);
break;
- case GO_bytes_string_list:
- case GO_file_string_list:
- case GO_char_string_list:
+ case GOT_bytes_string_list:
+ case GOT_file_string_list:
+ case GOT_char_string_list:
destroy_strings_list (option->strlist);
break;
- case GO_buttons:
+ case GOT_buttons:
html_free_button_specification_list (option->buttons);
break;
- case GO_icons:
+ case GOT_icons:
html_free_direction_icons (option->icons);
free (option->icons);
break;
- case GO_integer:
+ case GOT_integer:
default:
}
}
@@ -1636,26 +1636,26 @@ initialize_option (OPTION *option, enum
global_option_type type)
option->type = type;
switch (type)
{
- case GO_integer:
+ case GOT_integer:
option->integer = -1;
break;
- case GO_bytes_string_list:
- case GO_file_string_list:
- case GO_char_string_list:
+ case GOT_bytes_string_list:
+ case GOT_file_string_list:
+ case GOT_char_string_list:
option->strlist = new_string_list ();
break;
- case GO_char:
- case GO_bytes:
+ case GOT_char:
+ case GOT_bytes:
option->string = 0;
break;
- case GO_buttons:
+ case GOT_buttons:
option->buttons = 0;
break;
- case GO_icons:
+ case GOT_icons:
option->icons = (DIRECTION_ICON_LIST *)
malloc (sizeof (DIRECTION_ICON_LIST));
memset (option->icons, 0, sizeof (DIRECTION_ICON_LIST));
diff --git a/tp/maintain/regenerate_C_options_info.pl
b/tp/maintain/regenerate_C_options_info.pl
index 4d88ec2577..c825bbf96d 100755
--- a/tp/maintain/regenerate_C_options_info.pl
+++ b/tp/maintain/regenerate_C_options_info.pl
@@ -148,7 +148,7 @@ foreach my $category (sort(keys(%option_categories))) {
print CODE "\n/* ${category} */\n\n";
foreach my $option_info (@{$option_categories{$category}}) {
my ($option, $value, $type) = @$option_info;
- print CODE " initialize_option (&options->$option, GO_$type);\n";
+ print CODE " initialize_option (&options->$option, GOT_$type);\n";
}
}
print CODE "};\n\n";
@@ -248,9 +248,9 @@ foreach my $command_name (@commands_order) {
$char_value = '"'.$value.'"';
}
}
- print CODE "{GO_$type, $int_value, $char_value}, /* $command ($category)
*/\n";
+ print CODE "{GOT_$type, $int_value, $char_value}, /* $command
($category) */\n";
} else {
- print CODE "{GO_NONE, -2, 0},\n";
+ print CODE "{GOT_NONE, -2, 0},\n";
}
}