2 * Copyright (c) 1995 Alex Tatmanjants <alex@elvisti.kiev.ua>
3 * at Electronni Visti IA, Kiev, Ukraine.
6 * Copyright (c) 2011 The FreeBSD Foundation
8 * Portions of this software were developed by David Chisnall
9 * under sponsorship from the FreeBSD Foundation.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
20 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 #include <sys/cdefs.h>
39 #include <sys/types.h>
41 #include "xlocale_private.h"
44 #define TABLE_SIZE 100
45 #define COLLATE_VERSION "1.0\n"
46 #define COLLATE_VERSION1_2 "1.2\n"
48 struct __collate_st_char_pri {
51 struct __collate_st_chain_pri {
56 #define __collate_substitute_table (*__collate_substitute_table_ptr)
57 #define __collate_char_pri_table (*__collate_char_pri_table_ptr)
59 struct xlocale_collate {
60 struct xlocale_component header;
61 int __collate_load_error;
62 int __collate_substitute_nontrivial;
64 u_char (*__collate_substitute_table_ptr)[UCHAR_MAX + 1][STR_LEN];
65 struct __collate_st_char_pri (*__collate_char_pri_table_ptr)[UCHAR_MAX + 1];
66 struct __collate_st_chain_pri *__collate_chain_pri_table;
71 u_char *__collate_strdup(u_char *);
72 u_char *__collate_substitute(struct xlocale_collate *, const u_char *);
73 int __collate_load_tables(const char *);
74 void __collate_lookup(struct xlocale_collate *, const u_char *, int *, int *, int *);
75 int __collate_range_cmp(struct xlocale_collate *, int, int);
77 void __collate_print_tables(void);
81 #endif /* !_COLLATE_H_ */