* gettext-tools/src/msgcmp.c: Include po-xerror.h, xvasprintf.h.
(match_domain, compare): Use po_xerror, po_xerror2 instead of
po_gram_error_at_line.
* gettext-tools/src/msgfmt.c: Include po-xerror.h.
(msgfmt_set_domain): Use po_xerror instead of po_gram_error_at_line.
* gettext-tools/src/msgmerge.c: Include xvasprintf.h.
(match_domain): Use po_xerror, po_xerror2 instead of po_gram_error_at_line.
* gettext-tools/src/read-catalog.c (default_set_domain): Use po_xerror instead
of po_gram_error_at_line.
* gettext-tools/src/xgettext.c: Include po-xerror.h.
(exclude_directive_domain): Use po_xerror instead of po_gram_error_at_line.
#include "read-properties.h"
#include "read-stringtable.h"
#include "xmalloca.h"
+#include "po-xerror.h"
+#include "xvasprintf.h"
#include "po-charset.h"
#include "msgl-iconv.h"
#include "msgl-fsearch.h"
if (!include_untranslated && defmsg->msgstr[0] == '\0')
{
(*nerrors)++;
- po_gram_error_at_line (&defmsg->pos,
- _("this message is untranslated"));
+ po_xerror (PO_SEVERITY_ERROR, defmsg, NULL, 0, 0, false,
+ _("this message is untranslated"));
}
else if (!include_fuzzies && defmsg->is_fuzzy && !is_header (defmsg))
{
(*nerrors)++;
- po_gram_error_at_line (&defmsg->pos,
- _("this message needs to be reviewed by the translator"));
+ po_xerror (PO_SEVERITY_ERROR, defmsg, NULL, 0, 0, false,
+ _("this message needs to be reviewed by the translator"));
}
else
defmsg->used = 1;
defmsg = NULL;
if (defmsg)
{
- po_gram_error_at_line (&refmsg->pos,
- _("this message is used but not defined..."));
- error_message_count--;
- po_gram_error_at_line (&defmsg->pos,
- _("...but this definition is similar"));
+ po_xerror2 (PO_SEVERITY_ERROR,
+ refmsg, NULL, 0, 0, false,
+ _("this message is used but not defined"),
+ defmsg, NULL, 0, 0, false,
+ _("but this definition is similar"));
defmsg->used = 1;
}
else
- po_gram_error_at_line (&refmsg->pos,
- _("this message is used but not defined in %s"),
- fn1);
+ po_xerror (PO_SEVERITY_ERROR, refmsg, NULL, 0, 0, false,
+ xasprintf (
+ _("this message is used but not defined in %s"),
+ fn1));
}
}
}
message_ty *defmsg = defmlp->item[j];
if (!defmsg->used)
- po_gram_error_at_line (&defmsg->pos,
- _("warning: this message is not used"));
+ po_xerror (PO_SEVERITY_ERROR, defmsg, NULL, 0, 0, false,
+ _("warning: this message is not used"));
}
}
#include "read-properties.h"
#include "read-stringtable.h"
#include "read-desktop.h"
+#include "po-xerror.h"
#include "po-charset.h"
#include "msgl-check.h"
#include "msgl-iconv.h"
else
{
if (check_domain)
- po_gram_error_at_line (name_pos,
- _("'domain %s' directive ignored"), name);
+ po_xerror (PO_SEVERITY_ERROR, NULL,
+ name_pos->file_name, name_pos->line_number, (size_t)(-1),
+ false,
+ xasprintf (_("'domain %s' directive ignored"), name));
/* NAME was allocated in read-po-gram.y but is not used anywhere. */
free (name);
#include "plural-count.h"
#include "msgl-check.h"
#include "po-xerror.h"
+#include "xvasprintf.h"
#include "backupfile.h"
#include "copy-file.h"
#include "propername.h"
message_ty *mp;
if (verbosity_level > 1)
- {
- po_gram_error_at_line (&refmsg->pos,
- _("this message is used but not defined..."));
- error_message_count--;
- po_gram_error_at_line (&defmsg->pos,
- _("...but this definition is similar"));
- }
+ po_xerror2 (PO_SEVERITY_ERROR,
+ refmsg, NULL, 0, 0, false,
+ _("this message is used but not defined"),
+ defmsg, NULL, 0, 0, false,
+ _("but this definition is similar"));
/* Merge the reference with the definition: take the #. and
#: comments from the reference, take the # comments from
const char *pend;
if (verbosity_level > 1)
- po_gram_error_at_line (&refmsg->pos,
- _("this message is used but not defined in %s"),
- fn1);
+ po_xerror (PO_SEVERITY_ERROR, refmsg, NULL, 0, 0, false,
+ xasprintf (
+ _("this message is used but not defined in %s"),
+ fn1));
mp = message_copy (refmsg);
unsigned long i;
if (verbosity_level > 1)
- po_gram_error_at_line (&mp->pos,
- _("this message should define plural forms"));
+ po_xerror (PO_SEVERITY_ERROR, mp, NULL, 0, 0, false,
+ _("this message should define plural forms"));
new_msgstr_len = nplurals * mp->msgstr_len;
new_msgstr = XNMALLOC (new_msgstr_len, char);
Use only the first among the plural forms. */
if (verbosity_level > 1)
- po_gram_error_at_line (&mp->pos,
- _("this message should not define plural forms"));
+ po_xerror (PO_SEVERITY_ERROR, mp, NULL, 0, 0, false,
+ _("this message should not define plural forms"));
mp->msgstr_len = strlen (mp->msgstr) + 1;
mp->is_fuzzy = true;
dcatr->domain = name;
else
{
- po_gram_error_at_line (name_pos,
- _("this file may not contain domain directives"));
+ po_xerror (PO_SEVERITY_ERROR, NULL,
+ name_pos->file_name, name_pos->line_number, (size_t)(-1),
+ false, _("this file may not contain domain directives"));
/* NAME was allocated in read-po-gram.y but is not used anywhere. */
free (name);
#include "read-po-lex.h"
#include "message.h"
#include "pos.h"
+#include "po-xerror.h"
#include "po-charset.h"
#include "msgl-iconv.h"
#include "msgl-ascii.h"
exclude_directive_domain (abstract_catalog_reader_ty *catr,
char *name, lex_pos_ty *name_pos)
{
- po_gram_error_at_line (name_pos,
- _("this file may not contain domain directives"));
+ po_xerror (PO_SEVERITY_ERROR, NULL,
+ name_pos->file_name, name_pos->line_number, (size_t)(-1), false,
+ _("this file may not contain domain directives"));
}