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, 4 Jan 2024 06:03:04 -0500 (EST)

branch: master
commit 6df148b4a61dcce100286a433895d795da76c78d
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Jan 4 08:19:49 2024 +0100

    * tp/Texinfo/Convert/Converter.pm (converter, set_conf),
    tp/Texinfo/XS/convert/converter.c (set_global_document_commands),
    tp/Texinfo/XS/main/converter_types.h (OPTION),
    tp/Texinfo/XS/main/get_perl_info.c (get_sv_options),
    tp/Texinfo/XS/main/utils.c (set_informative_command_value),
    tp/maintain/regenerate_C_options_info.pl: rename 'set'
    as 'configured'.
---
 ChangeLog                                | 10 ++++++
 tp/Texinfo/Convert/Converter.pm          | 12 ++++----
 tp/Texinfo/XS/convert/converter.c        |  4 +--
 tp/Texinfo/XS/main/converter_types.h     |  2 +-
 tp/Texinfo/XS/main/get_perl_info.c       | 52 +++++++++++++++++---------------
 tp/Texinfo/XS/main/get_perl_info.h       |  5 +--
 tp/Texinfo/XS/main/utils.c               |  2 +-
 tp/maintain/regenerate_C_options_info.pl |  8 ++---
 8 files changed, 54 insertions(+), 41 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fa7743e783..45c85badff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-01-04  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/Converter.pm (converter, set_conf),
+       tp/Texinfo/XS/convert/converter.c (set_global_document_commands),
+       tp/Texinfo/XS/main/converter_types.h (OPTION),
+       tp/Texinfo/XS/main/get_perl_info.c (get_sv_options),
+       tp/Texinfo/XS/main/utils.c (set_informative_command_value),
+       tp/maintain/regenerate_C_options_info.pl: rename 'set'
+       as 'configured'.
+
 2024-01-03  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/convert/get_html_perl_info.c
diff --git a/tp/Texinfo/Convert/Converter.pm b/tp/Texinfo/Convert/Converter.pm
index f5a541501f..4622dd2221 100644
--- a/tp/Texinfo/Convert/Converter.pm
+++ b/tp/Texinfo/Convert/Converter.pm
@@ -240,7 +240,7 @@ sub converter($;$)
   my $class = shift;
   my $conf = shift;
 
-  my $converter = { 'set' => {} };
+  my $converter = { 'configured' => {} };
 
   bless $converter, $class;
 
@@ -257,7 +257,6 @@ sub converter($;$)
       $converter->{$key} = $defaults{$key};
     }
   }
-  #$converter->{'converter_pre_conf'} = \%defaults;
   if (defined($conf)) {
     if ($conf->{'document'}) {
       $converter->{'global_commands'}
@@ -287,9 +286,10 @@ sub converter($;$)
       } else {
         $converter->{$key} = $conf->{$key};
       }
-      # configuration set here, in general coming from command-line
-      # will not be reset by set_conf.
-      $converter->{'set'}->{$key} = 1;
+      # configuration set here, from the argument of the converter,
+      # in general coming from command-line or from init files will not
+      # be reset by set_conf.
+      $converter->{'configured'}->{$key} = 1;
     }
   }
   # set $converter->{'converter_init_conf'} to the customization
@@ -631,7 +631,7 @@ sub set_conf($$$)
     die "BUG: set_conf: unknown option $conf\n";
     return undef;
   }
