summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-01-26 09:22:30 +0000
committerUlrich Drepper <drepper@redhat.com>2001-01-26 09:22:30 +0000
commit3e154a6f9373a15924ffe226df044194b633e3ac (patch)
tree3ebb34aed6cf135cdc3006b20b54dda86e43e4e1
parent97ac0eafb88c12e24898a1a9fbf686446f944d10 (diff)
Update.
* locale/Makefile (headers): Add bits/locale.h. * locale/langinfo.h: Don't include <locale.h>. Include <bits/locale.h> and use __LC_ constants instead of LC_. * locale/locale.h: Include <bits/locale.h> and define LC_ constants using __LC_ constants. * locale/bits/locale.h: New file. * locale/loadlocale.c: Include <locale.h>. * locale/nl_langinfo.h: Likewise.
-rw-r--r--ChangeLog9
-rw-r--r--locale/Makefile4
-rw-r--r--locale/bits/locale.h44
-rw-r--r--locale/langinfo.h30
-rw-r--r--locale/loadlocale.c3
-rw-r--r--locale/locale.h29
-rw-r--r--locale/nl_langinfo.c3
7 files changed, 89 insertions, 33 deletions
diff --git a/ChangeLog b/ChangeLog
index 515d2bb5ba..a8bd0d6101 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2001-01-26 Ulrich Drepper <drepper@redhat.com>
+ * locale/Makefile (headers): Add bits/locale.h.
+ * locale/langinfo.h: Don't include <locale.h>. Include <bits/locale.h>
+ and use __LC_ constants instead of LC_.
+ * locale/locale.h: Include <bits/locale.h> and define LC_ constants
+ using __LC_ constants.
+ * locale/bits/locale.h: New file.
+ * locale/loadlocale.c: Include <locale.h>.
+ * locale/nl_langinfo.h: Likewise.
+
* posix/glob.h: Cleanup namespace for non-_GNU_SOURCE case.
* io/sys/stat.h: Define S_IFSOCK for XPG6.
diff --git a/locale/Makefile b/locale/Makefile
index b7a2849fd7..a62b647ac4 100644
--- a/locale/Makefile
+++ b/locale/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1991, 92, 1995-1999, 2000 Free Software Foundation, Inc.
+# Copyright (C) 1991, 92, 1995-1999, 2000, 2001 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -21,7 +21,7 @@
#
subdir := locale
-headers = locale.h langinfo.h xlocale.h
+headers = locale.h bits/locale.h langinfo.h xlocale.h
distribute = localeinfo.h categories.def iso-639.def iso-3166.def \
iso-4217.def weight.h weightwc.h strlen-hash.h elem-hash.h \
indigits.h indigitswc.h outdigits.h outdigitswc.h \
diff --git a/locale/bits/locale.h b/locale/bits/locale.h
new file mode 100644
index 0000000000..b15a9b0d78
--- /dev/null
+++ b/locale/bits/locale.h
@@ -0,0 +1,44 @@
+/* Definition of locale category symbol values.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#if !defined _LOCALE_H && !defined _LANGINFO_H
+# error "Never use <bits/locale.h> directly; include <locale.h> instead."
+#endif
+
+#ifndef _BITS_LOCALE_H
+#define _BITS_LOCALE_H 1
+
+enum
+{
+ __LC_CTYPE = 0,
+ __LC_NUMERIC = 1,
+ __LC_TIME = 2,
+ __LC_COLLATE = 3,
+ __LC_MONETARY = 4,
+ __LC_MESSAGES = 5,
+ __LC_ALL = 6,
+ __LC_PAPER = 7,
+ __LC_NAME = 8,
+ __LC_ADDRESS = 9,
+ __LC_TELEPHONE = 10,
+ __LC_MEASUREMENT = 11,
+ __LC_IDENTIFICATION = 12
+};
+
+#endif /* bits/locale.h */
diff --git a/locale/langinfo.h b/locale/langinfo.h
index 2e67413e18..8b58fabedd 100644
--- a/locale/langinfo.h
+++ b/locale/langinfo.h
@@ -1,5 +1,5 @@
/* Access to locale-dependent parameters.
- Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,11 +20,11 @@
#ifndef _LANGINFO_H
#define _LANGINFO_H 1
-#include <locale.h> /* Define the LC_* category names. */
-
/* Get the type definition. */
#include <nl_types.h>
+#include <bits/locale.h> /* Define the __LC_* category names. */
+
__BEGIN_DECLS
@@ -45,7 +45,7 @@ enum
/* LC_TIME category: date and time formatting. */
/* Abbreviated days of the week. */
- ABDAY_1 = _NL_ITEM (LC_TIME, 0), /* Sun */
+ ABDAY_1 = _NL_ITEM (__LC_TIME, 0), /* Sun */
#define ABDAY_1 ABDAY_1
ABDAY_2,
#define ABDAY_2 ABDAY_2
@@ -236,7 +236,7 @@ enum
/* LC_COLLATE category: text sorting.
This information is accessed by the strcoll and strxfrm functions.
These `nl_langinfo' names are used only internally. */
- _NL_COLLATE_NRULES = _NL_ITEM (LC_COLLATE, 0),
+ _NL_COLLATE_NRULES = _NL_ITEM (__LC_COLLATE, 0),
_NL_COLLATE_RULESETS,
_NL_COLLATE_TABLEMB,
_NL_COLLATE_WEIGHTMB,
@@ -259,7 +259,7 @@ enum
/* LC_CTYPE category: character classification.
This information is accessed by the functions in <ctype.h>.
These `nl_langinfo' names are used only internally. */
- _NL_CTYPE_CLASS = _NL_ITEM (LC_CTYPE, 0),
+ _NL_CTYPE_CLASS = _NL_ITEM (__LC_CTYPE, 0),
_NL_CTYPE_TOUPPER,
_NL_CTYPE_GAP1,
_NL_CTYPE_TOLOWER,
@@ -350,7 +350,7 @@ enum
/* LC_MONETARY category: formatting of monetary quantities.
These items each correspond to a member of `struct lconv',
defined in <locale.h>. */
- __INT_CURR_SYMBOL = _NL_ITEM (LC_MONETARY, 0),
+ __INT_CURR_SYMBOL = _NL_ITEM (__LC_MONETARY, 0),
#ifdef __USE_GNU
# define INT_CURR_SYMBOL __INT_CURR_SYMBOL
#endif
@@ -463,7 +463,7 @@ enum
/* LC_NUMERIC category: formatting of numbers.
These also correspond to members of `struct lconv'; see <locale.h>. */
- __DECIMAL_POINT = _NL_ITEM (LC_NUMERIC, 0),
+ __DECIMAL_POINT = _NL_ITEM (__LC_NUMERIC, 0),
#ifdef __USE_GNU
# define DECIMAL_POINT __DECIMAL_POINT
#endif
@@ -483,7 +483,7 @@ enum
_NL_NUMERIC_THOUSANDS_SEP_WC,
_NL_NUM_LC_NUMERIC,
- __YESEXPR = _NL_ITEM (LC_MESSAGES, 0), /* Regex matching ``yes'' input. */
+ __YESEXPR = _NL_ITEM (__LC_MESSAGES, 0), /* Regex matching ``yes'' input. */
#define YESEXPR __YESEXPR
__NOEXPR, /* Regex matching ``no'' input. */
#define NOEXPR __NOEXPR
@@ -497,11 +497,11 @@ enum
#endif
_NL_NUM_LC_MESSAGES,
- _NL_PAPER_HEIGHT = _NL_ITEM (LC_PAPER, 0),
+ _NL_PAPER_HEIGHT = _NL_ITEM (__LC_PAPER, 0),
_NL_PAPER_WIDTH,
_NL_NUM_LC_PAPER,
- _NL_NAME_NAME_FMT = _NL_ITEM (LC_NAME, 0),
+ _NL_NAME_NAME_FMT = _NL_ITEM (__LC_NAME, 0),
_NL_NAME_NAME_GEN,
_NL_NAME_NAME_MR,
_NL_NAME_NAME_MRS,
@@ -509,7 +509,7 @@ enum
_NL_NAME_NAME_MS,
_NL_NUM_LC_NAME,
- _NL_ADDRESS_POSTAL_FMT = _NL_ITEM (LC_ADDRESS, 0),
+ _NL_ADDRESS_POSTAL_FMT = _NL_ITEM (__LC_ADDRESS, 0),
_NL_ADDRESS_COUNTRY_NAME,
_NL_ADDRESS_COUNTRY_POST,
_NL_ADDRESS_COUNTRY_AB2,
@@ -523,16 +523,16 @@ enum
_NL_ADDRESS_LANG_LIB,
_NL_NUM_LC_ADDRESS,
- _NL_TELEPHONE_TEL_INT_FMT = _NL_ITEM (LC_TELEPHONE, 0),
+ _NL_TELEPHONE_TEL_INT_FMT = _NL_ITEM (__LC_TELEPHONE, 0),
_NL_TELEPHONE_TEL_DOM_FMT,
_NL_TELEPHONE_INT_SELECT,
_NL_TELEPHONE_INT_PREFIX,
_NL_NUM_LC_TELEPHONE,
- _NL_MEASUREMENT_MEASUREMENT = _NL_ITEM (LC_MEASUREMENT, 0),
+ _NL_MEASUREMENT_MEASUREMENT = _NL_ITEM (__LC_MEASUREMENT, 0),
_NL_NUM_LC_MEASUREMENT,
- _NL_IDENTIFICATION_TITLE = _NL_ITEM (LC_IDENTIFICATION, 0),
+ _NL_IDENTIFICATION_TITLE = _NL_ITEM (__LC_IDENTIFICATION, 0),
_NL_IDENTIFICATION_SOURCE,
_NL_IDENTIFICATION_ADDRESS,
_NL_IDENTIFICATION_CONTACT,
diff --git a/locale/loadlocale.c b/locale/loadlocale.c
index 8c7afda8ea..55c9a587f4 100644
--- a/locale/loadlocale.c
+++ b/locale/loadlocale.c
@@ -1,5 +1,5 @@
/* Functions to read locale data files.
- Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -21,6 +21,7 @@
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
+#include <locale.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
diff --git a/locale/locale.h b/locale/locale.h
index 5afa10c4dc..c17babc33e 100644
--- a/locale/locale.h
+++ b/locale/locale.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,92,95,96,97,98,99,2000 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,1995-1999,2000,2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,24 +27,25 @@
#define __need_NULL
#include <stddef.h>
+#include <bits/locale.h>
__BEGIN_DECLS
/* These are the possibilities for the first argument to setlocale.
The code assumes that the lowest LC_* symbol has the value zero. */
-#define LC_CTYPE 0
-#define LC_NUMERIC 1
-#define LC_TIME 2
-#define LC_COLLATE 3
-#define LC_MONETARY 4
-#define LC_MESSAGES 5
-#define LC_ALL 6
-#define LC_PAPER 7
-#define LC_NAME 8
-#define LC_ADDRESS 9
-#define LC_TELEPHONE 10
-#define LC_MEASUREMENT 11
-#define LC_IDENTIFICATION 12
+#define LC_CTYPE __LC_CTYPE
+#define LC_NUMERIC __LC_NUMERIC
+#define LC_TIME __LC_TIME
+#define LC_COLLATE __LC_COLLATE
+#define LC_MONETARY __LC_MONETARY
+#define LC_MESSAGES __LC_MESSAGES
+#define LC_ALL __LC_ALL
+#define LC_PAPER __LC_PAPER
+#define LC_NAME __LC_NAME
+#define LC_ADDRESS __LC_ADDRESS
+#define LC_TELEPHONE __LC_TELEPHONE
+#define LC_MEASUREMENT __LC_MEASUREMENT
+#define LC_IDENTIFICATION __LC_IDENTIFICATION
/* Structure giving information about numeric and monetary notation. */
diff --git a/locale/nl_langinfo.c b/locale/nl_langinfo.c
index 7d8c9ab586..48bdfeb7c8 100644
--- a/locale/nl_langinfo.c
+++ b/locale/nl_langinfo.c
@@ -1,5 +1,5 @@
/* User interface for extracting locale-dependent parameters.
- Copyright (C) 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1995,1996,1997,1999,2000,2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
Boston, MA 02111-1307, USA. */
#include <langinfo.h>
+#include <locale.h>
#include <errno.h>
#include <stddef.h>
#include "localeinfo.h"