Sun Feb 18 12:13:07 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
[glibc/history.git] / locale / numeric.c
blob93f4bc481e1c92a3f515c6749eae377114622d32
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. */
18 #include <langinfo.h>
19 #include <libintl.h>
20 #include <locale.h>
22 #include "localedef.h"
24 /* These are defined in locfile-parse.c. */
25 extern struct cat_item LC_NUMERIC_desc[];
26 extern char *LC_NUMERIC_values[];
28 void
29 numeric_check(void)
31 int item_no;
33 /* First general check for existence. */
34 for (item_no = 0; item_no < category[LC_NUMERIC].number; ++item_no)
35 if (LC_NUMERIC_values[item_no] == NULL)
37 int errcode;
39 errcode = LC_NUMERIC_desc[item_no].status = std ? 5 : 0;
41 error (errcode, 0, gettext ("item `%s' of category `%s' undefined"),
42 LC_NUMERIC_desc[item_no].name, "LC_NUMERIC");
44 else
46 if (LC_NUMERIC_desc[item_no].item_id == DECIMAL_POINT
47 && LC_NUMERIC_values[item_no][0] == '\0')
48 /* The decimal point must not be empty. This is not said
49 explicitly in POSIX but ANSI C (ISO/IEC 9899) says in
50 4.4.2.1 it has to be != "". */
51 error (0, 0,
52 gettext ("item `%s' in category `%s' must not be empty"),
53 LC_NUMERIC_desc[item_no].name, "LC_NUMERIC");
58 * Local Variables:
59 * mode:c
60 * c-basic-offset:2
61 * End: