This source file includes following definitions.
- ulc_u8_casefold
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
26 #include <config.h>
27
28
29 #include "unicase.h"
30
31 #include <errno.h>
32 #include <stdlib.h>
33
34 #include "minmax.h"
35 #include "uninorm.h"
36 #include "uniconv.h"
37 #include "unistr.h"
38
39 static uint8_t *
40 ulc_u8_casefold (const char *s, size_t n, const char *iso639_language,
41 uninorm_t nf,
42 uint8_t *resultbuf, size_t *lengthp)
43 {
44 uint8_t convbuf[2048 / sizeof (uint8_t)];
45 uint8_t *conv;
46 size_t conv_length;
47 uint8_t *result;
48
49
50 conv_length = sizeof (convbuf) / sizeof (uint8_t);
51 conv =
52 u8_conv_from_encoding (locale_charset (), iconveh_error, s, n, NULL,
53 convbuf, &conv_length);
54 if (conv == NULL)
55
56 return NULL;
57
58
59 result = u8_casefold (conv, conv_length, iso639_language, nf,
60 resultbuf, lengthp);
61 if (result == NULL)
62 {
63 if (conv != convbuf)
64 {
65 int saved_errno = errno;
66 free (conv);
67 errno = saved_errno;
68 }
69 return NULL;
70 }
71
72 if (conv != convbuf)
73 free (conv);
74 return result;
75 }
76
77 #define FUNC ulc_casecmp
78 #define UNIT uint8_t
79 #define SRC_UNIT char
80 #define U_CASEFOLD ulc_u8_casefold
81 #define U_CMP2 u8_cmp2
82 #include "u-casecmp.h"