]> sourceware.org Git - glibc.git/blame - locale/lc-collate.c
update from main archive 960921
[glibc.git] / locale / lc-collate.c
CommitLineData
883bc19b 1/* Define current locale data for LC_COLLATE category.
19bc17a9 2Copyright (C) 1995, 1996 Free Software Foundation, Inc.
883bc19b
RM
3This file is part of the GNU C Library.
4
5The GNU C Library is free software; you can redistribute it and/or
6modify it under the terms of the GNU Library General Public License as
7published by the Free Software Foundation; either version 2 of the
8License, or (at your option) any later version.
9
10The GNU C Library is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13Library General Public License for more details.
14
15You should have received a copy of the GNU Library General Public
16License along with the GNU C Library; see the file COPYING.LIB. If
19bc17a9
RM
17not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18Boston, MA 02111-1307, USA. */
883bc19b
RM
19
20#include "localeinfo.h"
19bc17a9 21#include <endian.h>
883bc19b 22
ce7a5ef4
RM
23
24extern const u_int32_t _nl_C_LC_COLLATE_symbol_hash[];
25extern const char _nl_C_LC_COLLATE_symbol_strings[];
26extern const u_int32_t _nl_C_LC_COLLATE_symbol_classes[];
27
28
883bc19b 29_NL_CURRENT_DEFINE (LC_COLLATE);
19bc17a9 30
ce7a5ef4
RM
31const u_int32_t *__collate_table = NULL;
32const u_int32_t *__collate_extra = NULL;
33
34const u_int32_t *__collate_element_hash = NULL;
35const char *__collate_element_strings = NULL;
36const wchar_t *__collate_element_values = NULL;
19bc17a9 37
ce7a5ef4
RM
38const u_int32_t *__collate_symbol_hash = _nl_C_LC_COLLATE_symbol_hash;
39const char *__collate_symbol_strings = _nl_C_LC_COLLATE_symbol_strings;
40const u_int32_t *__collate_symbol_classes = _nl_C_LC_COLLATE_symbol_classes;
19bc17a9 41
ce7a5ef4
RM
42
43/* We are called after loading LC_CTYPE data to load it into
44 the variables used by the collation functions and regex. */
19bc17a9
RM
45void
46_nl_postload_collate (void)
47{
48#if BYTE_ORDER == BIG_ENDIAN
49#define bo(x) x##_EB
50#elif BYTE_ORDER == LITTLE_ENDIAN
51#define bo(x) x##_EL
52#else
53#error bizarre byte order
54#endif
55#define paste(a,b) paste1(a,b)
56#define paste1(a,b) a##b
57
58#define current(x) \
59 ((const unsigned int *) _NL_CURRENT (LC_COLLATE, paste(_NL_COLLATE_,x)))
60
61 __collate_table = current (bo (TABLE));
62 __collate_extra = current (bo (EXTRA));
ce7a5ef4
RM
63
64 __collate_element_hash = current (bo (ELEM_HASH));
65 __collate_element_strings = (const char *) current (ELEM_STR_POOL);
66 __collate_element_values = (const wchar_t *) current (bo (ELEM_VAL));
67
68 __collate_symbol_hash = current (bo (SYMB_HASH));
69 __collate_symbol_strings = (const char *) current (SYMB_STR_POOL);
70 __collate_symbol_classes = current (bo (SYMB_CLASS));
19bc17a9 71}
This page took 0.055991 seconds and 5 git commands to generate.