1 /* Copyright (C) 1995 Free Software Foundation, Inc.
3 The GNU C Library is free software; you can redistribute it and/or
4 modify it under the terms of the GNU Library General Public License as
5 published by the Free Software Foundation; either version 2 of the
6 License, or (at your option) any later version.
8 The GNU C Library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
13 You should have received a copy of the GNU Library General Public
14 License along with the GNU C Library; see the file COPYING.LIB. If
15 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
16 Cambridge, MA 02139, USA. */
24 #include "localedef.h"
26 /* These are defined in locfile-parse.c. */
27 extern struct cat_item LC_MESSAGES_desc
[];
28 extern char *LC_MESSAGES_values
[];
35 /* First general check for existence. */
36 for (item_no
= 0; item_no
< category
[LC_MESSAGES
].number
; ++item_no
)
37 if (LC_MESSAGES_values
[item_no
] == NULL
)
41 errcode
= LC_MESSAGES_desc
[item_no
].status
== std
? 5 : 0;
43 error (errcode
, 0, gettext ("item `%s' of category `%s' undefined"),
44 LC_MESSAGES_desc
[item_no
].name
, "LC_MESSAGES");
48 /* Some fields need special tests. */
49 if (LC_MESSAGES_desc
[item_no
].item_id
== YESEXPR
50 || LC_MESSAGES_desc
[item_no
].item_id
== NOEXPR
)
51 /* The expression has to be a POSIX extended regular expression. */
56 result
= regcomp (&re
, LC_MESSAGES_values
[item_no
], REG_EXTENDED
);
62 (void) regerror (result
, &re
, errbuf
, BUFSIZ
);
63 error (0, 0, gettext ("no correct regular expression for "
64 "item `%s' in category `%s': %s"),
65 LC_MESSAGES_desc
[item_no
].name
, "LC_MESSAGES", errbuf
);