* gettext-tools/src/message.h: Improve comments regarding do_syntax_check.
* gettext-tools/src/msgl-cat.c (catenate_msgdomain_list): Don't manipulate
do_syntax_check field.
* gettext-tools/src/msgmerge.c (message_merge): Likewise.
* gettext-tools/src/read-catalog-special.h (parse_comment_special): Change 'scp'
parameter to a pointer.
* gettext-tools/src/read-catalog-special.c (parse_comment_special): Support a
null 'scp' argument.
* gettext-tools/src/read-catalog.h (DEFAULT_CATALOG_READER_TY): Remove
do_syntax_check field.
* gettext-tools/src/read-catalog.c (default_constructor,
default_copy_comment_state, default_reset_comment_state,
default_comment_special): Don't reference do_syntax_check field.
#endif
-/* Kinds of syntax checks which apply to strings. */
+/* Kinds of syntax checks which apply to an msgid. */
enum syntax_check_type
{
sc_ellipsis_unicode,
/* Do we want the string to be wrapped in the emitted PO file? */
enum is_wrap do_wrap;
- /* Do we want to apply extra syntax checks on the string? */
+ /* Do we want to apply or inhibit extra syntax checks on the string?
+ This is only relevant within xgettext. */
enum is_syntax_check do_syntax_check[NSYNTAXCHECKS];
/* The prev_msgctxt, prev_msgid and prev_msgid_plural strings appearing
/* Message list concatenation and duplicate handling.
- Copyright (C) 2001-2024 Free Software Foundation, Inc.
+ Copyright (C) 2001-2025 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software: you can redistribute it and/or modify
tmp->range.min = - INT_MAX;
tmp->range.max = - INT_MAX;
tmp->do_wrap = yes; /* may be set to no later */
- for (i = 0; i < NSYNTAXCHECKS; i++)
- tmp->do_syntax_check[i] = undecided; /* may be set to yes/no later */
tmp->obsolete = true; /* may be set to false later */
tmp->alternative_count = 0;
tmp->alternative = NULL;
tmp->is_format[i] = mp->is_format[i];
tmp->range = mp->range;
tmp->do_wrap = mp->do_wrap;
- for (i = 0; i < NSYNTAXCHECKS; i++)
- tmp->do_syntax_check[i] = mp->do_syntax_check[i];
tmp->prev_msgctxt = mp->prev_msgctxt;
tmp->prev_msgid = mp->prev_msgid;
tmp->prev_msgid_plural = mp->prev_msgid_plural;
}
if (tmp->do_wrap == undecided)
tmp->do_wrap = mp->do_wrap;
- for (i = 0; i < NSYNTAXCHECKS; i++)
- if (tmp->do_syntax_check[i] == undecided)
- tmp->do_syntax_check[i] = mp->do_syntax_check[i];
tmp->obsolete = false;
}
else
}
if (mp->do_wrap == no)
tmp->do_wrap = no;
- for (i = 0; i < NSYNTAXCHECKS; i++)
- if (mp->do_syntax_check[i] == yes)
- tmp->do_syntax_check[i] = yes;
- else if (mp->do_syntax_check[i] == no
- && tmp->do_syntax_check[i] == undecided)
- tmp->do_syntax_check[i] = no;
/* Don't fill tmp->prev_msgid in this case. */
if (!mp->obsolete)
tmp->obsolete = false;
result->do_wrap = ref->do_wrap;
- {
- size_t i;
- for (i = 0; i < NSYNTAXCHECKS; i++)
- result->do_syntax_check[i] = ref->do_syntax_check[i];
- }
-
/* Insert previous msgid, commented out with "#|".
Do so only when --previous is specified, for backward compatibility.
Since the "previous msgid" represents the original msgid that led to
/* Parsing of special comments (#, comments) in textual message catalogs.
- Copyright (C) 1995-2024 Free Software Foundation, Inc.
+ Copyright (C) 1995-2025 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
/* Parse a special comment and put the result in *fuzzyp, formatp, *rangep,
- *wrapp, scp. */
+ *wrapp, and, if scp != NULL, scp[0..NSYNTAXCHECKS-1]. */
void
parse_comment_special (const char *s,
bool *fuzzyp, enum is_format formatp[NFORMATS],
struct argument_range *rangep, enum is_wrap *wrapp,
- enum is_syntax_check scp[NSYNTAXCHECKS])
+ enum is_syntax_check *scp)
{
size_t i;
rangep->min = -1;
rangep->max = -1;
*wrapp = undecided;
- for (i = 0; i < NSYNTAXCHECKS; i++)
- scp[i] = undecided;
+ if (scp != NULL)
+ {
+ for (i = 0; i < NSYNTAXCHECKS; i++)
+ scp[i] = undecided;
+ }
while (*s != '\0')
{
}
/* Accept syntax check description. */
- if (len >= 6 && memcmp (t + len - 6, "-check", 6) == 0)
+ if (scp != NULL && len >= 6 && memcmp (t + len - 6, "-check", 6) == 0)
{
const char *p;
size_t n;
/* Parsing of special comments (#, comments) in textual message catalogs.
- Copyright (C) 1995-2024 Free Software Foundation, Inc.
+ Copyright (C) 1995-2025 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
/* Parse a special comment and put the result in *fuzzyp, formatp, *rangep,
- *wrapp, scp. */
+ *wrapp, and, if scp != NULL, scp[0..NSYNTAXCHECKS-1]. */
extern void parse_comment_special (const char *s, bool *fuzzyp,
enum is_format formatp[NFORMATS],
struct argument_range *rangep,
enum is_wrap *wrapp,
- enum is_syntax_check scp[NSYNTAXCHECKS]);
+ enum is_syntax_check *scp);
#ifdef __cplusplus
/* Reading textual message catalogs (such as PO files).
- Copyright (C) 1995-2024 Free Software Foundation, Inc.
+ Copyright (C) 1995-2025 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
This program is free software: you can redistribute it and/or modify
dcatr->range.min = -1;
dcatr->range.max = -1;
dcatr->do_wrap = undecided;
- for (i = 0; i < NSYNTAXCHECKS; i++)
- dcatr->do_syntax_check[i] = undecided;
}
mp->is_format[i] = dcatr->is_format[i];
mp->range = dcatr->range;
mp->do_wrap = dcatr->do_wrap;
- for (i = 0; i < NSYNTAXCHECKS; i++)
- mp->do_syntax_check[i] = dcatr->do_syntax_check[i];
}
dcatr->range.min = -1;
dcatr->range.max = -1;
dcatr->do_wrap = undecided;
- for (i = 0; i < NSYNTAXCHECKS; i++)
- dcatr->do_syntax_check[i] = undecided;
}
default_catalog_reader_ty *dcatr = (default_catalog_reader_ty *) catr;
parse_comment_special (s, &dcatr->is_fuzzy, dcatr->is_format, &dcatr->range,
- &dcatr->do_wrap, dcatr->do_syntax_check);
+ &dcatr->do_wrap, NULL);
}
enum is_format is_format[NFORMATS]; \
struct argument_range range; \
enum is_wrap do_wrap; \
- enum is_syntax_check do_syntax_check[NSYNTAXCHECKS]; \
typedef struct default_catalog_reader_ty default_catalog_reader_ty;
struct default_catalog_reader_ty