From 4a33c2f55eab04206e22ab972a77f62486fe5a97 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 13 Sep 1999 09:07:36 +0000 Subject: Update. 1999-09-13 Ulrich Drepper * locale/langinfo.h: Remove byte-order dependent names. * locale/categories.def: Update after removal of byte-order dependent names. * locale/loadlocale.c (_nl_load_locale): Don't allow locale files with magic number in other byte order. * locale/newlocale.c (__newlocale): Remove byte-order dependent code. * locale/C-collate.c: Remove initializers for other byte-order. * locale/C-ctype.c: Likewise. * locale/C-monetary.c: Likewise. * locale/C-paper.c: Likewise. * locale/C-time.c: Likewise. * locale/lc-collate.c: Remove byte-order oriented initialization. * locale/lc-ctype.c: Likewise. * locale/lc-monetary.c: Likewise. * locale/lc-time.c: Likewise. * locale/programs/ld-address.c: Don't generate output in both byte-orders. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-time.c: Likewise. * time/strftime.c (NLW): Don't use different byte-orders. * wctype/cname-lookup.h (cname_lookup): Likewise. * Makeconfig (localedir): Define using libdir, not datadir. (msgcatdir): New variable. * catgets/Makefile (CPPFLAGS): Define NLSPATH using msgcatdir. * elf/Makefile (bash-ldd-rewrite): Replace @TEXTDOMAINDIR@ using msgcatdir. * intl/Makefile (install-others): Install locale.alias in msgcatdir. (CPPFLAGS): Define paths using msgcatdir. * locale/Makefile (CPPFLAGS): Define LOCALE_ALIAS_PATH using msgcatdir. * po/Makefile (mo-installed): Define using msgcatdir. * sysdeps/unix/sysv/linux/net/if_arp.h: Fix typo. --- BUGS | 16 +- ChangeLog | 37 +++ Makeconfig | 12 +- catgets/Makefile | 4 +- elf/Makefile | 2 +- elf/link.h | 2 +- intl/Makefile | 10 +- locale/C-collate.c | 16 +- locale/C-ctype.c | 90 +------- locale/C-monetary.c | 6 +- locale/C-paper.c | 6 +- locale/C-time.c | 1 - locale/Makefile | 2 +- locale/categories.def | 112 ++++------ locale/langinfo.h | 305 +++++++++---------------- locale/lc-collate.c | 19 +- locale/lc-ctype.c | 15 +- locale/lc-monetary.c | 23 +- locale/lc-time.c | 19 +- locale/loadlocale.c | 41 +--- locale/newlocale.c | 13 +- locale/programs/ld-address.c | 17 +- locale/programs/ld-ctype.c | 361 +++++++----------------------- locale/programs/ld-paper.c | 31 +-- locale/programs/ld-time.c | 420 +++-------------------------------- localedata/ChangeLog | 4 + localedata/locales/id_ID | 7 +- po/Makefile | 4 +- sysdeps/unix/sysv/linux/net/if_arp.h | 2 +- time/strftime.c | 6 +- wctype/cname-lookup.h | 28 +-- 31 files changed, 363 insertions(+), 1268 deletions(-) diff --git a/BUGS b/BUGS index 2f44568200..53edfecc14 100644 --- a/BUGS +++ b/BUGS @@ -1,7 +1,7 @@ List of known bugs (certainly very incomplete) ---------------------------------------------- -Time-stamp: <1999-07-29T15:25:53-0700 drepper> +Time-stamp: <1999-09-13T02:02:34-0700 drepper> This following list contains those bugs which I'm aware of. Please make sure that bugs you report are not listed here. If you can fix one @@ -39,26 +39,12 @@ Severity: [ *] to [***] symbols in available. [PR libc/140] -[ *] The localedef program should not generate errors if for categories - which are not used for the output there are characters referenced - which are not defined in the charmap. - [PR libc/229] - -[ *] When assembling a locale definition, that uses the "copy" - directive, with localedef, not only the copied category is - checked for errors, but the whole file containing the same - category. - [PR libc/207 and PR libc/454] - [ *] The libm-ieee `gamma' function gives wrong results (at least for -0.5). [ *] The libm-ieee `scalb' function gives wrong results for non-integral second parameters. -[ *] The strftime() implementation cannot handle multibyte locales really - good since the TOLOWER and TOUPPER are not prepared. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ulrich Drepper drepper@cygnus.com diff --git a/ChangeLog b/ChangeLog index eed31e6480..2b63f1ee36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,40 @@ +1999-09-13 Ulrich Drepper + + * locale/langinfo.h: Remove byte-order dependent names. + * locale/categories.def: Update after removal of byte-order dependent + names. + * locale/loadlocale.c (_nl_load_locale): Don't allow locale files + with magic number in other byte order. + * locale/newlocale.c (__newlocale): Remove byte-order dependent code. + * locale/C-collate.c: Remove initializers for other byte-order. + * locale/C-ctype.c: Likewise. + * locale/C-monetary.c: Likewise. + * locale/C-paper.c: Likewise. + * locale/C-time.c: Likewise. + * locale/lc-collate.c: Remove byte-order oriented initialization. + * locale/lc-ctype.c: Likewise. + * locale/lc-monetary.c: Likewise. + * locale/lc-time.c: Likewise. + * locale/programs/ld-address.c: Don't generate output in both + byte-orders. + * locale/programs/ld-ctype.c: Likewise. + * locale/programs/ld-paper.c: Likewise. + * locale/programs/ld-time.c: Likewise. + * time/strftime.c (NLW): Don't use different byte-orders. + * wctype/cname-lookup.h (cname_lookup): Likewise. + + * Makeconfig (localedir): Define using libdir, not datadir. + (msgcatdir): New variable. + * catgets/Makefile (CPPFLAGS): Define NLSPATH using msgcatdir. + * elf/Makefile (bash-ldd-rewrite): Replace @TEXTDOMAINDIR@ using + msgcatdir. + * intl/Makefile (install-others): Install locale.alias in msgcatdir. + (CPPFLAGS): Define paths using msgcatdir. + * locale/Makefile (CPPFLAGS): Define LOCALE_ALIAS_PATH using msgcatdir. + * po/Makefile (mo-installed): Define using msgcatdir. + + * sysdeps/unix/sysv/linux/net/if_arp.h: Fix typo. + 1999-09-12 Ulrich Drepper * stdio-common/vfprintf.c: Remove limitation on size of precision diff --git a/Makeconfig b/Makeconfig index fb11c28691..7bee724e1a 100644 --- a/Makeconfig +++ b/Makeconfig @@ -205,13 +205,19 @@ zonedir = $(datadir)/zoneinfo endif inst_zonedir = $(install_root)$(zonedir) -# Where to install the locale and message catalog data files (which are -# machine-independent). +# Where to install the locale files. ifndef localedir -localedir = $(datadir)/locale +localedir = $(libdir)/locale endif inst_localedir = $(install_root)$(localedir) +# Where to install the message catalog data files (which are +# machine-independent). +ifndef msgcatdir +msgcatdir = $(datadir)/locale +endif +inst_msgcatdir = $(install_root)$(msgcatdir) + # Where to install the locale charmap source files. ifndef i18ndir i18ndir = $(datadir)/i18n diff --git a/catgets/Makefile b/catgets/Makefile index e984ff724b..9ddc59dc7d 100644 --- a/catgets/Makefile +++ b/catgets/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999 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 @@ -38,7 +38,7 @@ include ../Rules $(objpfx)gencat: $(gencat-modules:%=$(objpfx)%.o) -CPPFLAGS := -DNLSPATH='"$(localedir)/%L/%N:$(localedir)/%L/LC_MESSAGES/%N:$(localedir)/%l/%N:$(localedir)/%l/LC_MESSAGES/%N:"' \ +CPPFLAGS := -DNLSPATH='"$(msgcatdir)/%L/%N:$(msgcatdir)/%L/LC_MESSAGES/%N:$(msgcatdir)/%l/%N:$(msgcatdir)/%l/LC_MESSAGES/%N:"' \ -DHAVE_CONFIG_H $(CPPFLAGS) generated = de.msg de.cat test1.cat test1.h diff --git a/elf/Makefile b/elf/Makefile index 4f532d3fb5..c93e3eb1f3 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -165,7 +165,7 @@ common-ldd-rewrite = -e 's%@RTLD@%$(slibdir)/$(rtld-installed-name)%g' \ -e 's%@VERSION@%$(version)%g' sh-ldd-rewrite = $(common-ldd-rewrite) -e 's%@BASH@%/bin/sh%g;s/\$$"/"/g' bash-ldd-rewrite = $(common-ldd-rewrite) -e 's%@BASH@%$(BASH)%g' \ - -e 's%@TEXTDOMAINDIR@%$(localedir)%g' + -e 's%@TEXTDOMAINDIR@%$(msgcatdir)%g' ifneq ($(have-bash2),yes) ldd-shell = sh diff --git a/elf/link.h b/elf/link.h index e8203596ff..ac53a204a6 100644 --- a/elf/link.h +++ b/elf/link.h @@ -69,7 +69,7 @@ extern struct r_debug _r_debug; /* This symbol refers to the "dynamic structure" in the `.dynamic' section of whatever module refers to `_DYNAMIC'. So, to find its own `struct r_debug', a program could do: - for (dyn = _DYNAMIC; dyn->d_tag != DT_NULL) + for (dyn = _DYNAMIC; dyn->d_tag != DT_NULL; ++dyn) if (dyn->d_tag == DT_DEBUG) r_debug = (struct r_debug *) dyn->d_un.d_ptr; */ diff --git a/intl/Makefile b/intl/Makefile index c6d58dadad..4712179290 100644 --- a/intl/Makefile +++ b/intl/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# Copyright (C) 1995, 1996, 1997, 1998, 1999 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 @@ -25,14 +25,14 @@ routines = bindtextdom dcgettext dgettext gettext \ l10nflist explodename distribute = gettext.h gettextP.h hash-string.h loadinfo.h locale.alias -install-others = $(inst_localedir)/locale.alias +install-others = $(inst_msgcatdir)/locale.alias include ../Rules -CPPFLAGS += -D'GNULOCALEDIR="$(localedir)"' \ - -D'LOCALE_ALIAS_PATH="$(localedir):$(i18ndir)"' +CPPFLAGS += -D'GNULOCALEDIR="$(msgcatdir)"' \ + -D'LOCALE_ALIAS_PATH="$(msgcatdir):$(i18ndir)"' -$(inst_localedir)/locale.alias: locale.alias $(+force) +$(inst_msgcatdir)/locale.alias: locale.alias $(+force) $(do-install) ifdef gettext-srcdir diff --git a/locale/C-collate.c b/locale/C-collate.c index 616fed1e3a..6fd0e721be 100644 --- a/locale/C-collate.c +++ b/locale/C-collate.c @@ -148,7 +148,7 @@ const struct locale_data _nl_C_LC_COLLATE = _nl_C_name, NULL, 0, 0, /* no file mapped */ UNDELETABLE, - 21, + 30, { { word: 0 }, { string: NULL }, @@ -175,22 +175,10 @@ const struct locale_data _nl_C_LC_COLLATE = { string: NULL }, { string: NULL }, { word: 223 }, -#if __BYTE_ORDER == __LITTLE_ENDIAN - { string: NULL }, -#endif { string: (const char *) _nl_C_LC_COLLATE_symbol_hash }, -#if __BYTE_ORDER == __BIG_ENDIAN - { string: NULL }, -#endif { string: _nl_C_LC_COLLATE_symbol_strings }, { string: NULL }, { string: NULL }, -#if __BYTE_ORDER == __LITTLE_ENDIAN - { string: NULL }, -#endif - { string: (const char *) _nl_C_LC_COLLATE_symbol_classes }, -#if __BYTE_ORDER == __BIG_ENDIAN - { string: NULL }, -#endif + { string: (const char *) _nl_C_LC_COLLATE_symbol_classes } } }; diff --git a/locale/C-ctype.c b/locale/C-ctype.c index f81f5c3ac1..1a1ab5b796 100644 --- a/locale/C-ctype.c +++ b/locale/C-ctype.c @@ -343,29 +343,15 @@ const struct locale_data _nl_C_LC_CTYPE = _nl_C_name, NULL, 0, 0, /* no file mapped */ UNDELETABLE, - 15, + 60, { { string: _nl_C_LC_CTYPE_class }, -#if BYTE_ORDER == LITTLE_ENDIAN - { string: NULL }, { string: NULL }, -#endif { string: (const char *) _nl_C_LC_CTYPE_toupper }, { string: (const char *) _nl_C_LC_CTYPE_tolower }, -#if BYTE_ORDER == BIG_ENDIAN - { string: NULL }, { string: NULL }, -#endif { string: _nl_C_LC_CTYPE_class32 }, -#if BYTE_ORDER == LITTLE_ENDIAN - { string: NULL }, -#endif { string: (const char *) _nl_C_LC_CTYPE_names }, -#if BYTE_ORDER == BIG_ENDIAN - { string: NULL }, - { word: 256 }, { word: 1 }, -#endif -#if BYTE_ORDER == LITTLE_ENDIAN - { word: 0 }, { word: 0 }, -#endif + { word: 256 }, + { word: 1 }, { string: "upper\0" "lower\0" "alpha\0" "digit\0" "xdigit\0" "space\0" "print\0" "graph\0" "blank\0" "cntrl\0" "punct\0" "alnum\0" "left_to_right\0" "right_to_left\0" "num_terminator\0" @@ -378,14 +364,7 @@ const struct locale_data _nl_C_LC_CTYPE = { string: _nl_C_LC_CTYPE_width }, { word: 1 }, { string: "ANSI_X3.4-1968" }, -#if BYTE_ORDER == BIG_ENDIAN - { word: 0 }, { word: 0 }, - { word: 1 }, { word: 0 }, -#endif -#if BYTE_ORDER == LITTLE_ENDIAN - { word: 256 }, { word: 1 }, - { word: 0 }, { word: 1 }, -#endif + { word: 1 }, { string: "0" }, { string: "1" }, { string: "2" }, @@ -396,24 +375,7 @@ const struct locale_data _nl_C_LC_CTYPE = { string: "7" }, { string: "8" }, { string: "9" }, -#if BYTE_ORDER == BIG_ENDIAN - { word: 1 }, { word: 0 }, -#endif -#if BYTE_ORDER == LITTLE_ENDIAN - { word: 0 }, { word: 1 }, -#endif -#if BYTE_ORDER == LITTLE_ENDIAN - { wstr: (uint32_t *) L"" }, - { wstr: (uint32_t *) L"" }, - { wstr: (uint32_t *) L"" }, - { wstr: (uint32_t *) L"" }, - { wstr: (uint32_t *) L"" }, - { wstr: (uint32_t *) L"" }, - { wstr: (uint32_t *) L"" }, - { wstr: (uint32_t *) L"" }, - { wstr: (uint32_t *) L"" }, - { wstr: (uint32_t *) L"" }, -#endif + { word: 1 }, { wstr: (uint32_t *) L"0" }, { wstr: (uint32_t *) L"1" }, { wstr: (uint32_t *) L"2" }, @@ -424,18 +386,6 @@ const struct locale_data _nl_C_LC_CTYPE = { wstr: (uint32_t *) L"7" }, { wstr: (uint32_t *) L"8" }, { wstr: (uint32_t *) L"9" }, -#if BYTE_ORDER == BIG_ENDIAN - { wstr: (uint32_t *) L"" }, - { wstr: (uint32_t *) L"" }, - { wstr: (uint32_t *) L"" }, - { wstr: (uint32_t *) L"" }, - { wstr: (uint32_t *) L"" }, - { wstr: (uint32_t *) L"" }, - { wstr: (uint32_t *) L"" }, - { wstr: (uint32_t *) L"" }, - { wstr: (uint32_t *) L"" }, - { wstr: (uint32_t *) L"" }, -#endif { string: "0" }, { string: "1" }, { string: "2" }, @@ -446,18 +396,6 @@ const struct locale_data _nl_C_LC_CTYPE = { string: "7" }, { string: "8" }, { string: "9" }, -#if BYTE_ORDER == LITTLE_ENDIAN - { word: L'\0' }, - { word: L'\0' }, - { word: L'\0' }, - { word: L'\0' }, - { word: L'\0' }, - { word: L'\0' }, - { word: L'\0' }, - { word: L'\0' }, - { word: L'\0' }, - { word: L'\0' }, -#endif { word: L'0' }, { word: L'1' }, { word: L'2' }, @@ -468,29 +406,11 @@ const struct locale_data _nl_C_LC_CTYPE = { word: L'7' }, { word: L'8' }, { word: L'9' }, -#if BYTE_ORDER == BIG_ENDIAN - { word: L'\0' }, - { word: L'\0' }, - { word: L'\0' }, - { word: L'\0' }, - { word: L'\0' }, - { word: L'\0' }, - { word: L'\0' }, - { word: L'\0' }, - { word: L'\0' }, - { word: L'\0' }, -#endif - { word: 0 }, - { word: 0 }, { word: 0 }, { word: 0 }, { string: "" }, { string: "" }, { string: "" }, - { string: "" }, - { string: "" }, - { string: "" }, - { string: "" }, { string: "" } } }; diff --git a/locale/C-monetary.c b/locale/C-monetary.c index 3cb1a57b4e..d82166c6fc 100644 --- a/locale/C-monetary.c +++ b/locale/C-monetary.c @@ -1,6 +1,6 @@ -/* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1995. + Contributed by Ulrich Drepper , 1995. 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 @@ -33,7 +33,7 @@ const struct locale_data _nl_C_LC_MONETARY = _nl_C_name, NULL, 0, 0, /* no file mapped */ UNDELETABLE, - 49, + 43, { { string: "" }, { string: "" }, diff --git a/locale/C-paper.c b/locale/C-paper.c index 9bd1cdcbdb..fa3e8557d7 100644 --- a/locale/C-paper.c +++ b/locale/C-paper.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998 Free Software Foundation, Inc. +/* Copyright (C) 1998, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1998. @@ -29,11 +29,9 @@ const struct locale_data _nl_C_LC_PAPER = _nl_C_name, NULL, 0, 0, /* no file mapped */ UNDELETABLE, - 4, + 2, { { word: 297 }, - { word: 297 }, - { word: 210 }, { word: 210 } } }; diff --git a/locale/C-time.c b/locale/C-time.c index 34ed40507f..9be32c06b3 100644 --- a/locale/C-time.c +++ b/locale/C-time.c @@ -82,7 +82,6 @@ const struct locale_data _nl_C_LC_TIME = { string: "" }, { word: 0 }, { string: "" }, - { string: "" }, { wstr: (const uint32_t *) L"Sun" }, { wstr: (const uint32_t *) L"Mon" }, { wstr: (const uint32_t *) L"Tue" }, diff --git a/locale/Makefile b/locale/Makefile index 622d7f1873..84c73ba8b2 100644 --- a/locale/Makefile +++ b/locale/Makefile @@ -79,7 +79,7 @@ localepath = "$(localedir):$(i18ndir)" CPPFLAGS := -DLOCALE_PATH='$(localepath)' \ -DLOCALEDIR='"$(localedir)"' \ - -DLOCALE_ALIAS_PATH='"$(localedir):$(i18ndir)"' \ + -DLOCALE_ALIAS_PATH='"$(msgcatdir):$(i18ndir)"' \ -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \ -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \ -DLOCSRCDIR='"$(i18ndir)/locales"' -DHAVE_CONFIG_H \ diff --git a/locale/categories.def b/locale/categories.def index 36020cf1a6..4a617875d2 100644 --- a/locale/categories.def +++ b/locale/categories.def @@ -46,23 +46,17 @@ DEFINE_CATEGORY DEFINE_ELEMENT (_NL_COLLATE_RULES, "collate-rules", std, string) DEFINE_ELEMENT (_NL_COLLATE_HASH_SIZE, "collate-hash-size", std, word) DEFINE_ELEMENT (_NL_COLLATE_HASH_LAYERS, "collate-hash-layers", std, word) - DEFINE_ELEMENT (_NL_COLLATE_TABLEWC_EB, "collate-tablewc-eb", std, string) - DEFINE_ELEMENT (_NL_COLLATE_TABLEWC_EL, "collate-tablewc-el", std, string) + DEFINE_ELEMENT (_NL_COLLATE_TABLEWC, "collate-tablewc", std, string) DEFINE_ELEMENT (_NL_COLLATE_UNDEFINED_WC, "collate-undefined-wc", std, word) - DEFINE_ELEMENT (_NL_COLLATE_EXTRAWC_EB, "collate-extrawc-eb", std, string) - DEFINE_ELEMENT (_NL_COLLATE_EXTRAWC_EL, "collate-extrawc-el", std, string) + DEFINE_ELEMENT (_NL_COLLATE_EXTRAWC, "collate-extrawc", std, string) DEFINE_ELEMENT (_NL_COLLATE_ELEM_HASH_SIZE, "collate-elem-hash-size", std, word) - DEFINE_ELEMENT (_NL_COLLATE_ELEM_HASH_EB, "collate-elem-hash-eb", std, string) - DEFINE_ELEMENT (_NL_COLLATE_ELEM_HASH_EL, "collate-elem-hash-el", std, string) + DEFINE_ELEMENT (_NL_COLLATE_ELEM_HASH, "collate-elem-hash", std, string) DEFINE_ELEMENT (_NL_COLLATE_ELEM_STR_POOL, "collate-elem-str-pool", std, string) - DEFINE_ELEMENT (_NL_COLLATE_ELEM_VAL_EB, "collate-elem-val-eb", std, string) - DEFINE_ELEMENT (_NL_COLLATE_ELEM_VAL_EL, "collate-elem-val-el", std, string) + DEFINE_ELEMENT (_NL_COLLATE_ELEM_VAL, "collate-elem-val", std, string) DEFINE_ELEMENT (_NL_COLLATE_SYMB_HASH_SIZE, "collate-symb-hash-size", std, word) - DEFINE_ELEMENT (_NL_COLLATE_SYMB_HASH_EB, "collate-symb-hash-eb", std, string) - DEFINE_ELEMENT (_NL_COLLATE_SYMB_HASH_EL, "collate-symb-hash-el", std, string) + DEFINE_ELEMENT (_NL_COLLATE_SYMB_HASH, "collate-symb-hash", std, string) DEFINE_ELEMENT (_NL_COLLATE_SYMB_STR_POOL, "collate-symb-str-pool", std, string) - DEFINE_ELEMENT (_NL_COLLATE_SYMB_CLASSWC_EB, "collate-symb-classwc-eb", std, string) - DEFINE_ELEMENT (_NL_COLLATE_SYMB_CLASSWC_EL, "collate-symb-classwc-el", std, string) + DEFINE_ELEMENT (_NL_COLLATE_SYMB_CLASSWC, "collate-symb-classwc", std, string) ), _nl_postload_collate) @@ -73,31 +67,21 @@ DEFINE_CATEGORY ( LC_CTYPE, "LC_CTYPE", ( - DEFINE_ELEMENT (_NL_CTYPE_CLASS, "ctype-class", std, string) - DEFINE_ELEMENT (_NL_CTYPE_TOUPPER_EB, "ctype-toupper-eb", std, string) - DEFINE_ELEMENT (_NL_CTYPE_TOLOWER_EB, "ctype-tolower-eb", std, string) - DEFINE_ELEMENT (_NL_CTYPE_TOUPPER_EL, "ctype-toupper-el", std, string) - DEFINE_ELEMENT (_NL_CTYPE_TOLOWER_EL, "ctype-tolower-el", std, string) - DEFINE_ELEMENT (_NL_CTYPE_CLASS32, "ctype-class32", std, string) - DEFINE_ELEMENT (_NL_CTYPE_NAMES_EB, "ctype-names-eb", std, string) - DEFINE_ELEMENT (_NL_CTYPE_NAMES_EL, "ctype-names-el", std, string) - DEFINE_ELEMENT (_NL_CTYPE_HASH_SIZE_EB, "ctype-hash-size-eb", std, word) - DEFINE_ELEMENT (_NL_CTYPE_HASH_SIZE_EL, "ctype-hash-size-el", std, word) - DEFINE_ELEMENT (_NL_CTYPE_HASH_LAYERS_EB, "ctype-hash-layers-eb", std, word) - DEFINE_ELEMENT (_NL_CTYPE_HASH_LAYERS_EL, "ctype-hash-layers-el", std, word) - DEFINE_ELEMENT (_NL_CTYPE_CLASS_NAMES, "ctype-class-names", std, stringlist) - DEFINE_ELEMENT (_NL_CTYPE_MAP_NAMES, "ctype-map-names", std, stringlist) - DEFINE_ELEMENT (_NL_CTYPE_WIDTH, "ctype-width", std, bytearray) - DEFINE_ELEMENT (_NL_CTYPE_MB_CUR_MAX, "ctype-mb-cur-max", std, word) - DEFINE_ELEMENT (_NL_CTYPE_CODESET_NAME, "charmap", std, string) + DEFINE_ELEMENT (_NL_CTYPE_CLASS, "ctype-class", std, string) + DEFINE_ELEMENT (_NL_CTYPE_TOUPPER, "ctype-toupper", std, string) + DEFINE_ELEMENT (_NL_CTYPE_TOLOWER, "ctype-tolower", std, string) + DEFINE_ELEMENT (_NL_CTYPE_CLASS32, "ctype-class32", std, string) + DEFINE_ELEMENT (_NL_CTYPE_NAMES, "ctype-names", std, string) + DEFINE_ELEMENT (_NL_CTYPE_HASH_SIZE, "ctype-hash-size", std, word) + DEFINE_ELEMENT (_NL_CTYPE_HASH_LAYERS, "ctype-hash-layers", std, word) + DEFINE_ELEMENT (_NL_CTYPE_CLASS_NAMES, "ctype-class-names", std, stringlist) + DEFINE_ELEMENT (_NL_CTYPE_MAP_NAMES, "ctype-map-names", std, stringlist) + DEFINE_ELEMENT (_NL_CTYPE_WIDTH, "ctype-width", std, bytearray) + DEFINE_ELEMENT (_NL_CTYPE_MB_CUR_MAX, "ctype-mb-cur-max", std, word) + DEFINE_ELEMENT (_NL_CTYPE_CODESET_NAME, "charmap", std, string) ), _nl_postload_ctype) -#if __BYTE_ORDER == __BIG_ENDIAN -# define _NL_MONETARY_CONVERSION_RATE _NL_MONETARY_CONVERSION_RATE_EB -#else -# define _NL_MONETARY_CONVERSION_RATE _NL_MONETARY_CONVERSION_RATE_EL -#endif DEFINE_CATEGORY ( LC_MONETARY, "LC_MONETARY", @@ -143,8 +127,7 @@ DEFINE_CATEGORY DEFINE_ELEMENT (_NL_MONETARY_UNO_VALID_TO, "uno_valid_to", std, word) DEFINE_ELEMENT (_NL_MONETARY_DUO_VALID_FROM, "duo_valid_from", std, word) DEFINE_ELEMENT (_NL_MONETARY_DUO_VALID_TO, "duo_valid_to", std, word) - DEFINE_ELEMENT (_NL_MONETARY_CONVERSION_RATE_EB, "conversion_rate-eb", std, wordarray, 2, 2) - DEFINE_ELEMENT (_NL_MONETARY_CONVERSION_RATE_EL, "conversion_rate-el", std, wordarray, 2, 2) + DEFINE_ELEMENT (_NL_MONETARY_CONVERSION_RATE, "conversion_rate", std, wordarray, 2, 2) ), NO_POSTLOAD) @@ -177,38 +160,22 @@ DEFINE_CATEGORY DEFINE_ELEMENT (ALT_DIGITS, "alt_digits", opt, stringarray, 0, 100) DEFINE_ELEMENT (ERA_D_T_FMT, "era_d_t_fmt", opt, string) DEFINE_ELEMENT (ERA_T_FMT, "era_t_fmt", opt, string) - DEFINE_ELEMENT (_NL_TIME_ERA_NUM_ENTRIES_EB, "time-era-num-entries-eb", opt, word) - DEFINE_ELEMENT (_NL_TIME_ERA_NUM_ENTRIES_EL, "time-era-num-entries-el", opt, word) - DEFINE_ELEMENT (_NL_TIME_ERA_ENTRIES_EB, "time-era-entries-eb", opt, string) - DEFINE_ELEMENT (_NL_TIME_ERA_ENTRIES_EL, "time-era-entries-el", opt, string) - DEFINE_ELEMENT (_NL_WABDAY_1_EB, "wide-abday-eb", std, stringarray, 7, 7) - DEFINE_ELEMENT (_NL_WABDAY_1_EL, "wide-abday-el", std, stringarray, 7, 7) - DEFINE_ELEMENT (_NL_WDAY_1_EB, "wide-day-eb", std, stringarray, 7, 7) - DEFINE_ELEMENT (_NL_WDAY_1_EL, "wide-day-el", std, stringarray, 7, 7) - DEFINE_ELEMENT (_NL_WABMON_1_EB, "wide-abmon-eb", std, stringarray, 12, 12) - DEFINE_ELEMENT (_NL_WABMON_1_EL, "wide-abmon-el", std, stringarray, 12, 12) - DEFINE_ELEMENT (_NL_WMON_1_EB, "wide-mon-eb", std, stringarray, 12, 12) - DEFINE_ELEMENT (_NL_WMON_1_EL, "wide-mon-el", std, stringarray, 12, 12) - DEFINE_ELEMENT (_NL_WAM_STR_EB, "wide-am_pm-eb", std, stringarray, 2, 2) - DEFINE_ELEMENT (_NL_WAM_STR_EL, "wide-am_pm-el", std, stringarray, 2, 2) - DEFINE_ELEMENT (_NL_WD_T_FMT_EB, "wide-d_t_fmt-eb", std, string) - DEFINE_ELEMENT (_NL_WD_T_FMT_EL, "wide-d_t_fmt-el", std, string) - DEFINE_ELEMENT (_NL_WD_FMT_EB, "wide-d_fmt-eb", std, string) - DEFINE_ELEMENT (_NL_WD_FMT_EL, "wide-d_fmt-el", std, string) - DEFINE_ELEMENT (_NL_WT_FMT_EB, "wide-t_fmt-eb", std, string) - DEFINE_ELEMENT (_NL_WT_FMT_EL, "wide-t_fmt-el", std, string) - DEFINE_ELEMENT (_NL_WT_FMT_AMPM_EB, "wide-t_fmt_ampm-eb", std, string) - DEFINE_ELEMENT (_NL_WT_FMT_AMPM_EL, "wide-t_fmt_ampm-el", std, string) - DEFINE_ELEMENT (_NL_WERA_YEAR_EB, "wide-era_year-eb", opt, string) - DEFINE_ELEMENT (_NL_WERA_YEAR_EL, "wide-era_year-el", opt, string) - DEFINE_ELEMENT (_NL_WERA_D_FMT_EB, "wide-era_d_fmt-eb", opt, string) - DEFINE_ELEMENT (_NL_WERA_D_FMT_EL, "wide-era_d_fmt-el", opt, string) - DEFINE_ELEMENT (_NL_WALT_DIGITS_EB, "wide-alt_digits-eb", opt, stringarray, 0, 100) - DEFINE_ELEMENT (_NL_WALT_DIGITS_EL, "wide-alt_digits-el", opt, stringarray, 0, 100) - DEFINE_ELEMENT (_NL_WERA_D_T_FMT_EB, "wide-era_d_t_fmt-eb", opt, string) - DEFINE_ELEMENT (_NL_WERA_D_T_FMT_EL, "wide-era_d_t_fmt-el", opt, string) - DEFINE_ELEMENT (_NL_WERA_T_FMT_EB, "wide-era_t_fmt-eb", opt, string) - DEFINE_ELEMENT (_NL_WERA_T_FMT_EL, "wide-era_t_fmt-el", opt, string) + DEFINE_ELEMENT (_NL_TIME_ERA_NUM_ENTRIES, "time-era-num-entries", opt, word) + DEFINE_ELEMENT (_NL_TIME_ERA_ENTRIES, "time-era-entries", opt, string) + DEFINE_ELEMENT (_NL_WABDAY_1, "wide-abday", std, stringarray, 7, 7) + DEFINE_ELEMENT (_NL_WDAY_1, "wide-day", std, stringarray, 7, 7) + DEFINE_ELEMENT (_NL_WABMON_1, "wide-abmon", std, stringarray, 12, 12) + DEFINE_ELEMENT (_NL_WMON_1, "wide-mon", std, stringarray, 12, 12) + DEFINE_ELEMENT (_NL_WAM_STR, "wide-am_pm", std, stringarray, 2, 2) + DEFINE_ELEMENT (_NL_WD_T_FMT, "wide-d_t_fmt", std, string) + DEFINE_ELEMENT (_NL_WD_FMT, "wide-d_fmt", std, string) + DEFINE_ELEMENT (_NL_WT_FMT, "wide-t_fmt", std, string) + DEFINE_ELEMENT (_NL_WT_FMT_AMPM, "wide-t_fmt_ampm", std, string) + DEFINE_ELEMENT (_NL_WERA_YEAR, "wide-era_year", opt, string) + DEFINE_ELEMENT (_NL_WERA_D_FMT, "wide-era_d_fmt", opt, string) + DEFINE_ELEMENT (_NL_WALT_DIGITS, "wide-alt_digits", opt, stringarray, 0, 100) + DEFINE_ELEMENT (_NL_WERA_D_T_FMT, "wide-era_d_t_fmt", opt, string) + DEFINE_ELEMENT (_NL_WERA_T_FMT, "wide-era_t_fmt", opt, string) DEFINE_ELEMENT (_NL_TIME_WEEK_NDAYS, "week-ndays", std, byte) DEFINE_ELEMENT (_NL_TIME_WEEK_1STDAY, "week-1stday", std, word) DEFINE_ELEMENT (_NL_TIME_WEEK_1STWEEK, "week-1stweek", std, byte) @@ -233,10 +200,8 @@ DEFINE_CATEGORY ( LC_PAPER, "LC_PAPER", ( - DEFINE_ELEMENT (_NL_PAPER_HEIGHT_EB, "height-eb", std, word) - DEFINE_ELEMENT (_NL_PAPER_HEIGHT_EL, "height-el", std, word) - DEFINE_ELEMENT (_NL_PAPER_WIDTH_EB, "width-eb", std, word) - DEFINE_ELEMENT (_NL_PAPER_WIDTH_EL, "width-el", std, word) + DEFINE_ELEMENT (_NL_PAPER_HEIGHT, "height", std, word) + DEFINE_ELEMENT (_NL_PAPER_WIDTH, "width", std, word) ), NO_POSTLOAD) DEFINE_CATEGORY @@ -261,8 +226,7 @@ DEFINE_CATEGORY DEFINE_ELEMENT (_NL_ADDRESS_COUNTRY_AB2, "country_ab2", std, string) DEFINE_ELEMENT (_NL_ADDRESS_COUNTRY_AB3, "country_ab3", std, string) DEFINE_ELEMENT (_NL_ADDRESS_COUNTRY_CAR, "country_car", std, string) - DEFINE_ELEMENT (_NL_ADDRESS_COUNTRY_NUM_EB, "country_num-eb", std, word) - DEFINE_ELEMENT (_NL_ADDRESS_COUNTRY_NUM_EL, "country_num-el", std, word) + DEFINE_ELEMENT (_NL_ADDRESS_COUNTRY_NUM, "country_num", std, word) DEFINE_ELEMENT (_NL_ADDRESS_COUNTRY_ISBN, "country_isbn", std, string) DEFINE_ELEMENT (_NL_ADDRESS_LANG_NAME, "lang_name", std, string) DEFINE_ELEMENT (_NL_ADDRESS_LANG_AB, "lang_ab", std, string) diff --git a/locale/langinfo.h b/locale/langinfo.h index 2513adc86d..b6090bd0f8 100644 --- a/locale/langinfo.h +++ b/locale/langinfo.h @@ -155,118 +155,67 @@ enum ERA_T_FMT, /* Time in alternate era format. */ #define ERA_T_FMT ERA_T_FMT - _NL_TIME_ERA_NUM_ENTRIES_EB, /* Number entries in the era arrays. */ - _NL_TIME_ERA_NUM_ENTRIES_EL, /* Number entries in the era arrays. */ - _NL_TIME_ERA_ENTRIES_EB, /* Structure with era entries in usable form.*/ - _NL_TIME_ERA_ENTRIES_EL, - - _NL_WABDAY_1_EB, /* Sun */ - _NL_WABDAY_2_EB, - _NL_WABDAY_3_EB, - _NL_WABDAY_4_EB, - _NL_WABDAY_5_EB, - _NL_WABDAY_6_EB, - _NL_WABDAY_7_EB, - _NL_WABDAY_1_EL, /* Sun */ - _NL_WABDAY_2_EL, - _NL_WABDAY_3_EL, - _NL_WABDAY_4_EL, - _NL_WABDAY_5_EL, - _NL_WABDAY_6_EL, - _NL_WABDAY_7_EL, + _NL_TIME_ERA_NUM_ENTRIES, /* Number entries in the era arrays. */ + _NL_TIME_ERA_ENTRIES, /* Structure with era entries in usable form.*/ + + _NL_WABDAY_1, /* Sun */ + _NL_WABDAY_2, + _NL_WABDAY_3, + _NL_WABDAY_4, + _NL_WABDAY_5, + _NL_WABDAY_6, + _NL_WABDAY_7, /* Long-named days of the week. */ - _NL_WDAY_1_EB, /* Sunday */ - _NL_WDAY_2_EB, /* Monday */ - _NL_WDAY_3_EB, /* Tuesday */ - _NL_WDAY_4_EB, /* Wednesday */ - _NL_WDAY_5_EB, /* Thursday */ - _NL_WDAY_6_EB, /* Friday */ - _NL_WDAY_7_EB, /* Saturday */ - _NL_WDAY_1_EL, /* Sunday */ - _NL_WDAY_2_EL, /* Monday */ - _NL_WDAY_3_EL, /* Tuesday */ - _NL_WDAY_4_EL, /* Wednesday */ - _NL_WDAY_5_EL, /* Thursday */ - _NL_WDAY_6_EL, /* Friday */ - _NL_WDAY_7_EL, /* Saturday */ + _NL_WDAY_1, /* Sunday */ + _NL_WDAY_2, /* Monday */ + _NL_WDAY_3, /* Tuesday */ + _NL_WDAY_4, /* Wednesday */ + _NL_WDAY_5, /* Thursday */ + _NL_WDAY_6, /* Friday */ + _NL_WDAY_7, /* Saturday */ /* Abbreviated month names. */ - _NL_WABMON_1_EB, /* Jan */ - _NL_WABMON_2_EB, - _NL_WABMON_3_EB, - _NL_WABMON_4_EB, - _NL_WABMON_5_EB, - _NL_WABMON_6_EB, - _NL_WABMON_7_EB, - _NL_WABMON_8_EB, - _NL_WABMON_9_EB, - _NL_WABMON_10_EB, - _NL_WABMON_11_EB, - _NL_WABMON_12_EB, - _NL_WABMON_1_EL, /* Jan */ - _NL_WABMON_2_EL, - _NL_WABMON_3_EL, - _NL_WABMON_4_EL, - _NL_WABMON_5_EL, - _NL_WABMON_6_EL, - _NL_WABMON_7_EL, - _NL_WABMON_8_EL, - _NL_WABMON_9_EL, - _NL_WABMON_10_EL, - _NL_WABMON_11_EL, - _NL_WABMON_12_EL, + _NL_WABMON_1, /* Jan */ + _NL_WABMON_2, + _NL_WABMON_3, + _NL_WABMON_4, + _NL_WABMON_5, + _NL_WABMON_6, + _NL_WABMON_7, + _NL_WABMON_8, + _NL_WABMON_9, + _NL_WABMON_10, + _NL_WABMON_11, + _NL_WABMON_12, /* Long month names. */ - _NL_WMON_1_EB, /* January */ - _NL_WMON_2_EB, - _NL_WMON_3_EB, - _NL_WMON_4_EB, - _NL_WMON_5_EB, - _NL_WMON_6_EB, - _NL_WMON_7_EB, - _NL_WMON_8_EB, - _NL_WMON_9_EB, - _NL_WMON_10_EB, - _NL_WMON_11_EB, - _NL_WMON_12_EB, - _NL_WMON_1_EL, /* January */ - _NL_WMON_2_EL, - _NL_WMON_3_EL, - _NL_WMON_4_EL, - _NL_WMON_5_EL, - _NL_WMON_6_EL, - _NL_WMON_7_EL, - _NL_WMON_8_EL, - _NL_WMON_9_EL, - _NL_WMON_10_EL, - _NL_WMON_11_EL, - _NL_WMON_12_EL, - - _NL_WAM_STR_EB, /* Ante meridian string. */ - _NL_WPM_STR_EB, /* Post meridian string. */ - _NL_WAM_STR_EL, /* Ante meridian string. */ - _NL_WPM_STR_EL, /* Post meridian string. */ - - _NL_WD_T_FMT_EB, /* Date and time format for strftime. */ - _NL_WD_FMT_EB, /* Date format for strftime. */ - _NL_WT_FMT_EB, /* Time format for strftime. */ - _NL_WT_FMT_AMPM_EB, /* 12-hour time format for strftime. */ - _NL_WD_T_FMT_EL, /* Date and time format for strftime. */ - _NL_WD_FMT_EL, /* Date format for strftime. */ - _NL_WT_FMT_EL, /* Time format for strftime. */ - _NL_WT_FMT_AMPM_EL, /* 12-hour time format for strftime. */ - - _NL_WERA_YEAR_EB, /* Year in alternate era format. */ - _NL_WERA_D_FMT_EB, /* Date in alternate era format. */ - _NL_WALT_DIGITS_EB, /* Alternate symbols for digits. */ - _NL_WERA_D_T_FMT_EB, /* Date and time in alternate era format. */ - _NL_WERA_T_FMT_EB, /* Time in alternate era format. */ - _NL_WERA_YEAR_EL, /* Year in alternate era format. */ - _NL_WERA_D_FMT_EL, /* Date in alternate era format. */ - _NL_WALT_DIGITS_EL, /* Alternate symbols for digits. */ - _NL_WERA_D_T_FMT_EL, /* Date and time in alternate era format. */ - _NL_WERA_T_FMT_EL, /* Time in alternate era format. */ + _NL_WMON_1, /* January */ + _NL_WMON_2, + _NL_WMON_3, + _NL_WMON_4, + _NL_WMON_5, + _NL_WMON_6, + _NL_WMON_7, + _NL_WMON_8, + _NL_WMON_9, + _NL_WMON_10, + _NL_WMON_11, + _NL_WMON_12, + + _NL_WAM_STR, /* Ante meridian string. */ + _NL_WPM_STR, /* Post meridian string. */ + + _NL_WD_T_FMT, /* Date and time format for strftime. */ + _NL_WD_FMT, /* Date format for strftime. */ + _NL_WT_FMT, /* Time format for strftime. */ + _NL_WT_FMT_AMPM, /* 12-hour time format for strftime. */ + + _NL_WERA_YEAR, /* Year in alternate era format. */ + _NL_WERA_D_FMT, /* Date in alternate era format. */ + _NL_WALT_DIGITS, /* Alternate symbols for digits. */ + _NL_WERA_D_T_FMT, /* Date and time in alternate era format. */ + _NL_WERA_T_FMT, /* Time in alternate era format. */ _NL_TIME_WEEK_NDAYS, _NL_TIME_WEEK_1STDAY, @@ -285,49 +234,35 @@ enum _NL_COLLATE_RULES, _NL_COLLATE_HASH_SIZE, _NL_COLLATE_HASH_LAYERS, - _NL_COLLATE_TABLEMB_EB, - _NL_COLLATE_TABLEMB_EL, - _NL_COLLATE_TABLEWC_EB, - _NL_COLLATE_TABLEWC_EL, + _NL_COLLATE_TABLEMB, + _NL_COLLATE_TABLEWC, _NL_COLLATE_UNDEFINED_MB, _NL_COLLATE_UNDEFINED_WC, - _NL_COLLATE_EXTRAMB_EB, - _NL_COLLATE_EXTRAMB_EL, - _NL_COLLATE_EXTRAWC_EB, - _NL_COLLATE_EXTRAWC_EL, + _NL_COLLATE_EXTRAMB, + _NL_COLLATE_EXTRAWC, _NL_COLLATE_ELEM_HASH_SIZE, - _NL_COLLATE_ELEM_HASH_EB, - _NL_COLLATE_ELEM_HASH_EL, + _NL_COLLATE_ELEM_HASH, _NL_COLLATE_ELEM_STR_POOL, - _NL_COLLATE_ELEM_VAL_EB, - _NL_COLLATE_ELEM_VAL_EL, - _NL_COLLATE_ELEM_VALMB_EB, - _NL_COLLATE_ELEM_VALMB_EL, - _NL_COLLATE_ELEM_VALWC_EB, - _NL_COLLATE_ELEM_VALWC_EL, + _NL_COLLATE_ELEM_VAL, + _NL_COLLATE_ELEM_VALMB, + _NL_COLLATE_ELEM_VALWC, _NL_COLLATE_SYMB_HASH_SIZE, - _NL_COLLATE_SYMB_HASH_EB, - _NL_COLLATE_SYMB_HASH_EL, + _NL_COLLATE_SYMB_HASH, _NL_COLLATE_SYMB_STR_POOL, - _NL_COLLATE_SYMB_CLASSMB_EB, - _NL_COLLATE_SYMB_CLASSMB_EL, - _NL_COLLATE_SYMB_CLASSWC_EB, - _NL_COLLATE_SYMB_CLASSWC_EL, + _NL_COLLATE_SYMB_CLASSMB, + _NL_COLLATE_SYMB_CLASSWC, _NL_NUM_LC_COLLATE, /* LC_CTYPE category: character classification. This information is accessed by the functions in . These `nl_langinfo' names are used only internally. */ _NL_CTYPE_CLASS = _NL_ITEM (LC_CTYPE, 0), - _NL_CTYPE_TOUPPER_EB, - _NL_CTYPE_TOLOWER_EB, - _NL_CTYPE_TOUPPER_EL, - _NL_CTYPE_TOLOWER_EL, + _NL_CTYPE_TOUPPER, + _NL_CTYPE_TOLOWER, _NL_CTYPE_CLASS32, - _NL_CTYPE_NAMES_EB, - _NL_CTYPE_NAMES_EL, - _NL_CTYPE_HASH_SIZE_EB, - _NL_CTYPE_HASH_LAYERS_EB, + _NL_CTYPE_NAMES, + _NL_CTYPE_HASH_SIZE, + _NL_CTYPE_HASH_LAYERS, _NL_CTYPE_CLASS_NAMES, _NL_CTYPE_MAP_NAMES, _NL_CTYPE_WIDTH, @@ -336,10 +271,7 @@ enum #ifdef __USE_XOPEN CODESET = _NL_CTYPE_CODESET_NAME, #endif - _NL_CTYPE_HASH_SIZE_EL, - _NL_CTYPE_HASH_LAYERS_EL, - _NL_CTYPE_INDIGITS_MB_LEN_EB, - _NL_CTYPE_INDIGITS_MB_LEN_EL, + _NL_CTYPE_INDIGITS_MB_LEN, _NL_CTYPE_INDIGITS0_MB, _NL_CTYPE_INDIGITS1_MB, _NL_CTYPE_INDIGITS2_MB, @@ -350,28 +282,17 @@ enum _NL_CTYPE_INDIGITS7_MB, _NL_CTYPE_INDIGITS8_MB, _NL_CTYPE_INDIGITS9_MB, - _NL_CTYPE_INDIGITS_WC_LEN_EB, - _NL_CTYPE_INDIGITS_WC_LEN_EL, - _NL_CTYPE_INDIGITS0_WC_EB, - _NL_CTYPE_INDIGITS1_WC_EB, - _NL_CTYPE_INDIGITS2_WC_EB, - _NL_CTYPE_INDIGITS3_WC_EB, - _NL_CTYPE_INDIGITS4_WC_EB, - _NL_CTYPE_INDIGITS5_WC_EB, - _NL_CTYPE_INDIGITS6_WC_EB, - _NL_CTYPE_INDIGITS7_WC_EB, - _NL_CTYPE_INDIGITS8_WC_EB, - _NL_CTYPE_INDIGITS9_WC_EB, - _NL_CTYPE_INDIGITS0_WC_EL, - _NL_CTYPE_INDIGITS1_WC_EL, - _NL_CTYPE_INDIGITS2_WC_EL, - _NL_CTYPE_INDIGITS3_WC_EL, - _NL_CTYPE_INDIGITS4_WC_EL, - _NL_CTYPE_INDIGITS5_WC_EL, - _NL_CTYPE_INDIGITS6_WC_EL, - _NL_CTYPE_INDIGITS7_WC_EL, - _NL_CTYPE_INDIGITS8_WC_EL, - _NL_CTYPE_INDIGITS9_WC_EL, + _NL_CTYPE_INDIGITS_WC_LEN, + _NL_CTYPE_INDIGITS0_WC, + _NL_CTYPE_INDIGITS1_WC, + _NL_CTYPE_INDIGITS2_WC, + _NL_CTYPE_INDIGITS3_WC, + _NL_CTYPE_INDIGITS4_WC, + _NL_CTYPE_INDIGITS5_WC, + _NL_CTYPE_INDIGITS6_WC, + _NL_CTYPE_INDIGITS7_WC, + _NL_CTYPE_INDIGITS8_WC, + _NL_CTYPE_INDIGITS9_WC, _NL_CTYPE_OUTDIGIT0_MB, _NL_CTYPE_OUTDIGIT1_MB, _NL_CTYPE_OUTDIGIT2_MB, @@ -382,38 +303,22 @@ enum _NL_CTYPE_OUTDIGIT7_MB, _NL_CTYPE_OUTDIGIT8_MB, _NL_CTYPE_OUTDIGIT9_MB, - _NL_CTYPE_OUTDIGIT0_WC_EB, - _NL_CTYPE_OUTDIGIT1_WC_EB, - _NL_CTYPE_OUTDIGIT2_WC_EB, - _NL_CTYPE_OUTDIGIT3_WC_EB, - _NL_CTYPE_OUTDIGIT4_WC_EB, - _NL_CTYPE_OUTDIGIT5_WC_EB, - _NL_CTYPE_OUTDIGIT6_WC_EB, - _NL_CTYPE_OUTDIGIT7_WC_EB, - _NL_CTYPE_OUTDIGIT8_WC_EB, - _NL_CTYPE_OUTDIGIT9_WC_EB, - _NL_CTYPE_OUTDIGIT0_WC_EL, - _NL_CTYPE_OUTDIGIT1_WC_EL, - _NL_CTYPE_OUTDIGIT2_WC_EL, - _NL_CTYPE_OUTDIGIT3_WC_EL, - _NL_CTYPE_OUTDIGIT4_WC_EL, - _NL_CTYPE_OUTDIGIT5_WC_EL, - _NL_CTYPE_OUTDIGIT6_WC_EL, - _NL_CTYPE_OUTDIGIT7_WC_EL, - _NL_CTYPE_OUTDIGIT8_WC_EL, - _NL_CTYPE_OUTDIGIT9_WC_EL, - _NL_CTYPE_TRANSLIT_HASH_SIZE_EB, - _NL_CTYPE_TRANSLIT_HASH_SIZE_EL, - _NL_CTYPE_TRANSLIT_HASH_LAYERS_EB, - _NL_CTYPE_TRANSLIT_HASH_LAYERS_EL, - _NL_CTYPE_TRANSLIT_FROM_IDX_EB, - _NL_CTYPE_TRANSLIT_FROM_IDX_EL, - _NL_CTYPE_TRANSLIT_FROM_TBL_EB, - _NL_CTYPE_TRANSLIT_FROM_TBL_EL, - _NL_CTYPE_TRANSLIT_TO_IDX_EB, - _NL_CTYPE_TRANSLIT_TO_IDX_EL, - _NL_CTYPE_TRANSLIT_TO_TBL_EB, - _NL_CTYPE_TRANSLIT_TO_TBL_EL, + _NL_CTYPE_OUTDIGIT0_WC, + _NL_CTYPE_OUTDIGIT1_WC, + _NL_CTYPE_OUTDIGIT2_WC, + _NL_CTYPE_OUTDIGIT3_WC, + _NL_CTYPE_OUTDIGIT4_WC, + _NL_CTYPE_OUTDIGIT5_WC, + _NL_CTYPE_OUTDIGIT6_WC, + _NL_CTYPE_OUTDIGIT7_WC, + _NL_CTYPE_OUTDIGIT8_WC, + _NL_CTYPE_OUTDIGIT9_WC, + _NL_CTYPE_TRANSLIT_HASH_SIZE, + _NL_CTYPE_TRANSLIT_HASH_LAYERS, + _NL_CTYPE_TRANSLIT_FROM_IDX, + _NL_CTYPE_TRANSLIT_FROM_TBL, + _NL_CTYPE_TRANSLIT_TO_IDX, + _NL_CTYPE_TRANSLIT_TO_TBL, _NL_NUM_LC_CTYPE, /* LC_MONETARY category: formatting of monetary quantities. @@ -479,8 +384,7 @@ enum _NL_MONETARY_UNO_VALID_TO, _NL_MONETARY_DUO_VALID_FROM, _NL_MONETARY_DUO_VALID_TO, - _NL_MONETARY_CONVERSION_RATE_EB, - _NL_MONETARY_CONVERSION_RATE_EL, + _NL_MONETARY_CONVERSION_RATE, _NL_NUM_LC_MONETARY, /* LC_NUMERIC category: formatting of numbers. @@ -511,10 +415,8 @@ enum #define NOSTR NOSTR _NL_NUM_LC_MESSAGES, - _NL_PAPER_HEIGHT_EB = _NL_ITEM (LC_PAPER, 0), - _NL_PAPER_HEIGHT_EL, - _NL_PAPER_WIDTH_EB, - _NL_PAPER_WIDTH_EL, + _NL_PAPER_HEIGHT = _NL_ITEM (LC_PAPER, 0), + _NL_PAPER_WIDTH, _NL_NUM_LC_PAPER, _NL_NAME_NAME_FMT = _NL_ITEM (LC_NAME, 0), @@ -531,8 +433,7 @@ enum _NL_ADDRESS_COUNTRY_AB2, _NL_ADDRESS_COUNTRY_AB3, _NL_ADDRESS_COUNTRY_CAR, - _NL_ADDRESS_COUNTRY_NUM_EB, - _NL_ADDRESS_COUNTRY_NUM_EL, + _NL_ADDRESS_COUNTRY_NUM, _NL_ADDRESS_COUNTRY_ISBN, _NL_ADDRESS_LANG_NAME, _NL_ADDRESS_LANG_AB, diff --git a/locale/lc-collate.c b/locale/lc-collate.c index 2970ec3721..a012672b50 100644 --- a/locale/lc-collate.c +++ b/locale/lc-collate.c @@ -45,27 +45,20 @@ const u_int32_t *__collate_symbol_classeswc = _nl_C_LC_COLLATE_symbol_classes; void _nl_postload_collate (void) { -#if BYTE_ORDER == BIG_ENDIAN -#define bo(x) x##_EB -#elif BYTE_ORDER == LITTLE_ENDIAN -#define bo(x) x##_EL -#else -#error bizarre byte order -#endif #define paste(a,b) paste1(a,b) #define paste1(a,b) a##b #define current(x) \ ((const unsigned int *) _NL_CURRENT (LC_COLLATE, paste(_NL_COLLATE_,x))) - __collate_tablewc = current (bo (TABLEWC)); - __collate_extrawc = current (bo (EXTRAWC)); + __collate_tablewc = current (TABLEWC); + __collate_extrawc = current (EXTRAWC); - __collate_element_hash = current (bo (ELEM_HASH)); + __collate_element_hash = current (ELEM_HASH); __collate_element_strings = (const char *) current (ELEM_STR_POOL); - __collate_element_values = (const uint32_t *) current (bo (ELEM_VAL)); + __collate_element_values = (const uint32_t *) current (ELEM_VAL); - __collate_symbol_hash = current (bo (SYMB_HASH)); + __collate_symbol_hash = current (SYMB_HASH); __collate_symbol_strings = (const char *) current (SYMB_STR_POOL); - __collate_symbol_classeswc = current (bo (SYMB_CLASSWC)); + __collate_symbol_classeswc = current (SYMB_CLASSWC); } diff --git a/locale/lc-ctype.c b/locale/lc-ctype.c index be264eaa23..e3cb2f6741 100644 --- a/locale/lc-ctype.c +++ b/locale/lc-ctype.c @@ -1,5 +1,5 @@ /* Define current locale data for LC_CTYPE category. - Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998, 1999 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 @@ -34,13 +34,6 @@ _NL_CURRENT_DEFINE (LC_CTYPE); void _nl_postload_ctype (void) { -#if BYTE_ORDER == BIG_ENDIAN -#define bo(x) x##_EB -#elif BYTE_ORDER == LITTLE_ENDIAN -#define bo(x) x##_EL -#else -#error bizarre byte order -#endif #define paste(a,b) paste1(a,b) #define paste1(a,b) a##b @@ -52,9 +45,9 @@ _nl_postload_ctype (void) extern const unsigned char *__ctype_width; __ctype_b = current (uint16_t, CLASS, 128); - __ctype_toupper = current (uint32_t, bo (TOUPPER), 128); - __ctype_tolower = current (uint32_t, bo (TOLOWER), 128); + __ctype_toupper = current (uint32_t, TOUPPER, 128); + __ctype_tolower = current (uint32_t, TOLOWER, 128); __ctype32_b = current (uint32_t, CLASS32, 0); - __ctype_names = current (uint32_t, bo (NAMES), 0); + __ctype_names = current (uint32_t, NAMES, 0); __ctype_width = current (unsigned char, WIDTH, 0); } diff --git a/locale/lc-monetary.c b/locale/lc-monetary.c index 6af60a5836..87190b7820 100644 --- a/locale/lc-monetary.c +++ b/locale/lc-monetary.c @@ -1,5 +1,5 @@ /* Define current locale data for LC_MONETARY category. - Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1995, 1997, 1998, 1999 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,24 +20,3 @@ #include "localeinfo.h" _NL_CURRENT_DEFINE (LC_MONETARY); - -const uint32_t *__monetary_conversion_rate; - -void -_nl_postload_monetary (void) -{ -#if BYTE_ORDER == BIG_ENDIAN -#define bo(x) x##_EB -#elif BYTE_ORDER == LITTLE_ENDIAN -#define bo(x) x##_EL -#else -#error bizarre byte order -#endif -#define paste(a,b) paste1(a,b) -#define paste1(a,b) a##b - -#define current(type,x,offset) \ - ((const type *) _NL_CURRENT (LC_MONETARY, paste(_NL_MONETARY_,x)) + offset) - - __monetary_conversion_rate = current (uint32_t, bo (CONVERSION_RATE), 0); -} diff --git a/locale/lc-time.c b/locale/lc-time.c index 77888bb666..533e2e0d4c 100644 --- a/locale/lc-time.c +++ b/locale/lc-time.c @@ -64,13 +64,8 @@ _nl_get_era_entry (const struct tm *tp) if (era_initialized == 0) { -#if __BYTE_ORDER == __LITTLE_ENDIAN size_t new_num_eras = _NL_CURRENT_WORD (LC_TIME, - _NL_TIME_ERA_NUM_ENTRIES_EL); -#else - size_t new_num_eras = _NL_CURRENT_WORD (LC_TIME, - _NL_TIME_ERA_NUM_ENTRIES_EB); -#endif + _NL_TIME_ERA_NUM_ENTRIES); if (eras != NULL && new_num_eras == 0) { @@ -86,11 +81,7 @@ _nl_get_era_entry (const struct tm *tp) num_eras = 0; else { -#if __BYTE_ORDER == __LITTLE_ENDIAN - const char *ptr = _NL_CURRENT (LC_TIME, _NL_TIME_ERA_ENTRIES_EL); -#else - const char *ptr = _NL_CURRENT (LC_TIME, _NL_TIME_ERA_ENTRIES_EB); -#endif + const char *ptr = _NL_CURRENT (LC_TIME, _NL_TIME_ERA_ENTRIES); num_eras = new_num_eras; for (cnt = 0; cnt < num_eras; ++cnt) @@ -193,11 +184,7 @@ _nl_get_walt_digit (unsigned int number) if (walt_digits != NULL) { -#if __BYTE_ORDER == __LITTLE_ENDIAN - const wchar_t *ptr = _NL_CURRENT_WSTR (LC_TIME, _NL_WALT_DIGITS_EL); -#else - const wchar_t *ptr = _NL_CURRENT_WSTR (LC_TIME, _NL_WALT_DIGITS_EB); -#endif + const wchar_t *ptr = _NL_CURRENT_WSTR (LC_TIME, _NL_WALT_DIGITS); size_t cnt; for (cnt = 0; cnt < 100; ++cnt) diff --git a/locale/loadlocale.c b/locale/loadlocale.c index 121798782e..d829309f9f 100644 --- a/locale/loadlocale.c +++ b/locale/loadlocale.c @@ -18,7 +18,6 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include #include #include #include @@ -70,15 +69,8 @@ _nl_load_locale (struct loaded_l10nfile *file, int category) struct stat st; struct locale_data *newdata; int save_err; - int swap = 0; int mmaped = 1; size_t cnt; - inline unsigned int SWAP (const unsigned int *inw) - { - if (!swap) - return *inw; - return bswap_32 (*inw); - } file->decided = 1; file->data = NULL; @@ -164,28 +156,18 @@ _nl_load_locale (struct loaded_l10nfile *file, int category) /* This cannot be a locale data file since it's too small. */ goto puntfd; - if (filedata->magic == LIMAGIC (category)) - /* Good data file in our byte order. */ - swap = 0; - else + if (filedata->magic != LIMAGIC (category)) + /* Bad data file in either byte order. */ { - /* Try the other byte order. */ - swap = 1; - if (SWAP (&filedata->magic) != LIMAGIC (category)) - /* Bad data file in either byte order. */ - { - puntmap: - __munmap ((caddr_t) filedata, st.st_size); - puntfd: - __close (fd); - return; - } + puntmap: + __munmap ((caddr_t) filedata, st.st_size); + puntfd: + __close (fd); + return; } -#define W(word) SWAP (&(word)) - - if (W (filedata->nstrings) < _nl_category_num_items[category] || - (sizeof *filedata + W (filedata->nstrings) * sizeof (unsigned int) + if (filedata->nstrings < _nl_category_num_items[category] || + (sizeof *filedata + filedata->nstrings * sizeof (unsigned int) >= (size_t) st.st_size)) { /* Insufficient data. */ @@ -207,7 +189,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category) newdata->nstrings = _nl_category_num_items[category]; for (cnt = 0; cnt < newdata->nstrings; ++cnt) { - off_t idx = W (filedata->strindex[cnt]); + off_t idx = filedata->strindex[cnt]; if (idx >= newdata->filesize) { free (newdata); @@ -215,8 +197,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category) goto puntmap; } if (_nl_value_types[category][cnt] == word) - newdata->values[cnt].word = W (*((u_int32_t *) (newdata->filedata - + idx))); + newdata->values[cnt].word = *((u_int32_t *) (newdata->filedata + idx)); else newdata->values[cnt].string = newdata->filedata + idx; } diff --git a/locale/newlocale.c b/locale/newlocale.c index 61a72c4aeb..4a2f14513f 100644 --- a/locale/newlocale.c +++ b/locale/newlocale.c @@ -177,19 +177,10 @@ __newlocale (int category_mask, const char *locale, __locale_t base) union locale_data_value *ctypes = result_ptr->__locales[LC_CTYPE]->values; result_ptr->__ctype_b = (const unsigned short int *) (ctypes[_NL_ITEM_INDEX (_NL_CTYPE_CLASS)] .string); -#if BYTE_ORDER == BIG_ENDIAN result_ptr->__ctype_tolower = (const int *) - (ctypes[_NL_ITEM_INDEX (_NL_CTYPE_TOLOWER_EB)].string); + (ctypes[_NL_ITEM_INDEX (_NL_CTYPE_TOLOWER)].string); result_ptr->__ctype_toupper = (const int *) - (ctypes[_NL_ITEM_INDEX (_NL_CTYPE_TOUPPER_EB)].string); -#elif BYTE_ORDER == LITTLE_ENDIAN - result_ptr->__ctype_tolower = (const int *) - (ctypes[_NL_ITEM_INDEX (_NL_CTYPE_TOLOWER_EL)].string); - result_ptr->__ctype_toupper = (const int *) - (ctypes[_NL_ITEM_INDEX (_NL_CTYPE_TOUPPER_EL)].string); -#else -#error bizarre byte order -#endif + (ctypes[_NL_ITEM_INDEX (_NL_CTYPE_TOUPPER)].string); } return result_ptr; diff --git a/locale/programs/ld-address.c b/locale/programs/ld-address.c index 49900bd471..6dce62bf8f 100644 --- a/locale/programs/ld-address.c +++ b/locale/programs/ld-address.c @@ -68,7 +68,6 @@ struct locale_address_t const char *country_ab2; const char *country_ab3; uint32_t country_num; - uint32_t country_num_ob; const char *country_car; const char *country_isbn; const char *lang_name; @@ -295,7 +294,6 @@ address_finish (struct localedef_t *locale, struct charmap_t *charmap) %s: numeric country code `%d' not valid"), "LC_ADDRESS", address->country_num); } - address->country_num_ob = bswap_32 (address->country_num); if (address->country_ab2 == NULL) { @@ -373,21 +371,8 @@ address_output (struct localedef_t *locale, struct charmap_t *charmap, iov[cnt].iov_len = strlen (iov[cnt].iov_base) + 1; ++cnt; -#if __BYTE_ORDER == __LITTLE_ENDIAN -# define country_num_eb country_num_ob -# define country_num_el country_num -#else -# define country_num_eb country_num -# define country_num_el country_num_ob -#endif - - idx[cnt - 2] = idx[cnt - 3] + iov[cnt - 1].iov_len; - iov[cnt].iov_base = (void *) address->country_num_eb; - iov[cnt].iov_len = sizeof (uint32_t); - ++cnt; - idx[cnt - 2] = idx[cnt - 3] + iov[cnt - 1].iov_len; - iov[cnt].iov_base = (void *) address->country_num_el; + iov[cnt].iov_base = (void *) address->country_num; iov[cnt].iov_len = sizeof (uint32_t); ++cnt; diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c index 6dea9d0dd8..d587288db7 100644 --- a/locale/programs/ld-ctype.c +++ b/locale/programs/ld-ctype.c @@ -65,9 +65,7 @@ the number of bits for character classes to 16. When compatibility is not necessary anymore increase the number to 32. */ #define char_class_t uint16_t -#define CHAR_CLASS_TRANS bswap_16 #define char_class32_t uint32_t -#define CHAR_CLASS32_TRANS bswap_32 /* Type to describe a transliteration action. We have a possibly @@ -144,27 +142,19 @@ struct locale_ctype_t uint32_t plane_cnt; char_class_t *ctype_b; char_class32_t *ctype32_b; - uint32_t *names_el; - uint32_t *names_eb; - uint32_t **map_eb; - uint32_t **map_el; + uint32_t *names; + uint32_t **map; uint32_t *class_name_ptr; uint32_t *map_name_ptr; unsigned char *width; uint32_t mb_cur_max; const char *codeset_name; - uint32_t translit_hash_size_eb; - uint32_t translit_hash_size_el; - uint32_t translit_hash_layers_eb; - uint32_t translit_hash_layers_el; - uint32_t *translit_from_idx_eb; - uint32_t *translit_from_idx_el; - uint32_t *translit_from_tbl_eb; - uint32_t *translit_from_tbl_el; - uint32_t *translit_to_idx_eb; - uint32_t *translit_to_idx_el; - uint32_t *translit_to_tbl_eb; - uint32_t *translit_to_tbl_el; + uint32_t translit_hash_size; + uint32_t translit_hash_layers; + uint32_t *translit_from_idx; + uint32_t *translit_from_tbl; + uint32_t *translit_to_idx; + uint32_t *translit_to_tbl; size_t translit_idx_size; size_t translit_from_tbl_size; size_t translit_to_tbl_size; @@ -740,21 +730,12 @@ ctype_output (struct localedef_t *locale, struct charmap_t *charmap, ctype->ctype_b, (256 + 128) * sizeof (char_class_t)); - CTYPE_DATA (_NL_CTYPE_TOUPPER_EB, - ctype->map_eb[0], + CTYPE_DATA (_NL_CTYPE_TOUPPER, + ctype->map[0], (ctype->plane_size * ctype->plane_cnt + 128) * sizeof (uint32_t)); - CTYPE_DATA (_NL_CTYPE_TOLOWER_EB, - ctype->map_eb[1], - (ctype->plane_size * ctype->plane_cnt + 128) - * sizeof (uint32_t)); - - CTYPE_DATA (_NL_CTYPE_TOUPPER_EL, - ctype->map_el[0], - (ctype->plane_size * ctype->plane_cnt + 128) - * sizeof (uint32_t)); - CTYPE_DATA (_NL_CTYPE_TOLOWER_EL, - ctype->map_el[1], + CTYPE_DATA (_NL_CTYPE_TOLOWER, + ctype->map[1], (ctype->plane_size * ctype->plane_cnt + 128) * sizeof (uint32_t)); @@ -763,90 +744,34 @@ ctype_output (struct localedef_t *locale, struct charmap_t *charmap, (ctype->plane_size * ctype->plane_cnt * sizeof (char_class32_t))); - CTYPE_DATA (_NL_CTYPE_NAMES_EB, - ctype->names_eb, (ctype->plane_size * ctype->plane_cnt - * sizeof (uint32_t))); - CTYPE_DATA (_NL_CTYPE_NAMES_EL, - ctype->names_el, (ctype->plane_size * ctype->plane_cnt - * sizeof (uint32_t))); - - CTYPE_DATA (_NL_CTYPE_TRANSLIT_HASH_SIZE_EB, - &ctype->translit_hash_size_eb, sizeof (uint32_t)); - CTYPE_DATA (_NL_CTYPE_TRANSLIT_HASH_SIZE_EL, - &ctype->translit_hash_size_el, sizeof (uint32_t)); - CTYPE_DATA (_NL_CTYPE_TRANSLIT_HASH_LAYERS_EB, - &ctype->translit_hash_layers_eb, sizeof (uint32_t)); - CTYPE_DATA (_NL_CTYPE_TRANSLIT_HASH_LAYERS_EL, - &ctype->translit_hash_layers_el, sizeof (uint32_t)); - - CTYPE_DATA (_NL_CTYPE_TRANSLIT_FROM_IDX_EB, - ctype->translit_from_idx_eb, - ctype->translit_idx_size); - CTYPE_DATA (_NL_CTYPE_TRANSLIT_FROM_IDX_EL, - ctype->translit_from_idx_el, + CTYPE_DATA (_NL_CTYPE_NAMES, + ctype->names, (ctype->plane_size * ctype->plane_cnt + * sizeof (uint32_t))); + + CTYPE_DATA (_NL_CTYPE_TRANSLIT_HASH_SIZE, + &ctype->translit_hash_size, sizeof (uint32_t)); + CTYPE_DATA (_NL_CTYPE_TRANSLIT_HASH_LAYERS, + &ctype->translit_hash_layers, sizeof (uint32_t)); + + CTYPE_DATA (_NL_CTYPE_TRANSLIT_FROM_IDX, + ctype->translit_from_idx, ctype->translit_idx_size); - CTYPE_DATA (_NL_CTYPE_TRANSLIT_FROM_TBL_EB, - ctype->translit_from_tbl_eb, - ctype->translit_from_tbl_size); - CTYPE_DATA (_NL_CTYPE_TRANSLIT_FROM_TBL_EL, - ctype->translit_from_tbl_el, + CTYPE_DATA (_NL_CTYPE_TRANSLIT_FROM_TBL, + ctype->translit_from_tbl, ctype->translit_from_tbl_size); - CTYPE_DATA (_NL_CTYPE_TRANSLIT_TO_IDX_EB, - ctype->translit_to_idx_eb, - ctype->translit_idx_size); - CTYPE_DATA (_NL_CTYPE_TRANSLIT_TO_IDX_EL, - ctype->translit_to_idx_el, + CTYPE_DATA (_NL_CTYPE_TRANSLIT_TO_IDX, + ctype->translit_to_idx, ctype->translit_idx_size); - CTYPE_DATA (_NL_CTYPE_TRANSLIT_TO_TBL_EB, - ctype->translit_to_tbl_eb, ctype->translit_to_tbl_size); - CTYPE_DATA (_NL_CTYPE_TRANSLIT_TO_TBL_EL, - ctype->translit_to_tbl_el, ctype->translit_to_tbl_size); + CTYPE_DATA (_NL_CTYPE_TRANSLIT_TO_TBL, + ctype->translit_to_tbl, ctype->translit_to_tbl_size); -#if __BYTE_ORDER == __BIG_ENDIAN - CTYPE_DATA (_NL_CTYPE_HASH_SIZE_EB, + CTYPE_DATA (_NL_CTYPE_HASH_SIZE, &ctype->plane_size, sizeof (uint32_t)); - CTYPE_DATA (_NL_CTYPE_HASH_LAYERS_EB, + CTYPE_DATA (_NL_CTYPE_HASH_LAYERS, &ctype->plane_cnt, sizeof (uint32_t)); -#else - case _NL_ITEM_INDEX (_NL_CTYPE_HASH_SIZE_EB): - iov[2 + elem + offset].iov_base = - (uint32_t *) alloca (sizeof (uint32_t)); - *(uint32_t *) iov[2 + elem + offset].iov_base = - bswap_32 (ctype->plane_size); - iov[2 + elem + offset].iov_len = sizeof (uint32_t); - break; - case _NL_ITEM_INDEX (_NL_CTYPE_HASH_LAYERS_EB): - iov[2 + elem + offset].iov_base = - (uint32_t *) alloca (sizeof (uint32_t)); - *(uint32_t *) iov[2 + elem + offset].iov_base = - bswap_32 (ctype->plane_cnt); - iov[2 + elem + offset].iov_len = sizeof (uint32_t); - break; -#endif -#if __BYTE_ORDER == __BIG_ENDIAN - CTYPE_DATA (_NL_CTYPE_HASH_SIZE_EL, - &ctype->plane_size, sizeof (uint32_t)); - CTYPE_DATA (_NL_CTYPE_HASH_LAYERS_EL, - &ctype->plane_cnt, sizeof (uint32_t)); -#else - case _NL_ITEM_INDEX (_NL_CTYPE_HASH_SIZE_EL): - iov[2 + elem + offset].iov_base = - (uint32_t *) alloca (sizeof (uint32_t)); - *(uint32_t *) iov[2 + elem + offset].iov_base = - bswap_32 (ctype->plane_size); - iov[2 + elem + offset].iov_len = sizeof (uint32_t); - break; - case _NL_ITEM_INDEX (_NL_CTYPE_HASH_LAYERS_EL): - iov[2 + elem + offset].iov_base = - (uint32_t *) alloca (sizeof (uint32_t)); - *(uint32_t *) iov[2 + elem + offset].iov_base = - bswap_32 (ctype->plane_cnt); - iov[2 + elem + offset].iov_len = sizeof (uint32_t); - break; -#endif case _NL_ITEM_INDEX (_NL_CTYPE_CLASS_NAMES): /* The class name array. */ @@ -906,34 +831,18 @@ ctype_output (struct localedef_t *locale, struct charmap_t *charmap, idx[elem + 1] = idx[elem] + iov[2 + elem + offset].iov_len; break; - case _NL_ITEM_INDEX (_NL_CTYPE_INDIGITS_MB_LEN_EB): - case _NL_ITEM_INDEX (_NL_CTYPE_INDIGITS_MB_LEN_EL): + case _NL_ITEM_INDEX (_NL_CTYPE_INDIGITS_MB_LEN): iov[2 + elem + offset].iov_base = alloca (sizeof (uint32_t)); iov[2 + elem + offset].iov_len = sizeof (uint32_t); - if ((elem == _NL_ITEM_INDEX (_NL_CTYPE_INDIGITS_MB_LEN_EB) - && __BYTE_ORDER == __BIG_ENDIAN) - || (elem == _NL_ITEM_INDEX (_NL_CTYPE_INDIGITS_MB_LEN_EL) - && __BYTE_ORDER == __LITTLE_ENDIAN)) - *(uint32_t *) iov[2 + elem + offset].iov_base = - ctype->mbdigits_act / 10; - else - *(uint32_t *) iov[2 + elem + offset].iov_base = - bswap_32 (ctype->mbdigits_act / 10); + *(uint32_t *) iov[2 + elem + offset].iov_base = + ctype->mbdigits_act / 10; break; - case _NL_ITEM_INDEX (_NL_CTYPE_INDIGITS_WC_LEN_EB): - case _NL_ITEM_INDEX (_NL_CTYPE_INDIGITS_WC_LEN_EL): + case _NL_ITEM_INDEX (_NL_CTYPE_INDIGITS_WC_LEN): iov[2 + elem + offset].iov_base = alloca (sizeof (uint32_t)); iov[2 + elem + offset].iov_len = sizeof (uint32_t); - if ((elem == _NL_ITEM_INDEX (_NL_CTYPE_INDIGITS_WC_LEN_EB) - && __BYTE_ORDER == __BIG_ENDIAN) - || (elem == _NL_ITEM_INDEX (_NL_CTYPE_INDIGITS_WC_LEN_EL) - && __BYTE_ORDER == __LITTLE_ENDIAN)) - *(uint32_t *) iov[2 + elem + offset].iov_base = - ctype->wcdigits_act / 10; - else - *(uint32_t *) iov[2 + elem + offset].iov_base = - bswap_32 (ctype->wcdigits_act / 10); + *(uint32_t *) iov[2 + elem + offset].iov_base = + ctype->wcdigits_act / 10; break; case _NL_ITEM_INDEX (_NL_CTYPE_INDIGITS0_MB) ... _NL_ITEM_INDEX (_NL_CTYPE_INDIGITS9_MB): @@ -973,59 +882,25 @@ ctype_output (struct localedef_t *locale, struct charmap_t *charmap, ctype->mbdigits[cnt]->nbytes) = '\0'; break; - case _NL_ITEM_INDEX (_NL_CTYPE_INDIGITS0_WC_EB) ... _NL_ITEM_INDEX (_NL_CTYPE_INDIGITS9_WC_EB): - total = ctype->wcdigits_act / 10; - - iov[2 + elem + offset].iov_base = - (uint32_t *) alloca (total * sizeof (uint32_t)); - iov[2 + elem + offset].iov_len = total * sizeof (uint32_t); - - for (cnt = elem - _NL_CTYPE_INDIGITS0_WC_EB; - cnt < ctype->wcdigits_act; cnt += 10) - ((uint32_t *) iov[2 + elem + offset].iov_base)[cnt / 10] - = (__BYTE_ORDER == __LITTLE_ENDIAN - ? bswap_32 (ctype->wcdigits[cnt]) : ctype->wcdigits[cnt]); - break; - - case _NL_ITEM_INDEX (_NL_CTYPE_INDIGITS0_WC_EL) ... _NL_ITEM_INDEX (_NL_CTYPE_INDIGITS9_WC_EL): + case _NL_ITEM_INDEX (_NL_CTYPE_INDIGITS0_WC) ... _NL_ITEM_INDEX (_NL_CTYPE_INDIGITS9_WC): total = ctype->wcdigits_act / 10; iov[2 + elem + offset].iov_base = (uint32_t *) alloca (total * sizeof (uint32_t)); iov[2 + elem + offset].iov_len = total * sizeof (uint32_t); - for (cnt = elem - _NL_CTYPE_INDIGITS0_WC_EL; + for (cnt = elem - _NL_CTYPE_INDIGITS0_WC; cnt < ctype->wcdigits_act; cnt += 10) ((uint32_t *) iov[2 + elem + offset].iov_base)[cnt / 10] - = (__BYTE_ORDER == __BIG_ENDIAN - ? bswap_32 (ctype->wcdigits[cnt]) : ctype->wcdigits[cnt]); + = ctype->wcdigits[cnt]; break; -#if __BYTE_ORDER == __BIG_ENDIAN - case _NL_ITEM_INDEX (_NL_CTYPE_OUTDIGIT0_WC_EB) ... _NL_ITEM_INDEX (_NL_CTYPE_OUTDIGIT9_WC_EB): - cnt = elem - _NL_CTYPE_OUTDIGIT0_WC_EB; -#else - case _NL_ITEM_INDEX (_NL_CTYPE_OUTDIGIT0_WC_EL) ... _NL_ITEM_INDEX (_NL_CTYPE_OUTDIGIT9_WC_EL): - cnt = elem - _NL_CTYPE_OUTDIGIT0_WC_EL; -#endif + case _NL_ITEM_INDEX (_NL_CTYPE_OUTDIGIT0_WC) ... _NL_ITEM_INDEX (_NL_CTYPE_OUTDIGIT9_WC): + cnt = elem - _NL_CTYPE_OUTDIGIT0_WC; iov[2 + elem + offset].iov_base = &ctype->wcoutdigits[cnt]; iov[2 + elem + offset].iov_len = sizeof (uint32_t); break; -#if __BYTE_ORDER == __LITTLE_ENDIAN - case _NL_ITEM_INDEX (_NL_CTYPE_OUTDIGIT0_WC_EB) ... _NL_ITEM_INDEX (_NL_CTYPE_OUTDIGIT9_WC_EB): - cnt = elem - _NL_CTYPE_OUTDIGIT0_WC_EB; -#else - case _NL_ITEM_INDEX (_NL_CTYPE_OUTDIGIT0_WC_EL) ... _NL_ITEM_INDEX (_NL_CTYPE_OUTDIGIT9_WC_EL): - cnt = elem - _NL_CTYPE_OUTDIGIT0_WC_EL; -#endif - iov[2 + elem + offset].iov_base = - (uint32_t *) alloca (sizeof (uint32_t)); - *(uint32_t *) iov[2 + elem + offset].iov_base = - bswap_32 (ctype->wcoutdigits[cnt]); - iov[2 + elem + offset].iov_len = sizeof (uint32_t); - break; - default: assert (! "unknown CTYPE element"); } @@ -1034,11 +909,7 @@ ctype_output (struct localedef_t *locale, struct charmap_t *charmap, /* Handle extra maps. */ size_t nr = (elem - _NL_ITEM_INDEX (_NL_NUM_LC_CTYPE)) >> 1; - if (((elem - _NL_ITEM_INDEX (_NL_NUM_LC_CTYPE)) & 1) == 0) - iov[2 + elem + offset].iov_base = ctype->map_eb[nr]; - else - iov[2 + elem + offset].iov_base = ctype->map_el[nr]; - + iov[2 + elem + offset].iov_base = ctype->map[nr]; iov[2 + elem + offset].iov_len = ((ctype->plane_size * ctype->plane_cnt + 128) * sizeof (uint32_t)); @@ -2976,45 +2847,31 @@ Computing table size for character classes might take a while..."), fputs (_(" done\n"), stderr); -#if __BYTE_ORDER == __LITTLE_ENDIAN -# define NAMES_B1 ctype->names_el -# define NAMES_B2 ctype->names_eb -#else -# define NAMES_B1 ctype->names_eb -# define NAMES_B2 ctype->names_el -#endif - - ctype->names_eb = (uint32_t *) xcalloc (ctype->plane_size - * ctype->plane_cnt, - sizeof (uint32_t)); - ctype->names_el = (uint32_t *) xcalloc (ctype->plane_size - * ctype->plane_cnt, - sizeof (uint32_t)); + ctype->names = (uint32_t *) xcalloc (ctype->plane_size + * ctype->plane_cnt, + sizeof (uint32_t)); for (idx = 1; idx < 256; ++idx) - NAMES_B1[idx] = idx; + ctype->names[idx] = idx; /* Trick: change the 0th entry's name to 1 to mark the cell occupied. */ - NAMES_B1[0] = 1; + ctype->names[0] = 1; for (idx = 256; idx < ctype->charnames_act; ++idx) { size_t nr = (ctype->charnames[idx] % ctype->plane_size); size_t depth = 0; - while (NAMES_B1[nr + depth * ctype->plane_size]) + while (ctype->names[nr + depth * ctype->plane_size]) ++depth; assert (depth < ctype->plane_cnt); - NAMES_B1[nr + depth * ctype->plane_size] = ctype->charnames[idx]; + ctype->names[nr + depth * ctype->plane_size] = ctype->charnames[idx]; /* Now for faster access remember the index in the NAMES_B array. */ ctype->charnames[idx] = nr + depth * ctype->plane_size; } - NAMES_B1[0] = 0; - - for (idx = 0; idx < ctype->plane_size * ctype->plane_cnt; ++idx) - NAMES_B2[idx] = bswap_32 (NAMES_B1[idx]); + ctype->names[0] = 0; /* You wonder about this amount of memory? This is only because some @@ -3028,18 +2885,9 @@ Computing table size for character classes might take a while..."), * ctype->plane_cnt, sizeof (char_class32_t)); - /* Fill in the character class information. */ -#if __BYTE_ORDER == __LITTLE_ENDIAN -# define TRANS(w) CHAR_CLASS_TRANS (w) -# define TRANS32(w) CHAR_CLASS32_TRANS (w) -#else -# define TRANS(w) (w) -# define TRANS32(w) (w) -#endif - - /* This is the array accessed usig the multibyte string elements. */ + /* This is the array accessed using the multibyte string elements. */ for (idx = 0; idx < 256; ++idx) - ctype->ctype_b[128 + idx] = TRANS (ctype->class256_collection[idx]); + ctype->ctype_b[128 + idx] = ctype->class256_collection[idx]; /* Mirror first 127 entries. We must take care that entry -1 is not mirrored because EOF == -1. */ @@ -3048,14 +2896,11 @@ Computing table size for character classes might take a while..."