1 --- collate.h.orig 2003-05-20 15:21:44.000000000 -0700
2 +++ collate.h 2005-10-20 00:05:25.000000000 -0700
9 +#endif /* !__LIBC__ */
13 #define TABLE_SIZE 100
14 #define COLLATE_VERSION "1.0\n"
15 #define COLLATE_VERSION1_1 "1.1\n"
16 +#define COLLATE_VERSION1_1A "1.1A\n"
17 +/* see discussion in string/FreeBSD/strxfrm for this value */
18 +#define COLLATE_MAX_PRIORITY ((1 << 24) - 1)
20 +#define DIRECTIVE_UNDEF 0x00
21 +#define DIRECTIVE_FORWARD 0x01
22 +#define DIRECTIVE_BACKWARD 0x02
23 +#define DIRECTIVE_POSITION 0x04
25 +#define DIRECTIVE_DIRECTION_MASK (DIRECTIVE_FORWARD | DIRECTIVE_BACKWARD)
27 +#define COLLATE_SUBST_DUP 0x0001
29 +#define IGNORE_EQUIV_CLASS 1
31 +struct __collate_st_info {
32 + __uint8_t directive[COLL_WEIGHTS_MAX];
34 +#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN
35 + __uint8_t directive_count:4;
36 + __uint8_t chain_max_len:4;
38 + __uint8_t chain_max_len:4;
39 + __uint8_t directive_count:4;
41 + __int32_t undef_pri[COLL_WEIGHTS_MAX];
42 + __int32_t subst_count[COLL_WEIGHTS_MAX];
43 + __int32_t chain_count;
44 + __int32_t large_pri_count;
47 struct __collate_st_char_pri {
49 + __int32_t pri[COLL_WEIGHTS_MAX];
51 struct __collate_st_chain_pri {
52 - u_char str[STR_LEN];
54 + __darwin_wchar_t str[STR_LEN];
55 + __int32_t pri[COLL_WEIGHTS_MAX];
57 +struct __collate_st_large_char_pri {
59 + struct __collate_st_char_pri pri;
61 +struct __collate_st_subst {
63 + __darwin_wchar_t str[STR_LEN];
67 extern int __collate_load_error;
68 extern int __collate_substitute_nontrivial;
69 -#define __collate_substitute_table (*__collate_substitute_table_ptr)
70 -extern u_char __collate_substitute_table[UCHAR_MAX + 1][STR_LEN];
71 #define __collate_char_pri_table (*__collate_char_pri_table_ptr)
72 extern struct __collate_st_char_pri __collate_char_pri_table[UCHAR_MAX + 1];
73 extern struct __collate_st_chain_pri *__collate_chain_pri_table;
74 +extern __int32_t *__collate_chain_equiv_table;
75 +extern struct __collate_st_info __collate_info;
76 +#endif /* !__LIBC__ */
79 -u_char *__collate_strdup(u_char *);
80 -u_char *__collate_substitute(const u_char *);
81 -int __collate_load_tables(const char *);
82 -void __collate_lookup(const u_char *, int *, int *, int *);
83 -int __collate_range_cmp(int, int);
85 +__darwin_wchar_t *__collate_mbstowcs(const char *, locale_t);
86 +__darwin_wchar_t *__collate_wcsdup(const __darwin_wchar_t *);
87 +__darwin_wchar_t *__collate_substitute(const __darwin_wchar_t *, int, locale_t);
88 +int __collate_load_tables(const char *, locale_t);
89 +void __collate_lookup_l(const __darwin_wchar_t *, int *, int *, int *, locale_t);
90 +void __collate_lookup_which(const __darwin_wchar_t *, int *, int *, int, locale_t);
91 +void __collate_xfrm(const __darwin_wchar_t *, __darwin_wchar_t **, locale_t);
92 +int __collate_range_cmp(__darwin_wchar_t, __darwin_wchar_t, locale_t);
93 +size_t __collate_collating_symbol(__darwin_wchar_t *, size_t, const char *, size_t, __darwin_mbstate_t *, locale_t);
94 +int __collate_equiv_class(const char *, size_t, __darwin_mbstate_t *, locale_t);
95 +size_t __collate_equiv_match(int, __darwin_wchar_t *, size_t, __darwin_wchar_t, const char *, size_t, __darwin_mbstate_t *, size_t *, locale_t);
96 +#else /* !__LIBC__ */
97 +void __collate_lookup(const unsigned char *, int *, int *, int *);
98 +#endif /* __LIBC__ */
100 void __collate_print_tables(void);