+2005-10-04 Bruno Haible <bruno@clisp.org>
+
+ * msgl-check.h (check_message_list): New declaration.
+ * msgl-check.c (check_message_list): New function.
+ * gettext-po.c (po_file_check_all, po_message_check_all): Call
+ check_message_list instead of check_message and check_plural.
+
2005-10-04 Bruno Haible <bruno@clisp.org>
Fix handling of obsolete messages.
mdlp = file->mdlp;
for (k = 0; k < mdlp->nitems; k++)
- {
- message_list_ty *mlp = mdlp->item[k]->messages;
- size_t j;
-
- for (j = 0; j < mlp->nitems; j++)
- {
- message_ty *mp = mlp->item[j];
-
- if (!mp->obsolete)
- check_message (mp, &mp->pos, 1, 1, 1, 0, 0, 0);
- }
-
- check_plural (mlp);
- }
+ check_message_list (mdlp->item[k]->messages, 1, 1, 1, 0, 0, 0);
/* Restore error handler. */
po_xerror = textmode_xerror;
(void (*) (int, const message_ty *, const char *, size_t, size_t, int, const char *, const message_ty *, const char *, size_t, size_t, int, const char *))
handler->xerror2;
- if (!mp->obsolete)
- check_message (mp, &mp->pos, 1, 1, 1, 0, 0, 0);
-
/* For plural checking, combine the message and its header into a small,
two-element message list. */
{
if (mp != header)
message_list_append (&ml, mp);
- check_plural (&ml);
+ check_message_list (&ml, 1, 1, 1, 0, 0, 0);
}
}
check_newlines, check_format_strings, check_compatibility,
check_accelerators, accelerator_char);
}
+
+
+/* Perform all checks on a message list.
+ Return nonzero if an error was seen. */
+int
+check_message_list (message_list_ty *mlp,
+ int check_newlines,
+ int check_format_strings,
+ int check_header,
+ int check_compatibility,
+ int check_accelerators, char accelerator_char)
+{
+ int seen_error = 0;
+ size_t j;
+
+ if (check_header)
+ if (check_plural (mlp))
+ seen_error = 1;
+
+ for (j = 0; j < mlp->nitems; j++)
+ {
+ message_ty *mp = mlp->item[j];
+
+ if (!mp->obsolete)
+ if (check_message (mp, &mp->pos,
+ check_newlines, check_format_strings,
+ check_header, check_compatibility,
+ check_accelerators, accelerator_char))
+ seen_error = 1;
+ }
+
+ return seen_error;
+}
int check_compatibility,
int check_accelerators, char accelerator_char);
+/* Perform all checks on a message list.
+ Return nonzero if an error was seen. */
+extern int check_message_list (message_list_ty *mlp,
+ int check_newlines,
+ int check_format_strings,
+ int check_header,
+ int check_compatibility,
+ int check_accelerators, char accelerator_char);
+
#ifdef __cplusplus
}