1 --- collate.h.bsdnew 2009-11-09 15:05:25.000000000 -0800
2 +++ collate.h 2009-11-09 15:21:14.000000000 -0800
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 #define COLLATE_VERSION1_2 "1.2\n"
19 +/* see discussion in string/FreeBSD/strxfrm for this value */
20 +#define COLLATE_MAX_PRIORITY ((1 << 24) - 1)
22 +#define DIRECTIVE_UNDEF 0x00
23 +#define DIRECTIVE_FORWARD 0x01
24 +#define DIRECTIVE_BACKWARD 0x02
25 +#define DIRECTIVE_POSITION 0x04
27 +#define DIRECTIVE_DIRECTION_MASK (DIRECTIVE_FORWARD | DIRECTIVE_BACKWARD)
29 +#define COLLATE_SUBST_DUP 0x0001
31 +#define IGNORE_EQUIV_CLASS 1
33 +struct __collate_st_info {
34 + __uint8_t directive[COLL_WEIGHTS_MAX];
36 +#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN
37 + __uint8_t directive_count:4;
38 + __uint8_t chain_max_len:4;
40 + __uint8_t chain_max_len:4;
41 + __uint8_t directive_count:4;
43 + __int32_t undef_pri[COLL_WEIGHTS_MAX];
44 + __int32_t subst_count[COLL_WEIGHTS_MAX];
45 + __int32_t chain_count;
46 + __int32_t large_pri_count;
49 struct __collate_st_char_pri {
51 + __int32_t pri[COLL_WEIGHTS_MAX];
53 struct __collate_st_chain_pri {
54 - u_char str[STR_LEN];
56 + __darwin_wchar_t str[STR_LEN];
57 + __int32_t pri[COLL_WEIGHTS_MAX];
59 +struct __collate_st_large_char_pri {
61 + struct __collate_st_char_pri pri;
63 +struct __collate_st_subst {
65 + __darwin_wchar_t str[STR_LEN];
69 extern int __collate_load_error;
70 extern int __collate_substitute_nontrivial;
71 -#define __collate_substitute_table (*__collate_substitute_table_ptr)
72 -extern u_char __collate_substitute_table[UCHAR_MAX + 1][STR_LEN];
73 #define __collate_char_pri_table (*__collate_char_pri_table_ptr)
74 extern struct __collate_st_char_pri __collate_char_pri_table[UCHAR_MAX + 1];
75 extern struct __collate_st_chain_pri *__collate_chain_pri_table;
76 +extern __int32_t *__collate_chain_equiv_table;
77 +extern struct __collate_st_info __collate_info;
78 +#endif /* !__LIBC__ */
81 -u_char *__collate_strdup(u_char *);
82 -u_char *__collate_substitute(const u_char *);
83 -int __collate_load_tables(const char *);
84 -void __collate_lookup(const u_char *, int *, int *, int *);
85 -int __collate_range_cmp(int, int);
87 +__darwin_wchar_t *__collate_mbstowcs(const char *, locale_t);
88 +__darwin_wchar_t *__collate_wcsdup(const __darwin_wchar_t *);
89 +__darwin_wchar_t *__collate_substitute(const __darwin_wchar_t *, int, locale_t);
90 +int __collate_load_tables(const char *, locale_t);
91 +void __collate_lookup_l(const __darwin_wchar_t *, int *, int *, int *, locale_t);
92 +void __collate_lookup_which(const __darwin_wchar_t *, int *, int *, int, locale_t);
93 +void __collate_xfrm(const __darwin_wchar_t *, __darwin_wchar_t **, locale_t);
94 +int __collate_range_cmp(__darwin_wchar_t, __darwin_wchar_t, locale_t);
95 +size_t __collate_collating_symbol(__darwin_wchar_t *, size_t, const char *, size_t, __darwin_mbstate_t *, locale_t);
96 +int __collate_equiv_class(const char *, size_t, __darwin_mbstate_t *, locale_t);
97 +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);
98 +#else /* !__LIBC__ */
99 +void __collate_lookup(const unsigned char *, int *, int *, int *);
100 +#endif /* __LIBC__ */
102 void __collate_print_tables(void);