-  if ($self->{'set'}->{$conf}) {
+  if ($self->{'configured'}->{$conf}) {
     return 0;
   } else {
     if ($self->{'converter_descriptor'} and $XS_convert) {
diff --git a/tp/Texinfo/XS/convert/converter.c 
b/tp/Texinfo/XS/convert/converter.c
index b6c66a9948..2c0264fa87 100644
--- a/tp/Texinfo/XS/convert/converter.c
+++ b/tp/Texinfo/XS/convert/converter.c
@@ -189,7 +189,7 @@ set_global_document_commands (CONVERTER *converter,
             {
               OPTION *option_ref
                = get_command_option (converter->conf, cmd);
-              if (option_ref->set <= 0)
+              if (option_ref->configured <= 0)
                 copy_option (option_ref, option_value);
               free (option_value);
             }
@@ -220,7 +220,7 @@ set_global_document_commands (CONVERTER *converter,
                 {
                   OPTION *option_ref
                     = get_command_option (converter->conf, cmd);
-                  if (option_ref->set <= 0)
+                  if (option_ref->configured <= 0)
                     copy_option (option_ref, option_value);
                   free (option_value);
                 }
diff --git a/tp/Texinfo/XS/main/converter_types.h 
b/tp/Texinfo/XS/main/converter_types.h
index 9e455f2b22..443dcc9095 100644
--- a/tp/Texinfo/XS/main/converter_types.h
+++ b/tp/Texinfo/XS/main/converter_types.h
@@ -938,7 +938,7 @@ typedef struct DIRECTION_ICON_LIST {
 
 typedef struct OPTION {
     enum global_option_type type;
-    int set;
+    int configured;
     union {
       int integer;
       char *string;
diff --git a/tp/Texinfo/XS/main/get_perl_info.c 
b/tp/Texinfo/XS/main/get_perl_info.c
index 9f676e7d3f..e37af1a803 100644
--- a/tp/Texinfo/XS/main/get_perl_info.c
+++ b/tp/Texinfo/XS/main/get_perl_info.c
@@ -268,47 +268,49 @@ get_line_message (CONVERTER *self, enum error_type type, 
int continuation,
 }
 
 void
-get_sv_options (SV *sv, OPTIONS *options, CONVERTER *converter, SV *set_sv_in)
+get_sv_options (SV *sv, OPTIONS *options, CONVERTER *converter,
+                SV *configured_sv_in)
 {
   I32 hv_number;
   I32 i;
   HV *hv;
-  HV *set_hv = 0;
+  HV *configured_hv = 0;
 
   dTHX;
 
   hv = (HV *)SvRV (sv);
 
-  if (set_sv_in)
-    set_hv = (HV *)SvRV (set_sv_in);
+  if (configured_sv_in)
+    configured_hv = (HV *)SvRV (configured_sv_in);
 
   hv_number = hv_iterinit (hv);
   for (i = 0; i < hv_number; i++)
     {
-      int set = 0;
+      int configured = 0;
       char *key;
       I32 retlen;
       SV *value = hv_iternextsv(hv, &key, &retlen);
       if (value && SvOK (value))
         {
-          if (set_hv)
+          if (configured_hv)
             {
-              SV **value_set_sv = hv_fetch (set_hv, key, strlen (key), 0);
-              if (value_set_sv && SvOK (*value_set_sv)
-                  && SvIV (*value_set_sv))
-                set = 1;
+              SV **value_configured_sv
+                  = hv_fetch (configured_hv, key, strlen (key), 0);
+              if (value_configured_sv && SvOK (*value_configured_sv)
+                  && SvIV (*value_configured_sv))
+                configured = 1;
             }
-          get_sv_option (options, key, value, set, converter);
+          get_sv_option (options, key, value, configured, converter);
         }
     }
 }
 
 
 OPTIONS *
-copy_sv_options (SV *sv_in, CONVERTER *converter, SV *set_sv_in)
+copy_sv_options (SV *sv_in, CONVERTER *converter, SV *configured_sv_in)
 {
   OPTIONS *options = new_options ();
-  get_sv_options (sv_in, options, converter, set_sv_in);
+  get_sv_options (sv_in, options, converter, configured_sv_in);
   return options;
 }
 
@@ -491,15 +493,15 @@ converter_initialize (SV *converter_sv)
 
   if (conf_sv && SvOK (*conf_sv))
     {
-      SV **set_sv;
-      SV *set_arg = 0;
+      SV **configured_sv;
+      SV *configured_arg = 0;
 
-      FETCH(set);
+      FETCH(configured);
 
-      if (set_sv && SvOK (*set_sv))
-        set_arg = *set_sv;
+      if (configured_sv && SvOK (*configured_sv))
+        configured_arg = *configured_sv;
       converter->conf
-         = copy_sv_options (*conf_sv, converter, set_arg);
+         = copy_sv_options (*conf_sv, converter, configured_arg);
     }
 
   FETCH(converter_init_conf)
@@ -537,19 +539,19 @@ recopy_converter_conf_sv (HV *hv, CONVERTER *converter,
 
   if (conf_sv && SvOK(*conf_sv))
     {
-      SV **set_sv;
-      SV *set_arg = 0;
+      SV **configured_sv;
+      SV *configured_arg = 0;
 
       if (*conf)
         free_options (*conf);
       free (*conf);
 
-      set_sv = hv_fetch (hv, "set", strlen ("set"), 0);
+      configured_sv = hv_fetch (hv, "configured", strlen ("configured"), 0);
 
-      if (set_sv && SvOK (*set_sv))
-        set_arg = *set_sv;
+      if (configured_sv && SvOK (*configured_sv))
+        configured_arg = *configured_sv;
 
-      *conf = copy_sv_options (*conf_sv, converter, set_arg);
+      *conf = copy_sv_options (*conf_sv, converter, configured_arg);
     }
 }
 
diff --git a/tp/Texinfo/XS/main/get_perl_info.h 
b/tp/Texinfo/XS/main/get_perl_info.h
index d646071b47..bd9344e2d2 100644
--- a/tp/Texinfo/XS/main/get_perl_info.h
+++ b/tp/Texinfo/XS/main/get_perl_info.h
@@ -13,7 +13,7 @@
 
 /* in options_get_perl.c */
 void get_sv_option (OPTIONS *options, const char *key, SV *value,
-                    int set, CONVERTER *converter);
+                    int configured, CONVERTER *converter);
 
 DOCUMENT *get_sv_tree_document (SV *tree_in, char *warn_string);
 DOCUMENT *get_sv_document_document (SV *document_in, char *warn_string);
@@ -27,7 +27,8 @@ void add_svav_to_string_list (SV *sv, STRING_LIST 
*string_list,
 SOURCE_INFO *get_source_info (SV *source_info_sv);
 void get_line_message (CONVERTER *self, enum error_type type, int continuation,
                        SV *error_location_info, char *message);
-OPTIONS *copy_sv_options (SV *sv_in, CONVERTER *converter, SV *set_sv_in);
+OPTIONS *copy_sv_options (SV *sv_in, CONVERTER *converter,
+                          SV *configured_sv_in);
 void recopy_converter_conf_sv (HV *hv, CONVERTER *converter,
                                OPTIONS **conf, const char *conf_key);
 void set_conf (CONVERTER *converter, const char *conf, SV *value);
diff --git a/tp/Texinfo/XS/main/utils.c b/tp/Texinfo/XS/main/utils.c
index bc01f086e8..bafc9792ed 100644
--- a/tp/Texinfo/XS/main/utils.c
+++ b/tp/Texinfo/XS/main/utils.c
@@ -1076,7 +1076,7 @@ set_informative_command_value (OPTIONS *options, const 
ELEMENT *element)
   if (value)
     {
       OPTION *option = get_command_option (options, cmd);
-      if (option && option->set <= 0)
+      if (option && option->configured <= 0)
         {
           if (option->type == GO_integer)
             option->integer = strtoul (value, NULL, 10);
diff --git a/tp/maintain/regenerate_C_options_info.pl 
b/tp/maintain/regenerate_C_options_info.pl
index 7aa5885eb0..4ee3878456 100755
--- a/tp/maintain/regenerate_C_options_info.pl
+++ b/tp/maintain/regenerate_C_options_info.pl
@@ -250,7 +250,7 @@ print GET '#include "get_perl_info.h"'."\n";
 print GET '#include "build_perl_info.h"'."\n\n";
 
 print GET 'void
-get_sv_option (OPTIONS *options, const char *key, SV *value, int set, 
CONVERTER *converter)
+get_sv_option (OPTIONS *options, const char *key, SV *value, int configured, 
CONVERTER *converter)
 {
   dTHX;
 
@@ -272,9 +272,9 @@ foreach my $category (sort(keys(%option_categories))) {
     my ($option, $value, $type) = @$option_info;
     print GET "  else if (!strcmp (key, \"$option\"))
     {
-      if (set > 0)
-        options->$option.set = set;
-      else if (set < 0 && options->$option.set > 0)
+      if (configured > 0)
+        options->$option.configured = configured;
+      else if (configured < 0 && options->$option.configured > 0)
         return;\n\n";
     if ($type eq 'char' or $type eq 'bytes') {
       my $SV_function_type = 'utf8';



reply via email to

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