xref: /xnu-10063.141.1/bsd/sys/unicode.h (revision d8b80295118ef25ac3a784134bcf95cd8e88109f)
1*d8b80295SApple OSS Distributions /*
2*d8b80295SApple OSS Distributions  * Copyright (c) 2016-2023 Apple Inc. All rights reserved.
3*d8b80295SApple OSS Distributions  *
4*d8b80295SApple OSS Distributions  * @APPLE_LICENSE_HEADER_START@
5*d8b80295SApple OSS Distributions  *
6*d8b80295SApple OSS Distributions  * This file contains Original Code and/or Modifications of Original Code
7*d8b80295SApple OSS Distributions  * as defined in and that are subject to the Apple Public Source License
8*d8b80295SApple OSS Distributions  * Version 2.0 (the 'License'). You may not use this file except in
9*d8b80295SApple OSS Distributions  * compliance with the License. Please obtain a copy of the License at
10*d8b80295SApple OSS Distributions  * http://www.opensource.apple.com/apsl/ and read it before using this
11*d8b80295SApple OSS Distributions  * file.
12*d8b80295SApple OSS Distributions  *
13*d8b80295SApple OSS Distributions  * The Original Code and all software distributed under the License are
14*d8b80295SApple OSS Distributions  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15*d8b80295SApple OSS Distributions  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16*d8b80295SApple OSS Distributions  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17*d8b80295SApple OSS Distributions  * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18*d8b80295SApple OSS Distributions  * Please see the License for the specific language governing rights and
19*d8b80295SApple OSS Distributions  * limitations under the License.
20*d8b80295SApple OSS Distributions  *
21*d8b80295SApple OSS Distributions  * @APPLE_LICENSE_HEADER_END@
22*d8b80295SApple OSS Distributions  */
23*d8b80295SApple OSS Distributions 
24*d8b80295SApple OSS Distributions #ifndef unicode_h
25*d8b80295SApple OSS Distributions #define unicode_h
26*d8b80295SApple OSS Distributions 
27*d8b80295SApple OSS Distributions #ifdef KERNEL_PRIVATE
28*d8b80295SApple OSS Distributions 
29*d8b80295SApple OSS Distributions #include <sys/cdefs.h>
30*d8b80295SApple OSS Distributions #include <stdbool.h>
31*d8b80295SApple OSS Distributions 
32*d8b80295SApple OSS Distributions /*
33*d8b80295SApple OSS Distributions  * WARNING - callers that use the following Unicode normalization interface for on-disk
34*d8b80295SApple OSS Distributions  * structures should be aware that the implementation will be periodically updated for
35*d8b80295SApple OSS Distributions  * the latest Unicode standard version.
36*d8b80295SApple OSS Distributions  */
37*d8b80295SApple OSS Distributions 
38*d8b80295SApple OSS Distributions enum {
39*d8b80295SApple OSS Distributions 	/* Maximum size of UTF32 reordering buffer for stream-safe format */
40*d8b80295SApple OSS Distributions 	kNCFStreamSafeBufMax = 32
41*d8b80295SApple OSS Distributions };
42*d8b80295SApple OSS Distributions 
43*d8b80295SApple OSS Distributions /*
44*d8b80295SApple OSS Distributions  * utf8_normalizeOptCaseFoldAndHash
45*d8b80295SApple OSS Distributions  *
46*d8b80295SApple OSS Distributions  * Convert a given UTF-8 string to UTF-32 in one of the following normalized forms,
47*d8b80295SApple OSS Distributions  * as specified by the case_sens parameter, and feed the result incrementally to
48*d8b80295SApple OSS Distributions  * the provided hash function callback:
49*d8b80295SApple OSS Distributions  * - "canonical caseless form" (case-folded NFD, as described by definition D145
50*d8b80295SApple OSS Distributions  *    in chapter 3 of The Unicode Standard); for case-insensitive behavior.
51*d8b80295SApple OSS Distributions  * - standard NFD; for case-sensitive behavior (if case_sens = true).
52*d8b80295SApple OSS Distributions  *
53*d8b80295SApple OSS Distributions  * The input string should be valid UTF-8 that meets the criteria for stream safe
54*d8b80295SApple OSS Distributions  * text as described in http://unicode.org/reports/tr15/#Stream_Safe_Text_Format.
55*d8b80295SApple OSS Distributions  * It should not contain ASCII 0x00 or '/'.
56*d8b80295SApple OSS Distributions  *
57*d8b80295SApple OSS Distributions  * str:       The input UTF-8 string (need not be 0 terminated)
58*d8b80295SApple OSS Distributions  * str_len:   The byte length of the input string (excluding any 0 terminator)
59*d8b80295SApple OSS Distributions  * case_sens: False for case-insensitive behavior; generates canonical caseless form.
60*d8b80295SApple OSS Distributions  *            True for case-sensitive behavior; generates standard NFD.
61*d8b80295SApple OSS Distributions  * hash_func: A pointer to a hashing function to compute the hash of the
62*d8b80295SApple OSS Distributions  *            normalized/case-folded result. buf contains buf_len bytes
63*d8b80295SApple OSS Distributions  *            of data to be added to the hash using the caller-supplied
64*d8b80295SApple OSS Distributions  *            context (ctx).
65*d8b80295SApple OSS Distributions  * hash_ctx:  The context for the hash function.
66*d8b80295SApple OSS Distributions  *
67*d8b80295SApple OSS Distributions  * Returns: 0 on success, or
68*d8b80295SApple OSS Distributions  *          EILSEQ: The input string contains illegal ASCII-range characters
69*d8b80295SApple OSS Distributions  *                  (0x00 or '/'), or is not well-formed stream-safe UTF-8, or
70*d8b80295SApple OSS Distributions  *                  contains codepoints that are non-characters or unassigned in
71*d8b80295SApple OSS Distributions  *                  the version of Unicode currently supported.
72*d8b80295SApple OSS Distributions  */
73*d8b80295SApple OSS Distributions int utf8_normalizeOptCaseFoldAndHash(const char *str,
74*d8b80295SApple OSS Distributions     size_t      str_len,
75*d8b80295SApple OSS Distributions     bool        case_sens,
76*d8b80295SApple OSS Distributions     void      (*hash_func)(void *buf, size_t buf_len, void *ctx),
77*d8b80295SApple OSS Distributions     void       *hash_ctx);
78*d8b80295SApple OSS Distributions 
79*d8b80295SApple OSS Distributions /*
80*d8b80295SApple OSS Distributions  * utf8_normalizeOptCaseFoldAndCompare
81*d8b80295SApple OSS Distributions  *
82*d8b80295SApple OSS Distributions  * Determine whether two UTF-8 strings are equal after converting each to one of the
83*d8b80295SApple OSS Distributions  * following normalized forms, as specified by the case_sens parameter:
84*d8b80295SApple OSS Distributions  * - "canonical caseless form" (case-folded NFD); for case-insensitive comparison.
85*d8b80295SApple OSS Distributions  * - standard NFD; for case-sensitive comparison (if case_sens = true).
86*d8b80295SApple OSS Distributions  * On success, sets are_equal to true if the strings are equal, or false if they are not.
87*d8b80295SApple OSS Distributions  *
88*d8b80295SApple OSS Distributions  * The input strings should be valid UTF-8 that meet the criteria for stream safe
89*d8b80295SApple OSS Distributions  * text as described in http://unicode.org/reports/tr15/#Stream_Safe_Text_Format.
90*d8b80295SApple OSS Distributions  * They should not contain ASCII 0x00 or '/'.
91*d8b80295SApple OSS Distributions  *
92*d8b80295SApple OSS Distributions  * strA:      A UTF-8 string to be compared (need not be 0 terminated)
93*d8b80295SApple OSS Distributions  * strA_len:  The byte length of strA (excluding any 0 terminator)
94*d8b80295SApple OSS Distributions  * strB:      The second UTF-8 string to be compared (need not be 0 terminated)
95*d8b80295SApple OSS Distributions  * strB_len:  The byte length of strB (excluding any 0 terminator)
96*d8b80295SApple OSS Distributions  * case_sens: False for case-insensitive behavior; compares canonical caseless forms.
97*d8b80295SApple OSS Distributions  *            True for case-sensitive behavior; compares standard NFD forms.
98*d8b80295SApple OSS Distributions  * are_equal: On success, set to true if the strings are equal, or set to false
99*d8b80295SApple OSS Distributions  *            if they are not.
100*d8b80295SApple OSS Distributions  *
101*d8b80295SApple OSS Distributions  * Returns: 0 on success, or
102*d8b80295SApple OSS Distributions  *          EILSEQ: One or both of the input strings contains illegal ASCII-range
103*d8b80295SApple OSS Distributions  *                  characters (0x00 or '/'), or is not well-formed stream-safe UTF-8,
104*d8b80295SApple OSS Distributions  *                  or contains codepoints that are non-characters or unassigned in
105*d8b80295SApple OSS Distributions  *                  the version of Unicode currently supported.
106*d8b80295SApple OSS Distributions  *                  Note: The comparison may terminate early when a difference is
107*d8b80295SApple OSS Distributions  *                        detected, and may return 0 and set *are_equal=false even
108*d8b80295SApple OSS Distributions  *                        if one or both strings are invalid.
109*d8b80295SApple OSS Distributions  */
110*d8b80295SApple OSS Distributions int utf8_normalizeOptCaseFoldAndCompare(const char *strA,
111*d8b80295SApple OSS Distributions     size_t      strA_len,
112*d8b80295SApple OSS Distributions     const char *strB,
113*d8b80295SApple OSS Distributions     size_t      strB_len,
114*d8b80295SApple OSS Distributions     bool        case_sens,
115*d8b80295SApple OSS Distributions     bool       *are_equal);
116*d8b80295SApple OSS Distributions 
117*d8b80295SApple OSS Distributions /*
118*d8b80295SApple OSS Distributions  * utf8_normalizeOptCaseFold
119*d8b80295SApple OSS Distributions  *
120*d8b80295SApple OSS Distributions  * Convert a given UTF-8 string to UTF-32 in one of the following normalized forms,
121*d8b80295SApple OSS Distributions  * as specified by the case_sens parameter, and copy the result to the ustr
122*d8b80295SApple OSS Distributions  * buffer:
123*d8b80295SApple OSS Distributions  * - "canonical caseless form" (case-folded NFD, as described by definition D145
124*d8b80295SApple OSS Distributions  *    in chapter 3 of The Unicode Standard); for case-insensitive behavior.
125*d8b80295SApple OSS Distributions  * - standard NFD; for case-sensitive behavior (if case_sens = true).
126*d8b80295SApple OSS Distributions  *
127*d8b80295SApple OSS Distributions  * The input string should be valid UTF-8 that meets the criteria for stream safe
128*d8b80295SApple OSS Distributions  * text as described in http://unicode.org/reports/tr15/#Stream_Safe_Text_Format.
129*d8b80295SApple OSS Distributions  * It should not contain ASCII 0x00 or '/'.
130*d8b80295SApple OSS Distributions  *
131*d8b80295SApple OSS Distributions  * str:       The input UTF-8 string (need not be 0 terminated)
132*d8b80295SApple OSS Distributions  * str_len:   The byte length of the input string (excluding any 0 terminator)
133*d8b80295SApple OSS Distributions  * case_sens: False for case-insensitive behavior; generates canonical caseless form.
134*d8b80295SApple OSS Distributions  *            True for case-sensitive behavior; generates standard NFD.
135*d8b80295SApple OSS Distributions  * ustr:      A pointer to a buffer for the resulting UTF-32 string.
136*d8b80295SApple OSS Distributions  * ustr_size: The capacity of ustr, in UTF-32 units.
137*d8b80295SApple OSS Distributions  * ustr_len:  Pointer to a value that will be filled in with the actual length
138*d8b80295SApple OSS Distributions  *            in UTF-32 units of the string copied to ustr.
139*d8b80295SApple OSS Distributions  *
140*d8b80295SApple OSS Distributions  * Returns: 0 on success, or
141*d8b80295SApple OSS Distributions  *          EILSEQ: The input string contains illegal ASCII-range characters
142*d8b80295SApple OSS Distributions  *                  (0x00 or '/'), or is not well-formed stream-safe UTF-8, or
143*d8b80295SApple OSS Distributions  *                  contains codepoints that are non-characters or unassigned in
144*d8b80295SApple OSS Distributions  *                  the version of Unicode currently supported.
145*d8b80295SApple OSS Distributions  *          ENOMEM: ustr_size is insufficient for the resulting string. In this
146*d8b80295SApple OSS Distributions  *                  case the value returned in *ustr_len is invalid.
147*d8b80295SApple OSS Distributions  */
148*d8b80295SApple OSS Distributions int utf8_normalizeOptCaseFold(const char *str,
149*d8b80295SApple OSS Distributions     size_t      str_len,
150*d8b80295SApple OSS Distributions     bool        case_sens,
151*d8b80295SApple OSS Distributions     int32_t    *ustr,
152*d8b80295SApple OSS Distributions     int32_t     ustr_size,
153*d8b80295SApple OSS Distributions     int32_t    *ustr_len);
154*d8b80295SApple OSS Distributions 
155*d8b80295SApple OSS Distributions /*
156*d8b80295SApple OSS Distributions  * utf8_normalizeOptCaseFoldToUTF8
157*d8b80295SApple OSS Distributions  *
158*d8b80295SApple OSS Distributions  * Convert a given UTF-8 string to UTF-8 in one of the following normalized forms,
159*d8b80295SApple OSS Distributions  * as specified by the case_sens parameter, and copy the result to the ustr
160*d8b80295SApple OSS Distributions  * buffer:
161*d8b80295SApple OSS Distributions  * - "canonical caseless form" (case-folded NFD, as described by definition D145
162*d8b80295SApple OSS Distributions  *    in chapter 3 of The Unicode Standard); for case-insensitive behavior.
163*d8b80295SApple OSS Distributions  * - standard NFD; for case-sensitive behavior (if case_sens = true).
164*d8b80295SApple OSS Distributions  *
165*d8b80295SApple OSS Distributions  * The input string should be valid UTF-8 that meets the criteria for stream safe
166*d8b80295SApple OSS Distributions  * text as described in http://unicode.org/reports/tr15/#Stream_Safe_Text_Format.
167*d8b80295SApple OSS Distributions  * It should not contain ASCII 0x00 or '/'.
168*d8b80295SApple OSS Distributions  *
169*d8b80295SApple OSS Distributions  * str:       The input UTF-8 string (need not be 0 terminated)
170*d8b80295SApple OSS Distributions  * str_len:   The byte length of the input string (excluding any 0 terminator)
171*d8b80295SApple OSS Distributions  * case_sens: False for case-insensitive behavior; generates canonical caseless form.
172*d8b80295SApple OSS Distributions  *            True for case-sensitive behavior; generates standard NFD.
173*d8b80295SApple OSS Distributions  * ustr:      A pointer to a buffer for the resulting UTF-8 string.
174*d8b80295SApple OSS Distributions  * ustr_size: The capacity of ustr, in bytes.
175*d8b80295SApple OSS Distributions  * ustr_len:  Pointer to a value that will be filled in with the actual length
176*d8b80295SApple OSS Distributions  *            in bytes of the string copied to ustr.
177*d8b80295SApple OSS Distributions  *
178*d8b80295SApple OSS Distributions  * Returns: 0 on success, or
179*d8b80295SApple OSS Distributions  *          EILSEQ: The input string contains illegal ASCII-range characters
180*d8b80295SApple OSS Distributions  *                  (0x00 or '/'), or is not well-formed stream-safe UTF-8, or
181*d8b80295SApple OSS Distributions  *                  contains codepoints that are non-characters or unassigned in
182*d8b80295SApple OSS Distributions  *                  the version of Unicode currently supported.
183*d8b80295SApple OSS Distributions  *          ENOMEM: ustr_size is insufficient for the resulting string. In this
184*d8b80295SApple OSS Distributions  *                  case the value returned in *ustr_len is invalid.
185*d8b80295SApple OSS Distributions  */
186*d8b80295SApple OSS Distributions int utf8_normalizeOptCaseFoldToUTF8(const char *str,
187*d8b80295SApple OSS Distributions     size_t      str_len,
188*d8b80295SApple OSS Distributions     bool        case_sens,
189*d8b80295SApple OSS Distributions     char       *ustr,
190*d8b80295SApple OSS Distributions     size_t      ustr_size,
191*d8b80295SApple OSS Distributions     size_t     *ustr_len);
192*d8b80295SApple OSS Distributions 
193*d8b80295SApple OSS Distributions /*
194*d8b80295SApple OSS Distributions  * utf8_normalizeOptCaseFoldToUTF8ForPath
195*d8b80295SApple OSS Distributions  *
196*d8b80295SApple OSS Distributions  * Convert a given UTF-8 path string to UTF-8 in one of the following normalized forms,
197*d8b80295SApple OSS Distributions  * as specified by the case_sens parameter, and copy the result to the ustr
198*d8b80295SApple OSS Distributions  * buffer:
199*d8b80295SApple OSS Distributions  * - "canonical caseless form" (case-folded NFD, as described by definition D145
200*d8b80295SApple OSS Distributions  *    in chapter 3 of The Unicode Standard); for case-insensitive behavior.
201*d8b80295SApple OSS Distributions  * - standard NFD; for case-sensitive behavior (if case_sens = true).
202*d8b80295SApple OSS Distributions  *
203*d8b80295SApple OSS Distributions  * The input string should be valid UTF-8 that meets the criteria for stream safe
204*d8b80295SApple OSS Distributions  * text as described in http://unicode.org/reports/tr15/#Stream_Safe_Text_Format.
205*d8b80295SApple OSS Distributions  *
206*d8b80295SApple OSS Distributions  * str:       The input UTF-8 path string
207*d8b80295SApple OSS Distributions  * str_len:   The byte length of the input path string (excluding any 0 terminator)
208*d8b80295SApple OSS Distributions  * case_sens: False for case-insensitive behavior; generates canonical caseless form.
209*d8b80295SApple OSS Distributions  *            True for case-sensitive behavior; generates standard NFD.
210*d8b80295SApple OSS Distributions  * ustr:      A pointer to a buffer for the resulting UTF-8 string.
211*d8b80295SApple OSS Distributions  * ustr_size: The capacity of ustr, in bytes.
212*d8b80295SApple OSS Distributions  * ustr_len:  Pointer to a value that will be filled in with the actual length
213*d8b80295SApple OSS Distributions  *            in bytes of the string copied to ustr.
214*d8b80295SApple OSS Distributions  *
215*d8b80295SApple OSS Distributions  * Returns: 0 on success, or
216*d8b80295SApple OSS Distributions  *          EILSEQ: The input string contains illegal ASCII-range characters
217*d8b80295SApple OSS Distributions  *                  (0x00), or is not well-formed stream-safe UTF-8, or
218*d8b80295SApple OSS Distributions  *                  contains codepoints that are non-characters or unassigned in
219*d8b80295SApple OSS Distributions  *                  the version of Unicode currently supported.
220*d8b80295SApple OSS Distributions  *          ENOMEM: ustr_size is insufficient for the resulting string. In this
221*d8b80295SApple OSS Distributions  *                  case the value returned in *ustr_len is invalid.
222*d8b80295SApple OSS Distributions  */
223*d8b80295SApple OSS Distributions int utf8_normalizeOptCaseFoldToUTF8ForPath(const char *str,
224*d8b80295SApple OSS Distributions     size_t      str_len,
225*d8b80295SApple OSS Distributions     bool        case_sens,
226*d8b80295SApple OSS Distributions     char       *ustr,
227*d8b80295SApple OSS Distributions     size_t      ustr_size,
228*d8b80295SApple OSS Distributions     size_t     *ustr_len);
229*d8b80295SApple OSS Distributions 
230*d8b80295SApple OSS Distributions /*
231*d8b80295SApple OSS Distributions  * utf8_normalizeOptCaseFoldAndMatchSubstring
232*d8b80295SApple OSS Distributions  *
233*d8b80295SApple OSS Distributions  * Determine whether the normalized UTF32 string derived from a specified UTF-8 string
234*d8b80295SApple OSS Distributions  * strA contains another UTF32 string ustrB which has already been normalized, typically
235*d8b80295SApple OSS Distributions  * with normalizeOptCaseFold. The normalization for both strings is one of the following,
236*d8b80295SApple OSS Distributions  * as specified by the case_sens parameter:
237*d8b80295SApple OSS Distributions  * - "canonical caseless form" (case-folded NFD); for case-insensitive comparison.
238*d8b80295SApple OSS Distributions  * - standard NFD; for case-sensitive comparison (if case_sens = true).
239*d8b80295SApple OSS Distributions  * On success, sets are_equal to true if strA contains ustrB, or false otherwise.
240*d8b80295SApple OSS Distributions  *
241*d8b80295SApple OSS Distributions  * The input string strA should be valid UTF-8 that meets the criteria for stream safe
242*d8b80295SApple OSS Distributions  * text as described in http://unicode.org/reports/tr15/#Stream_Safe_Text_Format.
243*d8b80295SApple OSS Distributions  * It should not contain ASCII 0x00 or '/'.
244*d8b80295SApple OSS Distributions  *
245*d8b80295SApple OSS Distributions  * strA:      A UTF-8 string (need not be 0 terminated) in which to search for the
246*d8b80295SApple OSS Distributions  *            substring specified by ustrB.
247*d8b80295SApple OSS Distributions  * strA_len:  The byte length of strA (excluding any 0 terminator)
248*d8b80295SApple OSS Distributions  * ustrB:     A normalized UTF-32 substring (need not be 0 terminated) to be searched
249*d8b80295SApple OSS Distributions  *            for in the UTF-32 string resulting from converting strA to the normalized
250*d8b80295SApple OSS Distributions  *            UTF-32 form specified by the case_sens parameter; ustrB must already be
251*d8b80295SApple OSS Distributions  *            in that form. Normally this will be produced using normalizeOptCaseFold.
252*d8b80295SApple OSS Distributions  * ustrB_len: The length of ustrB in UTF-32 units (excluding any 0 terminator).
253*d8b80295SApple OSS Distributions  * case_sens: False for case-insensitive matching; compares canonical caseless forms.
254*d8b80295SApple OSS Distributions  *            True for case-sensitive matching; compares standard NFD forms.
255*d8b80295SApple OSS Distributions  * buf:       Pointer to caller-supplied working memory for storing the portion of
256*d8b80295SApple OSS Distributions  *            strA which has been converted to normalized UTF-32.
257*d8b80295SApple OSS Distributions  * buf_size:  The size of buf.
258*d8b80295SApple OSS Distributions  * has_match: On success, set to true if strA (when converter to UTF-32 and normalized
259*d8b80295SApple OSS Distributions  *            per case_sens) contains ustrB, set to false otherwise.
260*d8b80295SApple OSS Distributions  *
261*d8b80295SApple OSS Distributions  * Returns: 0 on success, or
262*d8b80295SApple OSS Distributions  *          EILSEQ: strA contains illegal ASCII-range characters (0x00 or '/'), or is
263*d8b80295SApple OSS Distributions  *                  not well-formed stream-safe UTF-8, or contains codepoints that are
264*d8b80295SApple OSS Distributions  *                  non-characters or unassigned in the version of Unicode currently
265*d8b80295SApple OSS Distributions  *                  supported.
266*d8b80295SApple OSS Distributions  *                  Note: The search may terminate early when a match is detected, and
267*d8b80295SApple OSS Distributions  *                        may return 0 and set *has_match=true even if strA is invalid.
268*d8b80295SApple OSS Distributions  *          ENOMEM: buf_size is insufficient.
269*d8b80295SApple OSS Distributions  */
270*d8b80295SApple OSS Distributions int utf8_normalizeOptCaseFoldAndMatchSubstring(const char    *strA,
271*d8b80295SApple OSS Distributions     size_t         strA_len,
272*d8b80295SApple OSS Distributions     const int32_t *ustrB,
273*d8b80295SApple OSS Distributions     int32_t        ustrB_len,
274*d8b80295SApple OSS Distributions     bool           case_sens,
275*d8b80295SApple OSS Distributions     void          *buf,
276*d8b80295SApple OSS Distributions     size_t         buf_size,
277*d8b80295SApple OSS Distributions     bool          *has_match);
278*d8b80295SApple OSS Distributions 
279*d8b80295SApple OSS Distributions /*
280*d8b80295SApple OSS Distributions  * utf8_normalizeOptCaseFoldGetUVersion
281*d8b80295SApple OSS Distributions  *
282*d8b80295SApple OSS Distributions  * Get the Unicode and code version currently associated with the normalizeOptCaseFold
283*d8b80295SApple OSS Distributions  * functions. The caller allocates the version array and passes it to the function,
284*d8b80295SApple OSS Distributions  * which will fill out the array as follows:
285*d8b80295SApple OSS Distributions  * version[0] = Unicode major version; for Unicode 6.3.0 this would be 6
286*d8b80295SApple OSS Distributions  * version[1] = Unicode minor version; for Unicode 6.3.0 this would be 3
287*d8b80295SApple OSS Distributions  * version[2] = Unicode patch version; for Unicode 6.3.0 this would be 0
288*d8b80295SApple OSS Distributions  * version[3] = Code revision level; for any given Unicode version, this value starts
289*d8b80295SApple OSS Distributions  *              at 0 and is incremented for each significant revision to the
290*d8b80295SApple OSS Distributions  *              normalizeOptCaseFold functions.
291*d8b80295SApple OSS Distributions  */
292*d8b80295SApple OSS Distributions void utf8_normalizeOptCaseFoldGetUVersion(unsigned char version[4]);
293*d8b80295SApple OSS Distributions 
294*d8b80295SApple OSS Distributions #endif /* KERNEL_PRIVATE */
295*d8b80295SApple OSS Distributions 
296*d8b80295SApple OSS Distributions #endif  /* unicode_h */
297