about summary refs log tree commit diff
path: root/locale/lc-collate.c
diff options
context:
space:
mode:
Diffstat (limited to 'locale/lc-collate.c')
-rw-r--r--locale/lc-collate.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/locale/lc-collate.c b/locale/lc-collate.c
index 8684f23266..911477b6bd 100644
--- a/locale/lc-collate.c
+++ b/locale/lc-collate.c
@@ -1,5 +1,5 @@
 /* Define current locale data for LC_COLLATE category.
-Copyright (C) 1995 Free Software Foundation, Inc.
+Copyright (C) 1995, 1996 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
@@ -14,9 +14,34 @@ 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., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
 
 #include "localeinfo.h"
+#include <endian.h>
 
 _NL_CURRENT_DEFINE (LC_COLLATE);
+
+const u32_t *__collate_table;
+const u32_t *__collate_extra;
+
+
+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_table = current (bo (TABLE));
+  __collate_extra = current (bo (EXTRA));
+}