This source file includes following definitions.
- uc_toupper
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 #ifndef _UNICASE_H
26 #define _UNICASE_H
27
28 #include "unitypes.h"
29
30
31 #include <stdbool.h>
32
33
34 #include <stddef.h>
35
36
37 #include "uninorm.h"
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43
44
45
46
47
48
49
50
51
52 extern ucs4_t
53 uc_toupper (ucs4_t uc)
54 _UC_ATTRIBUTE_CONST;
55
56
57 extern ucs4_t
58 uc_tolower (ucs4_t uc)
59 _UC_ATTRIBUTE_CONST;
60
61
62 extern ucs4_t
63 uc_totitle (ucs4_t uc)
64 _UC_ATTRIBUTE_CONST;
65
66
67
68
69
70
71
72
73
74
75
76 extern const char *
77 uc_locale_language (void)
78 _UC_ATTRIBUTE_PURE;
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104 extern uint8_t *
105 u8_toupper (const uint8_t *s, size_t n, const char *iso639_language,
106 uninorm_t nf,
107 uint8_t *_UC_RESTRICT resultbuf, size_t *lengthp);
108 extern uint16_t *
109 u16_toupper (const uint16_t *s, size_t n, const char *iso639_language,
110 uninorm_t nf,
111 uint16_t *_UC_RESTRICT resultbuf, size_t *lengthp);
112 extern uint32_t *
113 u32_toupper (const uint32_t *s, size_t n, const char *iso639_language,
114 uninorm_t nf,
115 uint32_t *_UC_RESTRICT resultbuf, size_t *lengthp);
116
117
118
119
120 extern uint8_t *
121 u8_tolower (const uint8_t *s, size_t n, const char *iso639_language,
122 uninorm_t nf,
123 uint8_t *_UC_RESTRICT resultbuf, size_t *lengthp);
124 extern uint16_t *
125 u16_tolower (const uint16_t *s, size_t n, const char *iso639_language,
126 uninorm_t nf,
127 uint16_t *_UC_RESTRICT resultbuf, size_t *lengthp);
128 extern uint32_t *
129 u32_tolower (const uint32_t *s, size_t n, const char *iso639_language,
130 uninorm_t nf,
131 uint32_t *_UC_RESTRICT resultbuf, size_t *lengthp);
132
133
134
135
136 extern uint8_t *
137 u8_totitle (const uint8_t *s, size_t n, const char *iso639_language,
138 uninorm_t nf,
139 uint8_t *_UC_RESTRICT resultbuf, size_t *lengthp);
140 extern uint16_t *
141 u16_totitle (const uint16_t *s, size_t n, const char *iso639_language,
142 uninorm_t nf,
143 uint16_t *_UC_RESTRICT resultbuf, size_t *lengthp);
144 extern uint32_t *
145 u32_totitle (const uint32_t *s, size_t n, const char *iso639_language,
146 uninorm_t nf,
147 uint32_t *_UC_RESTRICT resultbuf, size_t *lengthp);
148
149
150 typedef struct casing_prefix_context
151 {
152
153 uint32_t last_char_except_ignorable;
154 uint32_t last_char_normal_or_above;
155 }
156 casing_prefix_context_t;
157
158 extern const casing_prefix_context_t unicase_empty_prefix_context;
159
160 extern casing_prefix_context_t
161 u8_casing_prefix_context (const uint8_t *s, size_t n);
162 extern casing_prefix_context_t
163 u16_casing_prefix_context (const uint16_t *s, size_t n);
164 extern casing_prefix_context_t
165 u32_casing_prefix_context (const uint32_t *s, size_t n);
166
167
168 extern casing_prefix_context_t
169 u8_casing_prefixes_context (const uint8_t *s, size_t n,
170 casing_prefix_context_t a_context);
171 extern casing_prefix_context_t
172 u16_casing_prefixes_context (const uint16_t *s, size_t n,
173 casing_prefix_context_t a_context);
174 extern casing_prefix_context_t
175 u32_casing_prefixes_context (const uint32_t *s, size_t n,
176 casing_prefix_context_t a_context);
177
178
179 typedef struct casing_suffix_context
180 {
181
182 uint32_t first_char_except_ignorable;
183 uint32_t bits;
184 }
185 casing_suffix_context_t;
186
187 extern const casing_suffix_context_t unicase_empty_suffix_context;
188
189 extern casing_suffix_context_t
190 u8_casing_suffix_context (const uint8_t *s, size_t n);
191 extern casing_suffix_context_t
192 u16_casing_suffix_context (const uint16_t *s, size_t n);
193 extern casing_suffix_context_t
194 u32_casing_suffix_context (const uint32_t *s, size_t n);
195
196
197 extern casing_suffix_context_t
198 u8_casing_suffixes_context (const uint8_t *s, size_t n,
199 casing_suffix_context_t a_context);
200 extern casing_suffix_context_t
201 u16_casing_suffixes_context (const uint16_t *s, size_t n,
202 casing_suffix_context_t a_context);
203 extern casing_suffix_context_t
204 u32_casing_suffixes_context (const uint32_t *s, size_t n,
205 casing_suffix_context_t a_context);
206
207
208
209 extern uint8_t *
210 u8_ct_toupper (const uint8_t *s, size_t n,
211 casing_prefix_context_t prefix_context,
212 casing_suffix_context_t suffix_context,
213 const char *iso639_language,
214 uninorm_t nf,
215 uint8_t *_UC_RESTRICT resultbuf, size_t *lengthp);
216 extern uint16_t *
217 u16_ct_toupper (const uint16_t *s, size_t n,
218 casing_prefix_context_t prefix_context,
219 casing_suffix_context_t suffix_context,
220 const char *iso639_language,
221 uninorm_t nf,
222 uint16_t *_UC_RESTRICT resultbuf, size_t *lengthp);
223 extern uint32_t *
224 u32_ct_toupper (const uint32_t *s, size_t n,
225 casing_prefix_context_t prefix_context,
226 casing_suffix_context_t suffix_context,
227 const char *iso639_language,
228 uninorm_t nf,
229 uint32_t *_UC_RESTRICT resultbuf, size_t *lengthp);
230
231
232
233 extern uint8_t *
234 u8_ct_tolower (const uint8_t *s, size_t n,
235 casing_prefix_context_t prefix_context,
236 casing_suffix_context_t suffix_context,
237 const char *iso639_language,
238 uninorm_t nf,
239 uint8_t *_UC_RESTRICT resultbuf, size_t *lengthp);
240 extern uint16_t *
241 u16_ct_tolower (const uint16_t *s, size_t n,
242 casing_prefix_context_t prefix_context,
243 casing_suffix_context_t suffix_context,
244 const char *iso639_language,
245 uninorm_t nf,
246 uint16_t *_UC_RESTRICT resultbuf, size_t *lengthp);
247 extern uint32_t *
248 u32_ct_tolower (const uint32_t *s, size_t n,
249 casing_prefix_context_t prefix_context,
250 casing_suffix_context_t suffix_context,
251 const char *iso639_language,
252 uninorm_t nf,
253 uint32_t *_UC_RESTRICT resultbuf, size_t *lengthp);
254
255
256
257 extern uint8_t *
258 u8_ct_totitle (const uint8_t *s, size_t n,
259 casing_prefix_context_t prefix_context,
260 casing_suffix_context_t suffix_context,
261 const char *iso639_language,
262 uninorm_t nf,
263 uint8_t *_UC_RESTRICT resultbuf, size_t *lengthp);
264 extern uint16_t *
265 u16_ct_totitle (const uint16_t *s, size_t n,
266 casing_prefix_context_t prefix_context,
267 casing_suffix_context_t suffix_context,
268 const char *iso639_language,
269 uninorm_t nf,
270 uint16_t *_UC_RESTRICT resultbuf, size_t *lengthp);
271 extern uint32_t *
272 u32_ct_totitle (const uint32_t *s, size_t n,
273 casing_prefix_context_t prefix_context,
274 casing_suffix_context_t suffix_context,
275 const char *iso639_language,
276 uninorm_t nf,
277 uint32_t *_UC_RESTRICT resultbuf, size_t *lengthp);
278
279
280
281
282
283
284 extern uint8_t *
285 u8_casefold (const uint8_t *s, size_t n, const char *iso639_language,
286 uninorm_t nf,
287 uint8_t *_UC_RESTRICT resultbuf, size_t *lengthp);
288 extern uint16_t *
289 u16_casefold (const uint16_t *s, size_t n, const char *iso639_language,
290 uninorm_t nf,
291 uint16_t *_UC_RESTRICT resultbuf, size_t *lengthp);
292 extern uint32_t *
293 u32_casefold (const uint32_t *s, size_t n, const char *iso639_language,
294 uninorm_t nf,
295 uint32_t *_UC_RESTRICT resultbuf, size_t *lengthp);
296
297 extern uint8_t *
298 u8_ct_casefold (const uint8_t *s, size_t n,
299 casing_prefix_context_t prefix_context,
300 casing_suffix_context_t suffix_context,
301 const char *iso639_language,
302 uninorm_t nf,
303 uint8_t *_UC_RESTRICT resultbuf, size_t *lengthp);
304 extern uint16_t *
305 u16_ct_casefold (const uint16_t *s, size_t n,
306 casing_prefix_context_t prefix_context,
307 casing_suffix_context_t suffix_context,
308 const char *iso639_language,
309 uninorm_t nf,
310 uint16_t *_UC_RESTRICT resultbuf, size_t *lengthp);
311 extern uint32_t *
312 u32_ct_casefold (const uint32_t *s, size_t n,
313 casing_prefix_context_t prefix_context,
314 casing_suffix_context_t suffix_context,
315 const char *iso639_language,
316 uninorm_t nf,
317 uint32_t *_UC_RESTRICT resultbuf, size_t *lengthp);
318
319
320
321
322
323
324 extern int
325 u8_casecmp (const uint8_t *s1, size_t n1,
326 const uint8_t *s2, size_t n2,
327 const char *iso639_language, uninorm_t nf, int *resultp);
328 extern int
329 u16_casecmp (const uint16_t *s1, size_t n1,
330 const uint16_t *s2, size_t n2,
331 const char *iso639_language, uninorm_t nf, int *resultp);
332 extern int
333 u32_casecmp (const uint32_t *s1, size_t n1,
334 const uint32_t *s2, size_t n2,
335 const char *iso639_language, uninorm_t nf, int *resultp);
336 extern int
337 ulc_casecmp (const char *s1, size_t n1,
338 const char *s2, size_t n2,
339 const char *iso639_language, uninorm_t nf, int *resultp);
340
341
342
343
344
345 extern char *
346 u8_casexfrm (const uint8_t *s, size_t n, const char *iso639_language,
347 uninorm_t nf,
348 char *_UC_RESTRICT resultbuf, size_t *lengthp);
349 extern char *
350 u16_casexfrm (const uint16_t *s, size_t n, const char *iso639_language,
351 uninorm_t nf,
352 char *_UC_RESTRICT resultbuf, size_t *lengthp);
353 extern char *
354 u32_casexfrm (const uint32_t *s, size_t n, const char *iso639_language,
355 uninorm_t nf,
356 char *_UC_RESTRICT resultbuf, size_t *lengthp);
357 extern char *
358 ulc_casexfrm (const char *s, size_t n, const char *iso639_language,
359 uninorm_t nf,
360 char *_UC_RESTRICT resultbuf, size_t *lengthp);
361
362
363
364
365
366
367
368
369 extern int
370 u8_casecoll (const uint8_t *s1, size_t n1,
371 const uint8_t *s2, size_t n2,
372 const char *iso639_language, uninorm_t nf, int *resultp);
373 extern int
374 u16_casecoll (const uint16_t *s1, size_t n1,
375 const uint16_t *s2, size_t n2,
376 const char *iso639_language, uninorm_t nf, int *resultp);
377 extern int
378 u32_casecoll (const uint32_t *s1, size_t n1,
379 const uint32_t *s2, size_t n2,
380 const char *iso639_language, uninorm_t nf, int *resultp);
381 extern int
382 ulc_casecoll (const char *s1, size_t n1,
383 const char *s2, size_t n2,
384 const char *iso639_language, uninorm_t nf, int *resultp);
385
386
387
388
389 extern int
390 u8_is_uppercase (const uint8_t *s, size_t n,
391 const char *iso639_language,
392 bool *resultp);
393 extern int
394 u16_is_uppercase (const uint16_t *s, size_t n,
395 const char *iso639_language,
396 bool *resultp);
397 extern int
398 u32_is_uppercase (const uint32_t *s, size_t n,
399 const char *iso639_language,
400 bool *resultp);
401
402
403
404 extern int
405 u8_is_lowercase (const uint8_t *s, size_t n,
406 const char *iso639_language,
407 bool *resultp);
408 extern int
409 u16_is_lowercase (const uint16_t *s, size_t n,
410 const char *iso639_language,
411 bool *resultp);
412 extern int
413 u32_is_lowercase (const uint32_t *s, size_t n,
414 const char *iso639_language,
415 bool *resultp);
416
417
418
419 extern int
420 u8_is_titlecase (const uint8_t *s, size_t n,
421 const char *iso639_language,
422 bool *resultp);
423 extern int
424 u16_is_titlecase (const uint16_t *s, size_t n,
425 const char *iso639_language,
426 bool *resultp);
427 extern int
428 u32_is_titlecase (const uint32_t *s, size_t n,
429 const char *iso639_language,
430 bool *resultp);
431
432
433
434 extern int
435 u8_is_casefolded (const uint8_t *s, size_t n,
436 const char *iso639_language,
437 bool *resultp);
438 extern int
439 u16_is_casefolded (const uint16_t *s, size_t n,
440 const char *iso639_language,
441 bool *resultp);
442 extern int
443 u32_is_casefolded (const uint32_t *s, size_t n,
444 const char *iso639_language,
445 bool *resultp);
446
447
448
449
450
451
452
453 extern int
454 u8_is_cased (const uint8_t *s, size_t n,
455 const char *iso639_language,
456 bool *resultp);
457 extern int
458 u16_is_cased (const uint16_t *s, size_t n,
459 const char *iso639_language,
460 bool *resultp);
461 extern int
462 u32_is_cased (const uint32_t *s, size_t n,
463 const char *iso639_language,
464 bool *resultp);
465
466
467
468
469 #ifdef __cplusplus
470 }
471 #endif
472
473 #endif