[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * po/Makevars (XGETTEXT_OPTIONS), tp/Texinfo/XS/m
From: |
Patrice Dumas |
Subject: |
branch master updated: * po/Makevars (XGETTEXT_OPTIONS), tp/Texinfo/XS/main/errors.c (vmessage_list_line_error, message_list_command_warn) (pmessage_list_command_warn): add a translation context to vmessage_list_line_error. Add the pmessage_list_command_warn function with a translation context and continuation. Add a continuation argument for message_list_command_warn. Update callers. |
Date: |
Sun, 10 Mar 2024 17:51:58 -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 01e64ea718 * po/Makevars (XGETTEXT_OPTIONS),
tp/Texinfo/XS/main/errors.c (vmessage_list_line_error,
message_list_command_warn) (pmessage_list_command_warn): add a translation
context to vmessage_list_line_error. Add the pmessage_list_command_warn
function with a translation context and continuation. Add a continuation
argument for message_list_command_warn. Update callers.
01e64ea718 is described below
commit 01e64ea718b6bd24fa4b48ce3b14f2451b9d14ef
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Mar 10 22:51:51 2024 +0100
* po/Makevars (XGETTEXT_OPTIONS), tp/Texinfo/XS/main/errors.c
(vmessage_list_line_error, message_list_command_warn)
(pmessage_list_command_warn): add a translation context to
vmessage_list_line_error. Add the pmessage_list_command_warn function
with a translation context and continuation. Add a continuation
argument for message_list_command_warn. Update callers.
* tp/Texinfo/Convert/HTML.pm (%XS_conversion_overrides),
tp/Texinfo/XS/convert/ConvertXS.xs (html_node_redirections),
tp/Texinfo/XS/convert/convert_html.c (html_node_redirections):
implement html_node_redirections and add an XS override.
* tp/Texinfo/Convert/HTML.pm (_node_redirections): remove extension
related ocde, it is not used. Rename $out_filename as $out_filepath.
---
ChangeLog | 17 ++
po/Makevars | 3 +-
tp/Texinfo/Convert/HTML.pm | 24 +-
tp/Texinfo/XS/convert/ConvertXS.xs | 22 +-
tp/Texinfo/XS/convert/convert_html.c | 258 ++++++++++++++++++++-
tp/Texinfo/XS/convert/convert_html.h | 2 +
tp/Texinfo/XS/convert/converter.c | 2 +-
tp/Texinfo/XS/convert/converter.h | 1 +
tp/Texinfo/XS/main/errors.c | 38 ++-
tp/Texinfo/XS/main/errors.h | 14 +-
tp/Texinfo/XS/main/manipulate_indices.c | 4 +-
tp/Texinfo/XS/parsetexi/errors_parser.c | 2 +-
tp/Texinfo/XS/structuring_transfo/structuring.c | 30 +--
.../XS/structuring_transfo/transformations.c | 2 +-
14 files changed, 365 insertions(+), 54 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 0ff56f9367..6de357042e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2024-03-10 Patrice Dumas <pertusus@free.fr>
+
+ * po/Makevars (XGETTEXT_OPTIONS), tp/Texinfo/XS/main/errors.c
+ (vmessage_list_line_error, message_list_command_warn)
+ (pmessage_list_command_warn): add a translation context to
+ vmessage_list_line_error. Add the pmessage_list_command_warn function
+ with a translation context and continuation. Add a continuation
+ argument for message_list_command_warn. Update callers.
+
+ * tp/Texinfo/Convert/HTML.pm (%XS_conversion_overrides),
+ tp/Texinfo/XS/convert/ConvertXS.xs (html_node_redirections),
+ tp/Texinfo/XS/convert/convert_html.c (html_node_redirections):
+ implement html_node_redirections and add an XS override.
+
+ * tp/Texinfo/Convert/HTML.pm (_node_redirections): remove extension
+ related ocde, it is not used. Rename $out_filename as $out_filepath.
+
2024-03-10 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/main/document.c
diff --git a/po/Makevars b/po/Makevars
index 79f58a587c..586e619fc0 100644
--- a/po/Makevars
+++ b/po/Makevars
@@ -29,7 +29,8 @@ XGETTEXT_OPTIONS = \
-kmessage_list_command_error:4 \
-kmessage_list_document_error:3 \
-kcommand_warn:2 \
- -kmessage_list_command_warn:4 \
+ -kmessage_list_command_warn:5 \
+ -kpmessage_list_command_warn:5c,6 \
-knoticed_line_warn:3 \
-kmessage_list_document_warn:3 \
-kline_error_ext:3 \
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 0f47adaaa4..d2dd5fcaac 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -287,6 +287,8 @@ my %XS_conversion_overrides = (
# => "Texinfo::Convert::ConvertXS::html_convert_tree",
"Texinfo::Convert::HTML::_prepare_node_redirection_page"
=> "Texinfo::Convert::ConvertXS::html_prepare_node_redirection_page",
+ "Texinfo::Convert::HTML::_node_redirections"
+ => "Texinfo::Convert::ConvertXS::html_node_redirections",
);
# XS initialization independent of customization
@@ -12589,10 +12591,6 @@ sub _node_redirections($$$$)
$self->{'current_filename'} = undef;
if ($self->get_conf('NODE_FILES')
and $labels_list and $output_file ne '') {
- my $extension = '';
- $extension = '.'.$self->get_conf('EXTENSION')
- if (defined($self->get_conf('EXTENSION'))
- and $self->get_conf('EXTENSION') ne '');
my %redirection_filenames;
foreach my $target_element (@$labels_list) {
@@ -12708,31 +12706,31 @@ sub _node_redirections($$$$)
= _prepare_node_redirection_page ($self, $target_element,
$redirection_filename);
- my $out_filename;
+ my $out_filepath;
if ($destination_directory ne '') {
- $out_filename = File::Spec->catfile($destination_directory,
+ $out_filepath = File::Spec->catfile($destination_directory,
$redirection_filename);
} else {
- $out_filename = $redirection_filename;
+ $out_filepath = $redirection_filename;
}
- my ($encoded_out_filename, $path_encoding)
- = $self->encoded_output_file_name($out_filename);
+ my ($encoded_out_filepath, $path_encoding)
+ = $self->encoded_output_file_name($out_filepath);
my ($file_fh, $error_message)
= Texinfo::Common::output_files_open_out(
$self->output_files_information(), $self,
- $encoded_out_filename);
+ $encoded_out_filepath);
if (!$file_fh) {
$self->converter_document_error(sprintf(__(
"could not open %s for writing: %s"),
- $out_filename, $error_message));
+ $out_filepath, $error_message));
} else {
print $file_fh $redirection_page;
Texinfo::Common::output_files_register_closed(
- $self->output_files_information(), $encoded_out_filename);
+ $self->output_files_information(), $encoded_out_filepath);
if (!close ($file_fh)) {
$self->converter_document_error(sprintf(__(
"error on closing redirection node file %s: %s"),
- $out_filename, $!));
+ $out_filepath, $!));
$self->conversion_finalization();
return undef;
}
diff --git a/tp/Texinfo/XS/convert/ConvertXS.xs
b/tp/Texinfo/XS/convert/ConvertXS.xs
index 8d50b360a6..1429311653 100644
--- a/tp/Texinfo/XS/convert/ConvertXS.xs
+++ b/tp/Texinfo/XS/convert/ConvertXS.xs
@@ -2250,4 +2250,24 @@ html_prepare_node_redirection_page (SV *converter_in, SV
*element_sv, redirectio
OUTPUT:
RETVAL
-
+SV *
+html_node_redirections (SV *converter_in, output_file, destination_directory,
...)
+ const char *output_file = (char *)SvPVutf8_nolen($arg);
+ const char *destination_directory = (char *)SvPVutf8_nolen($arg);
+ PROTOTYPE: $$$$
+ PREINIT:
+ CONVERTER *self;
+ int status = -1;
+ CODE:
+ self = get_sv_converter (converter_in, "html_node_redirections");
+ if (self)
+ {
+ status = html_node_redirections (self, output_file,
+ destination_directory);
+ }
+ if (status >= 0)
+ RETVAL = newSViv (status);
+ else
+ RETVAL = newSV (0);
+ OUTPUT:
+ RETVAL
diff --git a/tp/Texinfo/XS/convert/convert_html.c
b/tp/Texinfo/XS/convert/convert_html.c
index 8e0b13a1c6..651dae0ff9 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -3167,7 +3167,7 @@ external_node_href (CONVERTER *self, const ELEMENT
*external_node,
{
message_list_command_warn (&self->error_messages,
self->conf,
- source_command,
+ source_command, 0,
"no htmlxref.cnf entry found for `%s'",
manual_name);
}
@@ -8217,6 +8217,7 @@ format_element_footer (CONVERTER *self,
}
}
+/* return string to be freed by the caller */
char *
html_default_format_node_redirection_page (CONVERTER *self,
const ELEMENT *element,
@@ -8309,6 +8310,7 @@ html_default_format_node_redirection_page (CONVERTER
*self,
return result.text;
}
+/* return string to be freed by the caller */
char *format_node_redirection_page (CONVERTER *self, const ELEMENT *element,
const char *filename)
{
@@ -8328,6 +8330,7 @@ char *format_node_redirection_page (CONVERTER *self,
const ELEMENT *element,
}
}
+/* return string to be freed by the caller */
char *
html_prepare_node_redirection_page (CONVERTER *self, const ELEMENT *element,
const char *filename)
@@ -13119,7 +13122,7 @@ convert_printindex_command (CONVERTER *self, const enum
command_id cmd,
but the error message is printed only for the first entry formatting.
*/
message_list_command_warn (&self->error_messages,
self->conf,
- main_entry_element,
+ main_entry_element, 0,
"entry for index `%s' for @printindex %s outside of any node",
entry_index->name, index_name);
}
@@ -13159,7 +13162,7 @@ convert_printindex_command (CONVERTER *self, const enum
command_id cmd,
NOTE the index entry may be associated to a node in that case. */
message_list_command_warn (&self->error_messages,
self->conf,
- main_entry_element,
+ main_entry_element, 0,
"entry for index `%s' for @printindex %s outside of any section",
entry_index->name, index_name);
}
@@ -18781,22 +18784,259 @@ html_convert_output (CONVERTER *self, const ELEMENT
*root,
}
}
-/*
int
html_node_redirections (CONVERTER *self,
- const char *output_file, const char
*destination_directory)
+ const char *output_file, const char *destination_directory)
{
FILE_SOURCE_INFO_LIST *files_source_info = &self->files_source_info;
int redirection_files_done = 0;
if (self->document->identifiers_target && self->conf->NODE_FILES.integer > 0
&& strlen(output_file) > 0)
{
- const char *extension = 0;
+ const LABEL_LIST *label_targets = self->document->labels_list;
+ int i;
+ const ENCODING_CONVERSION *conversion = 0;
- if (self->conf->EXTENSION.string)
- extension = self->conf->EXTENSION.string;
+ if (self->conf->OUTPUT_ENCODING_NAME.string
+ && strcmp (self->conf->OUTPUT_ENCODING_NAME.string, "utf-8"))
+ {
+ conversion
+ = get_encoding_conversion (self->conf->OUTPUT_ENCODING_NAME.string,
+ &output_conversions);
+ }
+
+ for (i = 0; i < label_targets->number; i++)
+ {
+ const FILE_NUMBER_NAME *target_filename;
+ const ELEMENT *label_element;
+ const ELEMENT *target_element;
+ const char *node_filename;
+ LABEL *label = &label_targets->list[i];
+ const char *normalized;
+
+ if (!label->identifier || label->reference)
+ continue;
+
+ target_element = label->element;
+ label_element = get_label_element (target_element);
+
+ /* filename may not be defined in case of an @anchor or similar in
+ @titlepage, and @titlepage is not used. */
+ target_filename = html_command_filename (self, target_element);
+
+ /* NOTE 'node_filename' is not used for Top, TOP_NODE_FILE_TARGET
+ is. The other manual must use the same convention to get it
+ right. We do not do 'node_filename' as a redirection file
+ either. */
+ normalized = lookup_extra_string (target_element, "normalized");
+ if (normalized && !strcmp (normalized, "Top")
+ && self->conf->TOP_NODE_FILE_TARGET.string)
+ {
+ node_filename = self->conf->TOP_NODE_FILE_TARGET.string;
+ }
+ else
+ {
+ const HTML_TARGET *node_target
+ = html_get_target (self, target_element);
+ node_filename = node_target->node_filename;
+ }
+ if (target_filename && target_filename->filename
+ && strcmp (target_filename->filename, node_filename))
+ {
+ size_t file_idx
+ = register_normalize_case_filename (self, node_filename);
+ const FILE_NAME_PATH_COUNTER *output_unit_file
+ = &self->output_unit_files.list[file_idx];
+ char *redirection_filename = output_unit_file->filename;
+ int redirection_filename_total_count
+ = output_unit_file->elements_in_file_count;
+
+ FILE_SOURCE_INFO *file_source_info
+ = find_file_source_info (files_source_info,
+ redirection_filename);
+ if (file_source_info
+ /* first condition finds conflict with tree elements */
+ && (redirection_filename_total_count > 0
+ || !strcmp (file_source_info->type, "redirection")))
+ {
+ const char *file_info_type = file_source_info->type;
+ char *label_texi
+ = convert_contents_to_texinfo (label_element);
+ message_list_command_warn (&self->error_messages,
+ self->conf, target_element, 0,
+ "@%s `%s' file %s for redirection exists",
+ element_command_name (target_element),
+ label_texi, redirection_filename);
+ free (label_texi);
+
+ if (!strcmp (file_info_type, "special_file")
+ || !strcmp (file_info_type, "stand_in_file"))
+ {
+ const char *name = file_source_info->name;
+ if (!strcmp (name, "non_split"))
+ /* This cannot actually happen, as the @anchor/@node/@float
+ with potentially conflicting name will also be in the
+ non-split output document and therefore does not need
+ a redirection. */
+ message_list_document_warn (&self->error_messages,
+ self->conf, 1, "conflict with whole document file");
+ else if (!strcmp (name, "Top"))
+ message_list_document_warn (&self->error_messages,
+ self->conf, 1, "conflict with Top file");
+ else if (!strcmp (name, "user_defined"))
+ message_list_document_warn (&self->error_messages,
+ self->conf, 1, "conflict with user-defined file");
+ else if (!strcmp (name, "unknown_node"))
+ message_list_document_warn (&self->error_messages,
+ self->conf, 1, "conflict with unknown node file");
+ else if (!strcmp (name, "unknown"))
+ message_list_document_warn (&self->error_messages,
+ self->conf, 1,
+ "conflict with file without known source");
+ }
+ else if (!strcmp (file_info_type, "node"))
+ {
+ const ELEMENT *conflicting_node
+ = file_source_info->element;
+ char *node_texi
+ = convert_contents_to_texinfo
+ (conflicting_node->args.list[0]);
+ pmessage_list_command_warn (&self->error_messages,
+ self->conf, conflicting_node, 1,
+ "conflict of redirection file with file based on node name",
+ "conflict with @%s `%s' file",
+ element_command_name (conflicting_node),
+ node_texi);
+ free (node_texi);
+ }
+ else if (!strcmp (file_info_type, "redirection"))
+ {
+ const ELEMENT *conflicting_node
+ = file_source_info->element;
+ char *node_texi
+ = convert_contents_to_texinfo
+ (conflicting_node->args.list[0]);
+ message_list_command_warn (&self->error_messages,
+ self->conf, conflicting_node, 1,
+ "conflict with @%s `%s' redirection file",
+ element_command_name (conflicting_node),
+ node_texi);
+ free (node_texi);
+ }
+ else if (!strcmp (file_info_type, "section"))
+ {
+ const ELEMENT *conflicting_section
+ = file_source_info->element;
+ char *section_texi
+ = convert_contents_to_texinfo
+ (conflicting_section->args.list[0]);
+ pmessage_list_command_warn (&self->error_messages,
+ self->conf, conflicting_section, 1,
+ "conflict of redirection file with file based on section name",
+ "conflict with @%s `%s' file",
+ element_command_name (conflicting_section),
+ section_texi);
+ free (section_texi);
+ }
+ else if (!strcmp (file_info_type, "special_unit"))
+ {
+ const ELEMENT *unit_command
+ = file_source_info->element;
+ const OUTPUT_UNIT *special_unit
+ = unit_command->associated_unit;
+ message_list_document_warn (&self->error_messages,
+ self->conf, 1,
+ "conflict with %s special element",
+ special_unit->special_unit_variety);
+ }
+ }
+ else
+ {
+ char *redirection_page;
+ char *out_filepath;
+ char *path_encoding;
+ char *open_error_message;
+
+ add_to_files_source_info (files_source_info,
+ redirection_filename, "redirection", 0,
+ target_element, 0);
+
+ redirection_page
+ = html_prepare_node_redirection_page (self, target_element,
+ redirection_filename);
+ if (destination_directory && strlen (destination_directory))
+ {
+ xasprintf (&out_filepath, "%s/%s", destination_directory,
+ redirection_filename);
+ }
+ else
+ out_filepath = strdup (redirection_filename);
+
+ char *encoded_out_filepath
+ = encoded_output_file_name (self->conf,
+ self->document->global_info, out_filepath,
+ &path_encoding, 0);
+ FILE *file_fh
+ = output_files_open_out (&self->output_files_information,
+ encoded_out_filepath, &open_error_message, 0);
+ free (path_encoding);
+ if (!file_fh)
+ {
+ message_list_document_error (&self->error_messages,
+ self->conf, 0,
+ "could not open %s for writing: %s",
+ out_filepath, open_error_message);
+ }
+ else
+ {
+ char *result;
+ size_t res_len;
+ size_t write_len;
+
+ if (conversion)
+ {
+ result = encode_with_iconv (conversion->iconv,
+ redirection_page, 0);
+ res_len = strlen (result);
+ }
+ else
+ {
+ result = redirection_page;
+ res_len = strlen (redirection_page);
+ }
+ write_len = fwrite (result, sizeof (char),
+ res_len, file_fh);
+ if (conversion)
+ free (result);
+ if (write_len != res_len)
+ { /* register error message instead? */
+ fprintf (stderr,
+ "ERROR: write to %s failed (%zu/%zu)\n",
+ encoded_out_filepath, write_len, res_len);
+ free (encoded_out_filepath);
+ return -1;
+ }
+ output_files_register_closed
+ (&self->output_files_information,
+ encoded_out_filepath);
+ if (fclose (file_fh))
+ {
+ message_list_document_error (
+ &self->error_messages, self->conf, 0,
+ "error on closing %s: %s",
+ out_filepath, strerror (errno));
+ free (encoded_out_filepath);
+ return -1;
+ }
+ redirection_files_done++;
+ }
+ free (encoded_out_filepath);
+ free (out_filepath);
+ free (redirection_page);
+ }
+ }
+ }
}
return redirection_files_done;
}
-*/
diff --git a/tp/Texinfo/XS/convert/convert_html.h
b/tp/Texinfo/XS/convert/convert_html.h
index 1d4c572b35..6afd77c90b 100644
--- a/tp/Texinfo/XS/convert/convert_html.h
+++ b/tp/Texinfo/XS/convert/convert_html.h
@@ -237,6 +237,8 @@ char *html_convert_output (CONVERTER *self, const ELEMENT
*root,
char *html_prepare_node_redirection_page (CONVERTER *self,
const ELEMENT *element,
const char *filename);
+int html_node_redirections (CONVERTER *self,
+ const char *output_file, const char *destination_directory);
void html_check_transfer_state_finalization (CONVERTER *self);
void html_free_converter (CONVERTER *self);
diff --git a/tp/Texinfo/XS/convert/converter.c
b/tp/Texinfo/XS/convert/converter.c
index 46a545f36e..4b095c0e5f 100644
--- a/tp/Texinfo/XS/convert/converter.c
+++ b/tp/Texinfo/XS/convert/converter.c
@@ -767,7 +767,7 @@ add_output_units_file (CONVERTER *self, const char
*filename,
If CASE_INSENSITIVE_FILENAMES is set, reuse the first
filename with the same name insensitive to the case.
*/
-static size_t
+size_t
register_normalize_case_filename (CONVERTER *self, const char *filename)
{
size_t output_unit_file_idx;
diff --git a/tp/Texinfo/XS/convert/converter.h
b/tp/Texinfo/XS/convert/converter.h
index 76234cd95e..7d41067621 100644
--- a/tp/Texinfo/XS/convert/converter.h
+++ b/tp/Texinfo/XS/convert/converter.h
@@ -125,6 +125,7 @@ FLOAT_CAPTION_PREPENDED_ELEMENT *float_name_caption
(CONVERTER *self,
const ELEMENT *float_e);
void initialize_output_units_files (CONVERTER *self);
+size_t register_normalize_case_filename (CONVERTER *self, const char
*filename);
size_t set_output_unit_file (CONVERTER *self, OUTPUT_UNIT *output_unit,
const char *filename, int set_counter);
void set_file_path (CONVERTER *self, const char *filename, const char
*filepath,
diff --git a/tp/Texinfo/XS/main/errors.c b/tp/Texinfo/XS/main/errors.c
index b2de7edcc6..daa5ac6d09 100644
--- a/tp/Texinfo/XS/main/errors.c
+++ b/tp/Texinfo/XS/main/errors.c
@@ -127,15 +127,20 @@ message_list_line_formatted_message (ERROR_MESSAGE_LIST
*error_messages,
void
vmessage_list_line_error (ERROR_MESSAGE_LIST *error_messages,
- enum error_type type, int continuation,
+ enum error_type type,
+ int continuation,
int warn,
const SOURCE_INFO *cmd_source_info,
+ const char *translation_context,
const char *format, va_list v)
{
char *message;
#ifdef ENABLE_NLS
- xvasprintf (&message, gettext(format), v);
+ if (translation_context)
+ xvasprintf (&message, pgettext_expr (translation_context, format), v);
+ else
+ xvasprintf (&message, gettext(format), v);
#else
xvasprintf (&message, format, v);
#endif
@@ -245,20 +250,37 @@ message_list_line_error_ext (ERROR_MESSAGE_LIST
*error_messages,
va_start (v, format);
vmessage_list_line_error (error_messages, type, continuation,
(conf && conf->DEBUG.integer > 0),
- cmd_source_info, format, v);
+ cmd_source_info, 0, format, v);
}
void
message_list_command_warn (ERROR_MESSAGE_LIST *error_messages,
const OPTIONS *conf,
- const ELEMENT *e, const char *format, ...)
+ const ELEMENT *e, int continuation,
+ const char *format, ...)
{
va_list v;
va_start (v, format);
- vmessage_list_line_error (error_messages, MSG_warning, 0,
+ vmessage_list_line_error (error_messages, MSG_warning, continuation,
+ (conf && conf->DEBUG.integer > 0),
+ &e->source_info, 0, format, v);
+}
+
+void
+pmessage_list_command_warn (ERROR_MESSAGE_LIST *error_messages,
+ const OPTIONS *conf,
+ const ELEMENT *e,
+ int continuation,
+ const char *translation_context,
+ const char *format, ...)
+{
+ va_list v;
+
+ va_start (v, format);
+ vmessage_list_line_error (error_messages, MSG_warning, continuation,
(conf && conf->DEBUG.integer > 0),
- &e->source_info, format, v);
+ &e->source_info, translation_context, format, v);
}
/* similar as message_list_command_warn, to be used only when the calling
@@ -270,7 +292,7 @@ vmessage_list_command_warn (ERROR_MESSAGE_LIST
*error_messages,
{
vmessage_list_line_error (error_messages, MSG_warning, 0,
(conf && conf->DEBUG.integer > 0),
- &e->source_info, format, v);
+ &e->source_info, 0, format, v);
}
void
@@ -283,7 +305,7 @@ message_list_command_error (ERROR_MESSAGE_LIST
*error_messages,
va_start (v, format);
vmessage_list_line_error (error_messages, MSG_error, 0,
(conf && conf->DEBUG.integer > 0),
- &e->source_info, format, v);
+ &e->source_info, 0, format, v);
}
void
diff --git a/tp/Texinfo/XS/main/errors.h b/tp/Texinfo/XS/main/errors.h
index 36231249ab..6d3607262d 100644
--- a/tp/Texinfo/XS/main/errors.h
+++ b/tp/Texinfo/XS/main/errors.h
@@ -15,9 +15,10 @@ void message_list_line_formatted_message (ERROR_MESSAGE_LIST
*error_messages,
const SOURCE_INFO *cmd_source_info,
const char *message, int warn);
void vmessage_list_line_error (ERROR_MESSAGE_LIST *error_messages,
- enum error_type type, int continuation,
- int warn,
+ enum error_type type,
+ int continuation, int warn,
const SOURCE_INFO *cmd_source_info,
+ const char *translation_context,
const char *format, va_list v);
void message_list_line_error_ext (ERROR_MESSAGE_LIST *error_messages,
const OPTIONS *conf,
@@ -28,7 +29,14 @@ void message_list_command_error (ERROR_MESSAGE_LIST
*error_messages,
const ELEMENT *e, const char *format, ...);
void message_list_command_warn (ERROR_MESSAGE_LIST *error_messages,
const OPTIONS *conf,
- const ELEMENT *e, const char *format, ...);
+ const ELEMENT *e, int continuation,
+ const char *format, ...);
+void pmessage_list_command_warn (ERROR_MESSAGE_LIST *error_messages,
+ const OPTIONS *conf,
+ const ELEMENT *e,
+ int continuation,
+ const char *translation_context,
+ const char *format, ...);
void message_list_document_formatted_message (ERROR_MESSAGE_LIST
*error_messages,
const OPTIONS *conf,
diff --git a/tp/Texinfo/XS/main/manipulate_indices.c
b/tp/Texinfo/XS/main/manipulate_indices.c
index 93dac2fdcc..fbb4a5f986 100644
--- a/tp/Texinfo/XS/main/manipulate_indices.c
+++ b/tp/Texinfo/XS/main/manipulate_indices.c
@@ -455,7 +455,7 @@ setup_index_entries_sort_strings (ERROR_MESSAGE_LIST
*error_messages,
}
message_list_command_warn (error_messages, options,
- main_entry_element,
+ main_entry_element, 0,
"empty index key in @%s", entry_cmdname);
}
else
@@ -508,7 +508,7 @@ setup_index_entries_sort_strings (ERROR_MESSAGE_LIST
*error_messages,
}
message_list_command_warn (error_messages, options,
- main_entry_element,
+ main_entry_element, 0,
"empty index sub entry %zu key in @%s",
entry_sort_string.subentries_number -1,
entry_cmdname);
diff --git a/tp/Texinfo/XS/parsetexi/errors_parser.c
b/tp/Texinfo/XS/parsetexi/errors_parser.c
index d78d475112..150fba5465 100644
--- a/tp/Texinfo/XS/parsetexi/errors_parser.c
+++ b/tp/Texinfo/XS/parsetexi/errors_parser.c
@@ -46,7 +46,7 @@ line_error_internal (enum error_type type, int continuation,
{
vmessage_list_line_error (&error_messages_list,
type, continuation, debug_output, cmd_source_info,
- format, v);
+ 0, format, v);
}
void
diff --git a/tp/Texinfo/XS/structuring_transfo/structuring.c
b/tp/Texinfo/XS/structuring_transfo/structuring.c
index 9d830583cd..62887575ba 100644
--- a/tp/Texinfo/XS/structuring_transfo/structuring.c
+++ b/tp/Texinfo/XS/structuring_transfo/structuring.c
@@ -203,13 +203,13 @@ sectioning_structure (DOCUMENT *document)
condition means section level > 1, ie below chapter-level.
*/
message_list_command_warn (error_messages, options,
- content, "no chapter-level command before @%s",
+ content, 0, "no chapter-level command before
@%s",
builtin_command_name (content->cmd));
}
else
{
message_list_command_warn (error_messages, options,
- content,
+ content, 0,
"lowering the section level of @%s appearing after a lower element",
builtin_command_name (content->cmd));
level = sec_root_level +1;
@@ -358,7 +358,7 @@ sectioning_structure (DOCUMENT *document)
const ELEMENT_LIST *prev_toplvl_directions
= add_extra_directions (previous_toplevel,
"toplevel_directions");
-
+
prev_toplvl_directions->list[D_next] = content;
toplevel_directions->list[D_prev] = previous_toplevel;
}
@@ -376,7 +376,7 @@ sectioning_structure (DOCUMENT *document)
if (!part_associated_section)
{
message_list_command_warn (error_messages, options, content,
- "no sectioning command associated with @%s",
+ 0, "no sectioning command associated with @%s",
builtin_command_name (content->cmd));
}
}
@@ -403,7 +403,7 @@ warn_non_empty_parts (DOCUMENT *document)
{
ELEMENT *part = global_commands->part.list[i];
if (!is_content_empty (part, 0))
- message_list_command_warn (error_messages, options, part,
+ message_list_command_warn (error_messages, options, part, 0,
"@%s not empty", builtin_command_name (part->cmd));
}
}
@@ -438,7 +438,8 @@ check_menu_entry (DOCUMENT *document, enum command_id cmd,
{
char *entry_node_texi = link_element_to_texi (menu_entry_node);
char *menu_node_texi = target_element_to_texi_label (menu_node);
- message_list_command_warn (error_messages, options, menu_content,
+ message_list_command_warn (error_messages, options,
+ menu_content, 0,
"@%s entry node name `%s' different from %s name `%s'",
builtin_command_name (cmd), entry_node_texi,
builtin_command_name (menu_node->cmd), menu_node_texi);
@@ -779,7 +780,7 @@ check_nodes_are_referenced (DOCUMENT *document)
{
char *node_texi = target_element_to_texi_label(node);
nr_not_found++;
- message_list_command_warn (error_messages, options, node,
+ message_list_command_warn (error_messages, options, node, 0,
"node `%s' unreferenced",
node_texi);
free (node_texi);
@@ -841,7 +842,7 @@ set_menus_node_directions (DOCUMENT *document)
{
ELEMENT *menu = menus->list[j];
message_list_command_warn (error_messages, options,
- menu, "multiple @%s",
+ menu, 0, "multiple @%s",
builtin_command_name (menu->cmd));
}
}
@@ -1085,7 +1086,7 @@ complete_node_tree_with_menus (DOCUMENT *document)
= target_element_to_texi_label
(direction_associated_node);
message_list_command_warn (error_messages,
- options, node,
+ options, node, 0,
"node %s for `%s' is `%s' in sectioning but not in menu",
direction_names[d], node_texi,
direction_texi);
@@ -1121,7 +1122,7 @@ complete_node_tree_with_menus (DOCUMENT *document)
= target_element_to_texi_label
(elt_menu_direction);
message_list_command_warn (
- error_messages, options, node,
+ error_messages, options, node, 0,
"node `%s' is %s for `%s' in menu but not in sectioning",
entry_texi, direction_names[d], node_texi);
free (node_texi);
@@ -1221,7 +1222,7 @@ complete_node_tree_with_menus (DOCUMENT *document)
char *menu_dir_texi
= target_element_to_texi_label (menu_direction);
message_list_command_warn (error_messages, options,
- node,
+ node, 0,
"node %s pointer for `%s' is `%s' but %s is `%s' in menu",
direction_names[d], node_texi,
dir_texi, direction_names[d],
@@ -1289,7 +1290,7 @@ complete_node_tree_with_menus (DOCUMENT *document)
char *up_texi = target_element_to_texi_label (up_node);
char *node_texi = target_element_to_texi_label (node);
message_list_command_warn (error_messages, options,
- up_node,
+ up_node, 0,
"node `%s' lacks menu item for `%s' despite being its Up target",
up_texi, node_texi);
free (up_texi);
@@ -1459,7 +1460,7 @@ nodes_tree (DOCUMENT *document)
char *node_target_texi
= target_element_to_texi_label
(node_target);
message_list_command_warn (
- error_messages, options, node,
+ error_messages, options, node, 0,
"%s pointer `%s' (for node `%s') different from %s name `%s'",
direction_texts[direction],
direction_texi, node_texi,
@@ -1577,7 +1578,8 @@ associate_internal_references (DOCUMENT *document)
char *label_texi = link_element_to_texi (label_element);
char *target_texi
= target_element_to_texi_label (node_target);
- message_list_command_warn (error_messages, options, ref,
+ message_list_command_warn (error_messages,
+ options, ref, 0,
"@%s to `%s', different from %s name `%s'",
builtin_command_name (ref->cmd), label_texi,
builtin_command_name (node_target->cmd),
diff --git a/tp/Texinfo/XS/structuring_transfo/transformations.c
b/tp/Texinfo/XS/structuring_transfo/transformations.c
index 1632220518..1d2d09b876 100644
--- a/tp/Texinfo/XS/structuring_transfo/transformations.c
+++ b/tp/Texinfo/XS/structuring_transfo/transformations.c
@@ -1352,7 +1352,7 @@ protect_hashchar_at_line_beginning_internal (const char
*type,
{
message_list_command_warn (
error_messages, options,
- parent_for_warn ,
+ parent_for_warn, 0,
"could not protect hash character in @%s",
builtin_command_name (parent_for_warn->cmd));
break;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * po/Makevars (XGETTEXT_OPTIONS), tp/Texinfo/XS/main/errors.c (vmessage_list_line_error, message_list_command_warn) (pmessage_list_command_warn): add a translation context to vmessage_list_line_error. Add the pmessage_list_command_warn function with a translation context and continuation. Add a continuation argument for message_list_command_warn. Update callers.,
Patrice Dumas <=