[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/Convert/Converter.pm (_generic_conve
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/Convert/Converter.pm (_generic_converter_init): update warning message. |
Date: |
Wed, 02 Oct 2024 17:15:15 -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 d039097d1b * tp/Texinfo/Convert/Converter.pm
(_generic_converter_init): update warning message.
d039097d1b is described below
commit d039097d1b23242934ecbf551e871f28f6f070e9
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Aug 4 11:39:42 2024 +0200
* tp/Texinfo/Convert/Converter.pm (_generic_converter_init): update
warning message.
* tp/Texinfo/XS/convert/ConvertXS.xs (generic_converter_init),
tp/Texinfo/XS/main/get_perl_info.c (get_converter_info_from_sv)
(converter_get_info_from_sv): pass Perl class down to
get_converter_info_from_sv. Issue a message for an unknown
customization option.
---
ChangeLog | 11 ++++++++++
tp/Texinfo/Convert/Converter.pm | 2 +-
tp/Texinfo/XS/convert/ConvertXS.xs | 5 ++++-
tp/Texinfo/XS/convert/get_converter_perl_info.c | 29 ++++++++++++++++---------
tp/Texinfo/XS/convert/get_converter_perl_info.h | 3 ++-
5 files changed, 37 insertions(+), 13 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 4618611667..9a1dd1fbf0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-08-04 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Convert/Converter.pm (_generic_converter_init): update
+ warning message.
+
+ * tp/Texinfo/XS/convert/ConvertXS.xs (generic_converter_init),
+ tp/Texinfo/XS/main/get_perl_info.c (get_converter_info_from_sv)
+ (converter_get_info_from_sv): pass Perl class down to
+ get_converter_info_from_sv. Issue a message for an unknown
+ customization option.
+
2024-08-04 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Convert/Converter.pm (_generic_converter_init),
diff --git a/tp/Texinfo/Convert/Converter.pm b/tp/Texinfo/Convert/Converter.pm
index 2b215c3339..4c4854babb 100644
--- a/tp/Texinfo/Convert/Converter.pm
+++ b/tp/Texinfo/Convert/Converter.pm
@@ -295,7 +295,7 @@ sub _generic_converter_init($$$;$)
if (Texinfo::Common::valid_customization_option($key)) {
$converter->{'conf'}->{$key} = $conf->{$key};
} elsif (!exists($defaults{$key})) {
- warn "$key not a possible configuration in $class\n";
+ warn "$class: $key not a possible configuration\n";
} else {
$converter->{$key} = $conf->{$key};
}
diff --git a/tp/Texinfo/XS/convert/ConvertXS.xs
b/tp/Texinfo/XS/convert/ConvertXS.xs
index 44f0c1bab3..8e5ff79d12 100644
--- a/tp/Texinfo/XS/convert/ConvertXS.xs
+++ b/tp/Texinfo/XS/convert/ConvertXS.xs
@@ -89,6 +89,8 @@ init (int texinfo_uninstalled, SV *pkgdatadir_sv, SV
*tp_builddir_sv, SV *top_sr
OUTPUT:
RETVAL
+# NOTE not sure what the scope of class is. In a test, valgrind did not
+# complain.
void
generic_converter_init (SV *converter_in, const char *class, SV
*format_defaults_sv, SV *conf_sv=0)
PREINIT:
@@ -103,7 +105,8 @@ generic_converter_init (SV *converter_in, const char
*class, SV *format_defaults
format_defaults = new_converter_initialization_info ();
conf = new_converter_initialization_info ();
- converter_get_info_from_sv (converter_in, self, format_defaults_sv,
+ converter_get_info_from_sv (converter_in, class, self,
+ format_defaults_sv,
conf_sv, format_defaults, conf);
set_converter_init_information (self, format_defaults, conf);
diff --git a/tp/Texinfo/XS/convert/get_converter_perl_info.c
b/tp/Texinfo/XS/convert/get_converter_perl_info.c
index 085e9794e8..c00e89fab8 100644
--- a/tp/Texinfo/XS/convert/get_converter_perl_info.c
+++ b/tp/Texinfo/XS/convert/get_converter_perl_info.c
@@ -158,8 +158,10 @@ get_option_from_sv (OPTION *option, SV *option_sv,
CONVERTER *converter,
return status;
}
+/* class is Perl converter class for warning message */
static int
-get_converter_info_from_sv (SV *conf_sv, CONVERTER *converter,
+get_converter_info_from_sv (SV *conf_sv, const char *class,
+ CONVERTER *converter,
OPTION **sorted_options,
CONVERTER_INITIALIZATION_INFO *initialization_info)
{
@@ -211,12 +213,16 @@ get_converter_info_from_sv (SV *conf_sv, CONVERTER
*converter,
else if (!strcmp (key, "converted_format"))
initialization_info->converted_format
= non_perl_strdup (SvPVutf8_nolen (value));
- /* TODO in defaults here means in format_defaults or
- non customization variable
- in Texinfo::Convert::Converter::common_converters_defaults
- } elsif (!exists($defaults{$key})) {
- warn "$key not a possible configuration in $class\n";
- */
+ else if (!strcmp (key, "texinfo_language_config_dirs"))
+ {
+ /* TODO add to converter and set. Only used for
+ htmlxref, so should wait for that to implement */
+ }
+ else
+ {
+ fprintf (stderr, "%s: %s not a possible configuration\n",
+ class, key);
+ }
}
else
fprintf (stderr, "ERROR: %s unexpected conf error\n", key);
@@ -255,8 +261,11 @@ set_non_customization_sv (HV *converter_hv, SV
*init_info_sv,
}
}
+/* CLASS is the perl converter class. It could also be taken from
+ the object and is only used for a warning */
int
-converter_get_info_from_sv (SV *converter_sv, CONVERTER *converter,
+converter_get_info_from_sv (SV *converter_sv, const char *class,
+ CONVERTER *converter,
SV *format_defaults_sv, SV *conf_sv,
CONVERTER_INITIALIZATION_INFO *format_defaults,
CONVERTER_INITIALIZATION_INFO *conf)
@@ -272,10 +281,10 @@ converter_get_info_from_sv (SV *converter_sv, CONVERTER
*converter,
converter->hv = converter_hv;
has_format_defaults
- = get_converter_info_from_sv (format_defaults_sv, converter,
+ = get_converter_info_from_sv (format_defaults_sv, class, converter,
converter->sorted_options, format_defaults);
- has_conf = get_converter_info_from_sv (conf_sv, converter,
+ has_conf = get_converter_info_from_sv (conf_sv, class, converter,
converter->sorted_options, conf);
/* set directly Perl converter keys with non 'valid' customization info */
diff --git a/tp/Texinfo/XS/convert/get_converter_perl_info.h
b/tp/Texinfo/XS/convert/get_converter_perl_info.h
index 2e1fbcbcdf..e17c851e22 100644
--- a/tp/Texinfo/XS/convert/get_converter_perl_info.h
+++ b/tp/Texinfo/XS/convert/get_converter_perl_info.h
@@ -12,7 +12,8 @@ struct TEXT_OPTIONS;
CONVERTER *get_sv_converter (SV *sv_in, const char *warn_string);
CONVERTER *converter_set_document_from_sv (SV *converter_in, SV *document_in);
-int converter_get_info_from_sv (SV *converter_sv, CONVERTER *converter,
+int converter_get_info_from_sv (SV *converter_sv, const char *class,
+ CONVERTER *converter,
SV *format_defaults_sv, SV *conf_sv,
CONVERTER_INITIALIZATION_INFO *format_defaults,
CONVERTER_INITIALIZATION_INFO *conf);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/Convert/Converter.pm (_generic_converter_init): update warning message.,
Patrice Dumas <=