Debian Codegraph @

vendor/onigmo-source/enc/unicode.c

raw symbols SCIP
1 /**********************************************************************
2 unicode.c - Oniguruma (regular expression library)
3 **********************************************************************/
4 /*-
5 * Copyright (c) 2002-2013 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30 #include "regint.h"cxx . . $ `<file>/vendor/onigmo-source/regint.h`/
31
32 #define ONIGENC_IS_UNICODE_ISO_8859_1_CTYPEcxx . . $ `vendor/onigmo-source/enc/unicode.c:32:9`!(code,ctype) \
33 ((EncUNICODE_ISO_8859_1_CtypeTable[code] & CTYPE_TO_BITcxx . . $ `vendor/onigmo-source/regenc.h:112:9`!(ctype)) != 0)
34 #if 0
35 #define ONIGENC_IS_UNICODE_ISO_8859_1_BIT_CTYPE(code,cbit) \
36 ((EncUNICODE_ISO_8859_1_CtypeTable[code] & (cbit)) != 0)
37 #endif
38
39 static const unsigned short EncUNICODE_ISO_8859_1_CtypeTablecxx . . $ EncUNICODE_ISO_8859_1_CtypeTable.[256] = {
40 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,
41 0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008,
42 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,
43 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,
44 0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,
45 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,
46 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,
47 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,
48 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,
49 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,
50 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,
51 0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,
52 0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,
53 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,
54 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,
55 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,
56 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0288, 0x0008, 0x0008,
57 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,
58 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,
59 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,
60 0x0284, 0x01a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0,
61 0x00a0, 0x00a0, 0x30e2, 0x01a0, 0x00a0, 0x00a8, 0x00a0, 0x00a0,
62 0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x00a0, 0x30e2, 0x00a0, 0x01a0,
63 0x00a0, 0x10a0, 0x30e2, 0x01a0, 0x10a0, 0x10a0, 0x10a0, 0x01a0,
64 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
65 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
66 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0,
67 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2,
68 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,
69 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,
70 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0,
71 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2
72 };
73
74 typedef structcxx . . $ $anonymous_type_c9427807b9d3fb8_0# {
75 int ncxx . . $ $anonymous_type_c9427807b9d3fb8_0#n.;
76 OnigCodePointcxx . . $ OnigCodePoint# codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.[3];
77 } CodePointList3cxx . . $ CodePointList3#;
78
79 typedef structcxx . . $ $anonymous_type_c9427807b9d3fb8_1# {
80 OnigCodePointcxx . . $ OnigCodePoint# fromcxx . . $ $anonymous_type_c9427807b9d3fb8_1#from.;
81 CodePointList3cxx . . $ CodePointList3# tocxx . . $ $anonymous_type_c9427807b9d3fb8_1#to.;
82 } CaseFold_11_Typecxx . . $ CaseFold_11_Type#;
83
84 typedef structcxx . . $ $anonymous_type_c9427807b9d3fb8_2# {
85 OnigCodePointcxx . . $ OnigCodePoint# fromcxx . . $ $anonymous_type_c9427807b9d3fb8_2#from.;
86 CodePointList3cxx . . $ CodePointList3# tocxx . . $ $anonymous_type_c9427807b9d3fb8_2#to.;
87 } CaseUnfold_11_Typecxx . . $ CaseUnfold_11_Type#;
88
89 typedef structcxx . . $ $anonymous_type_c9427807b9d3fb8_3# {
90 int ncxx . . $ $anonymous_type_c9427807b9d3fb8_3#n.;
91 OnigCodePointcxx . . $ OnigCodePoint# codecxx . . $ $anonymous_type_c9427807b9d3fb8_3#code.[2];
92 } CodePointList2cxx . . $ CodePointList2#;
93
94 typedef structcxx . . $ $anonymous_type_c9427807b9d3fb8_4# {
95 OnigCodePointcxx . . $ OnigCodePoint# fromcxx . . $ $anonymous_type_c9427807b9d3fb8_4#from.[2];
96 CodePointList2cxx . . $ CodePointList2# tocxx . . $ $anonymous_type_c9427807b9d3fb8_4#to.;
97 } CaseUnfold_12_Typecxx . . $ CaseUnfold_12_Type#;
98
99 typedef structcxx . . $ $anonymous_type_c9427807b9d3fb8_5# {
100 OnigCodePointcxx . . $ OnigCodePoint# fromcxx . . $ $anonymous_type_c9427807b9d3fb8_5#from.[3];
101 CodePointList2cxx . . $ CodePointList2# tocxx . . $ $anonymous_type_c9427807b9d3fb8_5#to.;
102 } CaseUnfold_13_Typecxx . . $ CaseUnfold_13_Type#;
103
104 static inline int
105 bits_ofcxx . . $ bits_of(1cb9ad283036edc7).(const OnigCodePointcxx . . $ OnigCodePoint# c, const int n)
106 {
107 return (c >> (2 - n) * 7) & 127;
108 }
109
110 static inline int
111 bits_atcxx . . $ bits_at(c4cc2f91a8d338ed).(const OnigCodePointcxx . . $ OnigCodePoint# *c, const int n)
112 {
113 return bits_ofcxx . . $ bits_of(1cb9ad283036edc7).(c[n / 3], n % 3);
114 }
115
116 static int
117 code1_equalcxx . . $ code1_equal(21cb2064190e2a90).(const OnigCodePointcxx . . $ OnigCodePoint# x, const OnigCodePointcxx . . $ OnigCodePoint# y)
118 {
119 if (x != y) return 0;
120 return 1;
121 }
122
123 static int
124 code2_equalcxx . . $ code2_equal(4301982f75a4a5fa).(const OnigCodePointcxx . . $ OnigCodePoint# *x, const OnigCodePointcxx . . $ OnigCodePoint# *y)
125 {
126 if (x[0] != y[0]) return 0;
127 if (x[1] != y[1]) return 0;
128 return 1;
129 }
130
131 static int
132 code3_equalcxx . . $ code3_equal(4301982f75a4a5fa).(const OnigCodePointcxx . . $ OnigCodePoint# *x, const OnigCodePointcxx . . $ OnigCodePoint# *y)
133 {
134 if (x[0] != y[0]) return 0;
135 if (x[1] != y[1]) return 0;
136 if (x[2] != y[2]) return 0;
137 return 1;
138 }
139
140 /* macros related to ONIGENC_CASE flags */
141 /* defined here because not used in other files */
142 #define ONIGENC_CASE_SPECIALScxx . . $ `vendor/onigmo-source/enc/unicode.c:142:9`! (ONIGENC_CASE_TITLECASEcxx . . $ `vendor/onigmo-source/onigmo.h:115:9`! | ONIGENC_CASE_IS_TITLECASEcxx . . $ `vendor/onigmo-source/onigmo.h:126:9`! | ONIGENC_CASE_UP_SPECIALcxx . . $ `vendor/onigmo-source/onigmo.h:117:9`! | ONIGENC_CASE_DOWN_SPECIALcxx . . $ `vendor/onigmo-source/onigmo.h:118:9`!)
143
144 /* macros for length in CaseMappingSpecials array in enc/unicode/casefold.h */
145 #define SpecialsLengthOffsetcxx . . $ `vendor/onigmo-source/enc/unicode.c:145:9`! 25 /* needs to be higher than the 22 bits used for Unicode codepoints */
146 #define SpecialsLengthExtractcxx . . $ `vendor/onigmo-source/enc/unicode.c:146:9`!(n) ((n) >> SpecialsLengthOffsetcxx . . $ `vendor/onigmo-source/enc/unicode.c:145:9`!)
147 #define SpecialsCodepointExtractcxx . . $ `vendor/onigmo-source/enc/unicode.c:147:9`!(n) ((n) & ((1 << SpecialsLengthOffsetcxx . . $ `vendor/onigmo-source/enc/unicode.c:145:9`!) - 1))
148 #define SpecialsLengthEncodecxx . . $ `vendor/onigmo-source/enc/unicode.c:148:9`!(n) ((n) << SpecialsLengthOffsetcxx . . $ `vendor/onigmo-source/enc/unicode.c:145:9`!)
149
150 #define OnigSpecialIndexMaskcxx . . $ `vendor/onigmo-source/enc/unicode.c:150:9`! (((1 << OnigSpecialIndexWidthcxx . . $ `vendor/onigmo-source/onigmo.h:111:9`!) - 1) << OnigSpecialIndexShiftcxx . . $ `vendor/onigmo-source/onigmo.h:110:9`!)
151 #define OnigSpecialIndexEncodecxx . . $ `vendor/onigmo-source/enc/unicode.c:151:9`!(n) ((n) << OnigSpecialIndexShiftcxx . . $ `vendor/onigmo-source/onigmo.h:110:9`!)
152 #define OnigSpecialIndexDecodecxx . . $ `vendor/onigmo-source/enc/unicode.c:152:9`!(n) (((n) & OnigSpecialIndexMaskcxx . . $ `vendor/onigmo-source/enc/unicode.c:150:9`!) >> OnigSpecialIndexShiftcxx . . $ `vendor/onigmo-source/onigmo.h:110:9`!)
153
154 /* macros to shorten "enc/unicode/casefold.h", undefined immediately after including the file */
155 #define Ucxx . . $ `vendor/onigmo-source/enc/unicode.c:155:9`! ONIGENC_CASE_UPCASEcxx . . $ `vendor/onigmo-source/onigmo.h:113:9`!
156 #define Dcxx . . $ `vendor/onigmo-source/enc/unicode.c:156:9`! ONIGENC_CASE_DOWNCASEcxx . . $ `vendor/onigmo-source/onigmo.h:114:9`!
157 #define Fcxx . . $ `vendor/onigmo-source/enc/unicode.c:157:9`! ONIGENC_CASE_FOLDcxx . . $ `vendor/onigmo-source/onigmo.h:120:9`!
158 #define STcxx . . $ `vendor/onigmo-source/enc/unicode.c:158:9`! ONIGENC_CASE_TITLECASEcxx . . $ `vendor/onigmo-source/onigmo.h:115:9`!
159 #define SUcxx . . $ `vendor/onigmo-source/enc/unicode.c:159:9`! ONIGENC_CASE_UP_SPECIALcxx . . $ `vendor/onigmo-source/onigmo.h:117:9`!
160 #define SLcxx . . $ `vendor/onigmo-source/enc/unicode.c:160:9`! ONIGENC_CASE_DOWN_SPECIALcxx . . $ `vendor/onigmo-source/onigmo.h:118:9`!
161 #define ITcxx . . $ `vendor/onigmo-source/enc/unicode.c:161:9`! ONIGENC_CASE_IS_TITLECASEcxx . . $ `vendor/onigmo-source/onigmo.h:126:9`!
162 #define Icxx . . $ `vendor/onigmo-source/enc/unicode.c:162:9`!(n) OnigSpecialIndexEncodecxx . . $ `vendor/onigmo-source/enc/unicode.c:151:9`!(n)
163 #define Lcxx . . $ `vendor/onigmo-source/enc/unicode.c:163:9`!(n) SpecialsLengthEncodecxx . . $ `vendor/onigmo-source/enc/unicode.c:148:9`!(n)
164
165 #include "casefold.h"cxx . . $ `<file>/vendor/onigmo-source/enc/unicode/casefold.h`/
166
167 #undef Ucxx . . $ `vendor/onigmo-source/enc/unicode.c:155:9`!
168 #undef Dcxx . . $ `vendor/onigmo-source/enc/unicode.c:156:9`!
169 #undef Fcxx . . $ `vendor/onigmo-source/enc/unicode.c:157:9`!
170 #undef STcxx . . $ `vendor/onigmo-source/enc/unicode.c:158:9`!
171 #undef SUcxx . . $ `vendor/onigmo-source/enc/unicode.c:159:9`!
172 #undef SLcxx . . $ `vendor/onigmo-source/enc/unicode.c:160:9`!
173 #undef ITcxx . . $ `vendor/onigmo-source/enc/unicode.c:161:9`!
174 #undef Icxx . . $ `vendor/onigmo-source/enc/unicode.c:162:9`!
175 #undef Lcxx . . $ `vendor/onigmo-source/enc/unicode.c:163:9`!
176
177 #include "name2ctype.h"cxx . . $ `<file>/vendor/onigmo-source/enc/unicode/name2ctype.h`/
178
179 #define CODE_RANGES_NUMcxx . . $ `vendor/onigmo-source/enc/unicode.c:179:9`! numberofcxx . . $ `vendor/onigmo-source/regenc.h:128:10`!(CodeRanges)
180
181 extern int
182 onigenc_unicode_is_code_ctypecxx . . $ onigenc_unicode_is_code_ctype(7f36058cb237933f).(OnigCodePointcxx . . $ OnigCodePoint# code, unsigned int ctype, OnigEncodingcxx . . $ OnigEncoding# enc ARG_UNUSEDcxx . . $ `vendor/onigmo-source/regint.h:100:10`!)
183 {
184 if (
185 #ifdef USE_UNICODE_PROPERTIEScxx . . $ `vendor/onigmo-source/regenc.h:133:9`!
186 ctype <= ONIGENC_MAX_STD_CTYPEcxx . . $ `vendor/onigmo-source/onigmo.h:309:9`! &&
187 #endif
188 code < 256) {
189 return ONIGENC_IS_UNICODE_ISO_8859_1_CTYPEcxx . . $ `vendor/onigmo-source/enc/unicode.c:32:9`!(code, ctype);
190 }
191
192 if (ctype >= CODE_RANGES_NUMcxx . . $ `vendor/onigmo-source/enc/unicode.c:179:9`!) {
193 return ONIGERR_TYPE_BUGcxx . . $ `vendor/onigmo-source/onigmo.h:630:9`!;
194 }
195
196 return onig_is_in_code_rangecxx . . $ onig_is_in_code_range(f360f2bcf3cfccb1).((UCharcxx . . $ `vendor/onigmo-source/onigmo.h:76:10`!* )CodeRangescxx . . $ CodeRanges.[ctype], code);
197 }
198
199
200 extern int
201 onigenc_unicode_ctype_code_rangecxx . . $ onigenc_unicode_ctype_code_range(5e6be6284877c10).(int ctype, const OnigCodePointcxx . . $ OnigCodePoint#* ranges[])
202 {
203 if (ctype >= CODE_RANGES_NUMcxx . . $ `vendor/onigmo-source/enc/unicode.c:179:9`!) {
204 return ONIGERR_TYPE_BUGcxx . . $ `vendor/onigmo-source/onigmo.h:630:9`!;
205 }
206
207 *ranges = CodeRangescxx . . $ CodeRanges.[ctype];
208
209 return 0;
210 }
211
212 extern int
213 onigenc_utf16_32_get_ctype_code_rangecxx . . $ onigenc_utf16_32_get_ctype_code_range(f3da0df4ba860021).(OnigCtypecxx . . $ OnigCtype# ctype, OnigCodePointcxx . . $ OnigCodePoint#* sb_out,
214 const OnigCodePointcxx . . $ OnigCodePoint#* ranges[],
215 OnigEncodingcxx . . $ OnigEncoding# enc ARG_UNUSEDcxx . . $ `vendor/onigmo-source/regint.h:100:10`!)
216 {
217 *sb_out = 0x00;
218 return onigenc_unicode_ctype_code_rangecxx . . $ onigenc_unicode_ctype_code_range(5e6be6284877c10).(ctype, ranges);
219 }
220
221 #define PROPERTY_NAME_MAX_SIZEcxx . . $ `vendor/onigmo-source/enc/unicode.c:221:9`! (MAX_WORD_LENGTHcxx . . $ `vendor/onigmo-source/enc/unicode/name2ctype.h:33377:9`! + 1)
222
223 extern int
224 onigenc_unicode_property_name_to_ctypecxx . . $ onigenc_unicode_property_name_to_ctype(fb2245aa60ebfd32).(OnigEncodingcxx . . $ OnigEncoding# enc, const UCharcxx . . $ `vendor/onigmo-source/onigmo.h:76:10`!* name, const UCharcxx . . $ `vendor/onigmo-source/onigmo.h:76:10`!* end)
225 {
226 int len;
227 int ctype;
228 UCharcxx . . $ `vendor/onigmo-source/onigmo.h:76:10`! buf[PROPERTY_NAME_MAX_SIZEcxx . . $ `vendor/onigmo-source/enc/unicode.c:221:9`!];
229 const UCharcxx . . $ `vendor/onigmo-source/onigmo.h:76:10`! *p;
230 OnigCodePointcxx . . $ OnigCodePoint# code;
231
232 len = 0;
233 for (p = name; p < end; p += enclencxx . . $ `vendor/onigmo-source/regenc.h:93:9`!(enc, p, end)) {
234 code = ONIGENC_MBC_TO_CODEcxx . . $ `vendor/onigmo-source/onigmo.h:366:9`!(enc, p, end);
235 if (code == ' ' || code == '-' || code == '_')
236 continue;
237 if (code >= 0x80)
238 return ONIGERR_INVALID_CHAR_PROPERTY_NAMEcxx . . $ `vendor/onigmo-source/onigmo.h:688:9`!;
239
240 buf[len++] = ONIGENC_ASCII_CODE_TO_LOWER_CASEcxx . . $ `vendor/onigmo-source/regenc.h:214:9`!(code);
241 if (len >= PROPERTY_NAME_MAX_SIZEcxx . . $ `vendor/onigmo-source/enc/unicode.c:221:9`!)
242 return ONIGERR_INVALID_CHAR_PROPERTY_NAMEcxx . . $ `vendor/onigmo-source/onigmo.h:688:9`!;
243 }
244
245 buf[len] = 0;
246
247 if ((ctype = uniname2ctypecxx . . $ uniname2ctype(f360f2bcf3cfccb1).(buf, len)) < 0) {
248 return ONIGERR_INVALID_CHAR_PROPERTY_NAMEcxx . . $ `vendor/onigmo-source/onigmo.h:688:9`!;
249 }
250
251 return ctype;
252 }
253
254 #define onigenc_unicode_fold_lookupcxx . . $ `vendor/onigmo-source/enc/unicode.c:254:9`! onigenc_unicode_CaseFold_11_lookup
255 #define onigenc_unicode_unfold1_lookupcxx . . $ `vendor/onigmo-source/enc/unicode.c:255:9`! onigenc_unicode_CaseUnfold_11_lookup
256 #define onigenc_unicode_unfold2_lookupcxx . . $ `vendor/onigmo-source/enc/unicode.c:256:9`! onigenc_unicode_CaseUnfold_12_lookup
257 #define onigenc_unicode_unfold3_lookupcxx . . $ `vendor/onigmo-source/enc/unicode.c:257:9`! onigenc_unicode_CaseUnfold_13_lookup
258
259 enumcxx . . $ $anonymous_type_c9427807b9d3fb8_6# {
260 I_WITH_DOT_ABOVEcxx . . $ I_WITH_DOT_ABOVE. = 0x0130,
261 DOTLESS_icxx . . $ DOTLESS_i. = 0x0131,
262 DOT_ABOVEcxx . . $ DOT_ABOVE. = 0x0307
263 };
264
265 extern int
266 onigenc_unicode_mbc_case_foldcxx . . $ onigenc_unicode_mbc_case_fold(971301441d819429).(OnigEncodingcxx . . $ OnigEncoding# enc,
267 OnigCaseFoldTypecxx . . $ OnigCaseFoldType# flag ARG_UNUSEDcxx . . $ `vendor/onigmo-source/regint.h:100:10`!, const UCharcxx . . $ `vendor/onigmo-source/onigmo.h:76:10`!** pp, const UCharcxx . . $ `vendor/onigmo-source/onigmo.h:76:10`!* end,
268 UCharcxx . . $ `vendor/onigmo-source/onigmo.h:76:10`!* fold)
269 {
270 const CodePointList3cxx . . $ CodePointList3# *to;
271 OnigCodePointcxx . . $ OnigCodePoint# code;
272 int i, len, rlen;
273 const UCharcxx . . $ `vendor/onigmo-source/onigmo.h:76:10`! *p = *pp;
274
275 code = ONIGENC_MBC_TO_CODEcxx . . $ `vendor/onigmo-source/onigmo.h:366:9`!(enc, p, end);
276 len = enclencxx . . $ `vendor/onigmo-source/regenc.h:93:9`!(enc, p, end);
277 *pp += len;
278
279 #ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
280 if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {
281 if (code == 'I') {
282 return ONIGENC_CODE_TO_MBC(enc, DOTLESS_i, fold);
283 }
284 else if (code == I_WITH_DOT_ABOVE) {
285 return ONIGENC_CODE_TO_MBC(enc, 'i', fold);
286 }
287 }
288 #endif
289
290 if ((to = onigenc_unicode_fold_lookupcxx . . $ `vendor/onigmo-source/enc/unicode.c:254:9`!(code)) != 0) {
291 if (OnigCodePointCountcxx . . $ `vendor/onigmo-source/onigmo.h:102:9`!(to->n) == 1) {
292 return ONIGENC_CODE_TO_MBCcxx . . $ `vendor/onigmo-source/onigmo.h:368:9`!(enc, to->code[0], fold);
293 }
294 #if 0
295 /* NO NEEDS TO CHECK */
296 else if ((flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0)
297 #else
298 else
299 #endif
300 {
301 rlen = 0;
302 for (i = 0; i < OnigCodePointCountcxx . . $ `vendor/onigmo-source/onigmo.h:102:9`!(to->n); i++) {
303 len = ONIGENC_CODE_TO_MBCcxx . . $ `vendor/onigmo-source/onigmo.h:368:9`!(enc, to->code[i], fold);
304 fold += len;
305 rlen += len;
306 }
307 return rlen;
308 }
309 }
310
311 for (i = 0; i < len; i++) {
312 *fold++ = *p++;
313 }
314 return len;
315 }
316
317 extern int
318 onigenc_unicode_apply_all_case_foldcxx . . $ onigenc_unicode_apply_all_case_fold(52943f35c546f971).(OnigCaseFoldTypecxx . . $ OnigCaseFoldType# flag,
319 OnigApplyAllCaseFoldFunccxx . . $ OnigApplyAllCaseFoldFunc# f, void* arg,
320 OnigEncodingcxx . . $ OnigEncoding# enc ARG_UNUSEDcxx . . $ `vendor/onigmo-source/regint.h:100:10`!)
321 {
322 const CaseUnfold_11_Typecxx . . $ CaseUnfold_11_Type#* p11;
323 OnigCodePointcxx . . $ OnigCodePoint# code;
324 int i, j, k, r;
325
326 for (i = 0; i < numberofcxx . . $ `vendor/onigmo-source/regenc.h:128:10`!(CaseUnfold_11cxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:3600:9`!); i++) {
327 p11 = &CaseUnfold_11cxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:3600:9`![i];
328 for (j = 0; j < OnigCodePointCountcxx . . $ `vendor/onigmo-source/onigmo.h:102:9`!(p11->to.n); j++) {
329 code = p11->fromcxx . . $ $anonymous_type_c9427807b9d3fb8_2#from.;
330 r = (*f)(p11->tocxx . . $ $anonymous_type_c9427807b9d3fb8_2#to..codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.[j], &code, 1, arg);
331 if (r != 0) return r;
332
333 code = p11->tocxx . . $ $anonymous_type_c9427807b9d3fb8_2#to..codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.[j];
334 r = (*f)(p11->fromcxx . . $ $anonymous_type_c9427807b9d3fb8_2#from., &code, 1, arg);
335 if (r != 0) return r;
336
337 for (k = 0; k < j; k++) {
338 r = (*f)(p11->tocxx . . $ $anonymous_type_c9427807b9d3fb8_2#to..codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.[j], (OnigCodePointcxx . . $ OnigCodePoint#* )(&p11->tocxx . . $ $anonymous_type_c9427807b9d3fb8_2#to..codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.[k]), 1, arg);
339 if (r != 0) return r;
340
341 r = (*f)(p11->tocxx . . $ $anonymous_type_c9427807b9d3fb8_2#to..codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.[k], (OnigCodePointcxx . . $ OnigCodePoint#* )(&p11->tocxx . . $ $anonymous_type_c9427807b9d3fb8_2#to..codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.[j]), 1, arg);
342 if (r != 0) return r;
343 }
344 }
345 }
346
347 #ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
348 if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {
349 code = DOTLESS_i;
350 r = (*f)('I', &code, 1, arg);
351 if (r != 0) return r;
352 code = 'I';
353 r = (*f)(DOTLESS_i, &code, 1, arg);
354 if (r != 0) return r;
355
356 code = I_WITH_DOT_ABOVE;
357 r = (*f)('i', &code, 1, arg);
358 if (r != 0) return r;
359 code = 'i';
360 r = (*f)(I_WITH_DOT_ABOVE, &code, 1, arg);
361 if (r != 0) return r;
362 }
363 else {
364 #endif
365 for (i = 0; i < numberofcxx . . $ `vendor/onigmo-source/regenc.h:128:10`!(CaseUnfold_11_Localecxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:4867:9`!); i++) {
366 p11 = &CaseUnfold_11_Localecxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:4867:9`![i];
367 for (j = 0; j < OnigCodePointCountcxx . . $ `vendor/onigmo-source/onigmo.h:102:9`!(p11->to.n); j++) {
368 code = p11->fromcxx . . $ $anonymous_type_c9427807b9d3fb8_2#from.;
369 r = (*f)(p11->tocxx . . $ $anonymous_type_c9427807b9d3fb8_2#to..codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.[j], &code, 1, arg);
370 if (r != 0) return r;
371
372 code = p11->tocxx . . $ $anonymous_type_c9427807b9d3fb8_2#to..codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.[j];
373 r = (*f)(p11->fromcxx . . $ $anonymous_type_c9427807b9d3fb8_2#from., &code, 1, arg);
374 if (r != 0) return r;
375
376 for (k = 0; k < j; k++) {
377 r = (*f)(p11->tocxx . . $ $anonymous_type_c9427807b9d3fb8_2#to..codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.[j], (OnigCodePointcxx . . $ OnigCodePoint#* )(&p11->tocxx . . $ $anonymous_type_c9427807b9d3fb8_2#to..codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.[k]),
378 1, arg);
379 if (r != 0) return r;
380
381 r = (*f)(p11->tocxx . . $ $anonymous_type_c9427807b9d3fb8_2#to..codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.[k], (OnigCodePointcxx . . $ OnigCodePoint#* )(&p11->tocxx . . $ $anonymous_type_c9427807b9d3fb8_2#to..codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.[j]),
382 1, arg);
383 if (r != 0) return r;
384 }
385 }
386 }
387 #ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
388 }
389 #endif
390
391 if ((flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHARcxx . . $ `vendor/onigmo-source/onigmo.h:128:9`!) != 0) {
392 for (i = 0; i < numberofcxx . . $ `vendor/onigmo-source/regenc.h:128:10`!(CaseUnfold_12cxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:6619:9`!); i++) {
393 for (j = 0; j < OnigCodePointCountcxx . . $ `vendor/onigmo-source/onigmo.h:102:9`!(CaseUnfold_12cxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:6619:9`![i].to.n); j++) {
394 r = (*f)(CaseUnfold_12cxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:6619:9`![i].tocxx . . $ $anonymous_type_c9427807b9d3fb8_4#to..codecxx . . $ $anonymous_type_c9427807b9d3fb8_3#code.[j],
395 (OnigCodePointcxx . . $ OnigCodePoint#* )CaseUnfold_12cxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:6619:9`![i].fromcxx . . $ $anonymous_type_c9427807b9d3fb8_4#from., 2, arg);
396 if (r != 0) return r;
397
398 for (k = 0; k < OnigCodePointCountcxx . . $ `vendor/onigmo-source/onigmo.h:102:9`!(CaseUnfold_12cxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:6619:9`![i].to.n); k++) {
399 if (k == j) continue;
400
401 r = (*f)(CaseUnfold_12cxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:6619:9`![i].tocxx . . $ $anonymous_type_c9427807b9d3fb8_4#to..codecxx . . $ $anonymous_type_c9427807b9d3fb8_3#code.[j],
402 (OnigCodePointcxx . . $ OnigCodePoint#* )(&CaseUnfold_12cxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:6619:9`![i].tocxx . . $ $anonymous_type_c9427807b9d3fb8_4#to..codecxx . . $ $anonymous_type_c9427807b9d3fb8_3#code.[k]), 1, arg);
403 if (r != 0) return r;
404 }
405 }
406 }
407
408 #ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
409 if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) == 0) {
410 #endif
411 for (i = 0; i < numberofcxx . . $ `vendor/onigmo-source/regenc.h:128:10`!(CaseUnfold_12_Localecxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:6678:9`!); i++) {
412 for (j = 0; j < OnigCodePointCountcxx . . $ `vendor/onigmo-source/onigmo.h:102:9`!(CaseUnfold_12_Localecxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:6678:9`![i].to.n); j++) {
413 r = (*f)(CaseUnfold_12_Localecxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:6678:9`![i].tocxx . . $ $anonymous_type_c9427807b9d3fb8_4#to..codecxx . . $ $anonymous_type_c9427807b9d3fb8_3#code.[j],
414 (OnigCodePointcxx . . $ OnigCodePoint#* )CaseUnfold_12_Localecxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:6678:9`![i].fromcxx . . $ $anonymous_type_c9427807b9d3fb8_4#from., 2, arg);
415 if (r != 0) return r;
416
417 for (k = 0; k < OnigCodePointCountcxx . . $ `vendor/onigmo-source/onigmo.h:102:9`!(CaseUnfold_12_Localecxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:6678:9`![i].to.n); k++) {
418 if (k == j) continue;
419
420 r = (*f)(CaseUnfold_12_Localecxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:6678:9`![i].tocxx . . $ $anonymous_type_c9427807b9d3fb8_4#to..codecxx . . $ $anonymous_type_c9427807b9d3fb8_3#code.[j],
421 (OnigCodePointcxx . . $ OnigCodePoint#* )(&CaseUnfold_12_Localecxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:6678:9`![i].tocxx . . $ $anonymous_type_c9427807b9d3fb8_4#to..codecxx . . $ $anonymous_type_c9427807b9d3fb8_3#code.[k]),
422 1, arg);
423 if (r != 0) return r;
424 }
425 }
426 }
427 #ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
428 }
429 #endif
430
431 for (i = 0; i < numberofcxx . . $ `vendor/onigmo-source/regenc.h:128:10`!(CaseUnfold_13cxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:6821:9`!); i++) {
432 for (j = 0; j < OnigCodePointCountcxx . . $ `vendor/onigmo-source/onigmo.h:102:9`!(CaseUnfold_13cxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:6821:9`![i].to.n); j++) {
433 r = (*f)(CaseUnfold_13cxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:6821:9`![i].tocxx . . $ $anonymous_type_c9427807b9d3fb8_5#to..codecxx . . $ $anonymous_type_c9427807b9d3fb8_3#code.[j],
434 (OnigCodePointcxx . . $ OnigCodePoint#* )CaseUnfold_13cxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:6821:9`![i].fromcxx . . $ $anonymous_type_c9427807b9d3fb8_5#from., 3, arg);
435 if (r != 0) return r;
436
437 for (k = 0; k < OnigCodePointCountcxx . . $ `vendor/onigmo-source/onigmo.h:102:9`!(CaseUnfold_13cxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:6821:9`![i].to.n); k++) {
438 if (k == j) continue;
439
440 r = (*f)(CaseUnfold_13cxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:6821:9`![i].tocxx . . $ $anonymous_type_c9427807b9d3fb8_5#to..codecxx . . $ $anonymous_type_c9427807b9d3fb8_3#code.[j],
441 (OnigCodePointcxx . . $ OnigCodePoint#* )(&CaseUnfold_13cxx . . $ `vendor/onigmo-source/enc/unicode/casefold.h:6821:9`![i].tocxx . . $ $anonymous_type_c9427807b9d3fb8_5#to..codecxx . . $ $anonymous_type_c9427807b9d3fb8_3#code.[k]), 1, arg);
442 if (r != 0) return r;
443 }
444 }
445 }
446 }
447
448 return 0;
449 }
450
451 #define CodePointListValidPcxx . . $ `vendor/onigmo-source/enc/unicode.c:451:9`!(x) (OnigCodePointCountcxx . . $ `vendor/onigmo-source/onigmo.h:102:9`!((x)->n) <= numberofcxx . . $ `vendor/onigmo-source/regenc.h:128:10`!((x)->code))
452
453 extern int
454 onigenc_unicode_get_case_fold_codes_by_strcxx . . $ onigenc_unicode_get_case_fold_codes_by_str(1749d66e1d069997).(OnigEncodingcxx . . $ OnigEncoding# enc,
455 OnigCaseFoldTypecxx . . $ OnigCaseFoldType# flag, const OnigUCharcxx . . $ OnigUChar#* p, const OnigUCharcxx . . $ OnigUChar#* end,
456 OnigCaseFoldCodeItemcxx . . $ OnigCaseFoldCodeItem# items[])
457 {
458 int n, i, j, k, len;
459 OnigCodePointcxx . . $ OnigCodePoint# code, codes[3];
460 const CodePointList3cxx . . $ CodePointList3# *to, *z3;
461 const CodePointList2cxx . . $ CodePointList2# *z2;
462
463 n = 0;
464
465 code = ONIGENC_MBC_TO_CODEcxx . . $ `vendor/onigmo-source/onigmo.h:366:9`!(enc, p, end);
466 len = enclencxx . . $ `vendor/onigmo-source/regenc.h:93:9`!(enc, p, end);
467
468 #ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
469 if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {
470 switch (code) {
471 case 'I':
472 items[0].byte_len = len;
473 items[0].code_len = 1;
474 items[0].code[0] = DOTLESS_i;
475 return 1;
476 case I_WITH_DOT_ABOVE:
477 items[0].byte_len = len;
478 items[0].code_len = 1;
479 items[0].code[0] = 'i';
480 return 1;
481 case DOTLESS_i:
482 items[0].byte_len = len;
483 items[0].code_len = 1;
484 items[0].code[0] = 'I';
485 return 1;
486 case 'i':
487 items[0].byte_len = len;
488 items[0].code_len = 1;
489 items[0].code[0] = I_WITH_DOT_ABOVE;
490 return 1;
491 }
492 }
493 #endif
494
495 if ((to = onigenc_unicode_fold_lookupcxx . . $ `vendor/onigmo-source/enc/unicode.c:254:9`!(code)) != 0) {
496 if (OnigCodePointCountcxx . . $ `vendor/onigmo-source/onigmo.h:102:9`!(to->n) == 1) {
497 OnigCodePointcxx . . $ OnigCodePoint# orig_code = code;
498
499 items[0].byte_lencxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#byte_len. = len;
500 items[0].code_lencxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#code_len. = 1;
501 items[0].codecxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#code.[0] = to->codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.[0];
502 n++;
503
504 code = to->codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.[0];
505 if ((to = onigenc_unicode_unfold1_lookupcxx . . $ `vendor/onigmo-source/enc/unicode.c:255:9`!(code)) != 0 &&
506 CodePointListValidPcxx . . $ `vendor/onigmo-source/enc/unicode.c:451:9`!(to)) {
507 for (i = 0; i < OnigCodePointCountcxx . . $ `vendor/onigmo-source/onigmo.h:102:9`!(to->n); i++) {
508 if (to->codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.[i] != orig_code) {
509 items[n].byte_lencxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#byte_len. = len;
510 items[n].code_lencxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#code_len. = 1;
511 items[n].codecxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#code.[0] = to->codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.[i];
512 n++;
513 }
514 }
515 }
516 }
517 else if ((flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHARcxx . . $ `vendor/onigmo-source/onigmo.h:128:9`!) != 0) {
518 OnigCodePointcxx . . $ OnigCodePoint# cs[3][4];
519 int fn, ncs[3];
520
521 for (fn = 0; fn < OnigCodePointCountcxx . . $ `vendor/onigmo-source/onigmo.h:102:9`!(to->n); fn++) {
522 cs[fn][0] = to->codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.[fn];
523 if ((z3 = onigenc_unicode_unfold1_lookupcxx . . $ `vendor/onigmo-source/enc/unicode.c:255:9`!(cs[fn][0])) != 0) {
524 for (i = 0; i < OnigCodePointCountcxx . . $ `vendor/onigmo-source/onigmo.h:102:9`!(z3->n); i++) {
525 cs[fn][i+1] = z3->codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.[i];
526 }
527 ncs[fn] = OnigCodePointCountcxx . . $ `vendor/onigmo-source/onigmo.h:102:9`!(z3->n) + 1;
528 }
529 else
530 ncs[fn] = 1;
531 }
532
533 if (fn == 2) {
534 for (i = 0; i < ncs[0]; i++) {
535 for (j = 0; j < ncs[1]; j++) {
536 items[n].byte_lencxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#byte_len. = len;
537 items[n].code_lencxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#code_len. = 2;
538 items[n].codecxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#code.[0] = cs[0][i];
539 items[n].codecxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#code.[1] = cs[1][j];
540 n++;
541 }
542 }
543
544 if ((z2 = onigenc_unicode_unfold2_lookupcxx . . $ `vendor/onigmo-source/enc/unicode.c:256:9`!(to->codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.)) != 0 &&
545 CodePointListValidPcxx . . $ `vendor/onigmo-source/enc/unicode.c:451:9`!(z2)) {
546 for (i = 0; i < OnigCodePointCountcxx . . $ `vendor/onigmo-source/onigmo.h:102:9`!(z2->n); i++) {
547 if (z2->codecxx . . $ $anonymous_type_c9427807b9d3fb8_3#code.[i] == code) continue;
548
549 items[n].byte_lencxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#byte_len. = len;
550 items[n].code_lencxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#code_len. = 1;
551 items[n].codecxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#code.[0] = z2->codecxx . . $ $anonymous_type_c9427807b9d3fb8_3#code.[i];
552 n++;
553 }
554 }
555 }
556 else {
557 for (i = 0; i < ncs[0]; i++) {
558 for (j = 0; j < ncs[1]; j++) {
559 for (k = 0; k < ncs[2]; k++) {
560 items[n].byte_lencxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#byte_len. = len;
561 items[n].code_lencxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#code_len. = 3;
562 items[n].codecxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#code.[0] = cs[0][i];
563 items[n].codecxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#code.[1] = cs[1][j];
564 items[n].codecxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#code.[2] = cs[2][k];
565 n++;
566 }
567 }
568 }
569
570 if ((z2 = onigenc_unicode_unfold3_lookupcxx . . $ `vendor/onigmo-source/enc/unicode.c:257:9`!(to->codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.)) != 0 &&
571 CodePointListValidPcxx . . $ `vendor/onigmo-source/enc/unicode.c:451:9`!(z2)) {
572 for (i = 0; i < OnigCodePointCountcxx . . $ `vendor/onigmo-source/onigmo.h:102:9`!(z2->n); i++) {
573 if (z2->codecxx . . $ $anonymous_type_c9427807b9d3fb8_3#code.[i] == code) continue;
574
575 items[n].byte_lencxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#byte_len. = len;
576 items[n].code_lencxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#code_len. = 1;
577 items[n].codecxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#code.[0] = z2->codecxx . . $ $anonymous_type_c9427807b9d3fb8_3#code.[i];
578 n++;
579 }
580 }
581 }
582
583 /* multi char folded code is not head of another folded multi char */
584 flag = 0; /* DISABLE_CASE_FOLD_MULTI_CHAR(flag); */
585 }
586 }
587 else {
588 if ((to = onigenc_unicode_unfold1_lookupcxx . . $ `vendor/onigmo-source/enc/unicode.c:255:9`!(code)) != 0 &&
589 CodePointListValidPcxx . . $ `vendor/onigmo-source/enc/unicode.c:451:9`!(to)) {
590 for (i = 0; i < OnigCodePointCountcxx . . $ `vendor/onigmo-source/onigmo.h:102:9`!(to->n); i++) {
591 items[n].byte_lencxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#byte_len. = len;
592 items[n].code_lencxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#code_len. = 1;
593 items[n].codecxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#code.[0] = to->codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.[i];
594 n++;
595 }
596 }
597 }
598
599
600 if ((flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHARcxx . . $ `vendor/onigmo-source/onigmo.h:128:9`!) != 0) {
601 p += len;
602 if (p < end) {
603 int clen;
604
605 codes[0] = code;
606 code = ONIGENC_MBC_TO_CODEcxx . . $ `vendor/onigmo-source/onigmo.h:366:9`!(enc, p, end);
607 if ((to = onigenc_unicode_fold_lookupcxx . . $ `vendor/onigmo-source/enc/unicode.c:254:9`!(code)) != 0
608 && OnigCodePointCountcxx . . $ `vendor/onigmo-source/onigmo.h:102:9`!(to->n) == 1) {
609 codes[1] = to->codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.[0];
610 }
611 else
612 codes[1] = code;
613
614 clen = enclencxx . . $ `vendor/onigmo-source/regenc.h:93:9`!(enc, p, end);
615 len += clen;
616 if ((z2 = onigenc_unicode_unfold2_lookupcxx . . $ `vendor/onigmo-source/enc/unicode.c:256:9`!(codes)) != 0 &&
617 CodePointListValidPcxx . . $ `vendor/onigmo-source/enc/unicode.c:451:9`!(z2)) {
618 for (i = 0; i < OnigCodePointCountcxx . . $ `vendor/onigmo-source/onigmo.h:102:9`!(z2->n); i++) {
619 items[n].byte_lencxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#byte_len. = len;
620 items[n].code_lencxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#code_len. = 1;
621 items[n].codecxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#code.[0] = z2->codecxx . . $ $anonymous_type_c9427807b9d3fb8_3#code.[i];
622 n++;
623 }
624 }
625
626 p += clen;
627 if (p < end) {
628 code = ONIGENC_MBC_TO_CODEcxx . . $ `vendor/onigmo-source/onigmo.h:366:9`!(enc, p, end);
629 if ((to = onigenc_unicode_fold_lookupcxx . . $ `vendor/onigmo-source/enc/unicode.c:254:9`!(code)) != 0
630 && OnigCodePointCountcxx . . $ `vendor/onigmo-source/onigmo.h:102:9`!(to->n) == 1) {
631 codes[2] = to->codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.[0];
632 }
633 else
634 codes[2] = code;
635
636 clen = enclencxx . . $ `vendor/onigmo-source/regenc.h:93:9`!(enc, p, end);
637 len += clen;
638 if ((z2 = onigenc_unicode_unfold3_lookupcxx . . $ `vendor/onigmo-source/enc/unicode.c:257:9`!(codes)) != 0 &&
639 CodePointListValidPcxx . . $ `vendor/onigmo-source/enc/unicode.c:451:9`!(z2)) {
640 for (i = 0; i < OnigCodePointCountcxx . . $ `vendor/onigmo-source/onigmo.h:102:9`!(z2->n); i++) {
641 items[n].byte_lencxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#byte_len. = len;
642 items[n].code_lencxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#code_len. = 1;
643 items[n].codecxx . . $ $anonymous_type_d8a9e63ad63ca5ad_0#code.[0] = z2->codecxx . . $ $anonymous_type_c9427807b9d3fb8_3#code.[i];
644 n++;
645 }
646 }
647 }
648 }
649 }
650
651 return n;
652 }
653
654 /* length in bytes for three characters in UTF-32; e.g. needed for ffi (U+FB03) */
655 #define CASE_MAPPING_SLACKcxx . . $ `vendor/onigmo-source/enc/unicode.c:655:9`! 12
656 #define MODIFIEDcxx . . $ `vendor/onigmo-source/enc/unicode.c:656:9`! (flags |= ONIGENC_CASE_MODIFIEDcxx . . $ `vendor/onigmo-source/onigmo.h:119:9`!)
657 extern int
658 onigenc_unicode_case_mapcxx . . $ onigenc_unicode_case_map(963ee2b6f1418456).(OnigCaseFoldTypecxx . . $ OnigCaseFoldType#* flagP,
659 const OnigUCharcxx . . $ OnigUChar#** pp, const OnigUCharcxx . . $ OnigUChar#* end,
660 OnigUCharcxx . . $ OnigUChar#* to, OnigUCharcxx . . $ OnigUChar#* to_end,
661 const struct OnigEncodingTypeSTcxx . . $ OnigEncodingTypeST#* enc)
662 {
663 OnigCodePointcxx . . $ OnigCodePoint# code;
664 OnigUCharcxx . . $ OnigUChar# *to_start = to;
665 OnigCaseFoldTypecxx . . $ OnigCaseFoldType# flags = *flagP;
666 int codepoint_length;
667
668 to_end -= CASE_MAPPING_SLACKcxx . . $ `vendor/onigmo-source/enc/unicode.c:655:9`!;
669 /* copy flags ONIGENC_CASE_UPCASE and ONIGENC_CASE_DOWNCASE over to
670 * ONIGENC_CASE_UP_SPECIAL and ONIGENC_CASE_DOWN_SPECIAL */
671 flags |= (flags & (ONIGENC_CASE_UPCASEcxx . . $ `vendor/onigmo-source/onigmo.h:113:9`! | ONIGENC_CASE_DOWNCASEcxx . . $ `vendor/onigmo-source/onigmo.h:114:9`!)) << ONIGENC_CASE_SPECIAL_OFFSETcxx . . $ `vendor/onigmo-source/onigmo.h:116:9`!;
672
673 while (*pp < end && to <= to_end) {
674 codepoint_length = ONIGENC_PRECISE_MBC_ENC_LENcxx . . $ `vendor/onigmo-source/onigmo.h:356:9`!(enc, *pp, end);
675 if (codepoint_length < 0)
676 return codepoint_length; /* encoding invalid */
677 code = ONIGENC_MBC_TO_CODEcxx . . $ `vendor/onigmo-source/onigmo.h:366:9`!(enc, *pp, end);
678 *pp += codepoint_length;
679
680 if (code <= 'z') { /* ASCII comes first */
681 if (code >= 'a' && code <= 'z') {
682 if (flags & ONIGENC_CASE_UPCASEcxx . . $ `vendor/onigmo-source/onigmo.h:113:9`!) {
683 MODIFIEDcxx . . $ `vendor/onigmo-source/enc/unicode.c:656:9`!;
684 if (flags & ONIGENC_CASE_FOLD_TURKISH_AZERIcxx . . $ `vendor/onigmo-source/onigmo.h:122:9`! && code == 'i')
685 code = I_WITH_DOT_ABOVEcxx . . $ I_WITH_DOT_ABOVE.;
686 else
687 code += 'A' - 'a';
688 }
689 }
690 else if (code >= 'A' && code <= 'Z') {
691 if (flags & (ONIGENC_CASE_DOWNCASEcxx . . $ `vendor/onigmo-source/onigmo.h:114:9`! | ONIGENC_CASE_FOLDcxx . . $ `vendor/onigmo-source/onigmo.h:120:9`!)) {
692 MODIFIEDcxx . . $ `vendor/onigmo-source/enc/unicode.c:656:9`!;
693 if (flags & ONIGENC_CASE_FOLD_TURKISH_AZERIcxx . . $ `vendor/onigmo-source/onigmo.h:122:9`! && code == 'I')
694 code = DOTLESS_icxx . . $ DOTLESS_i.;
695 else
696 code += 'a' - 'A';
697 }
698 }
699 }
700 else if (!(flags & ONIGENC_CASE_ASCII_ONLYcxx . . $ `vendor/onigmo-source/onigmo.h:125:9`!) && code >= 0x00B5) { /* deal with non-ASCII; micron sign (U+00B5) is lowest affected */
701 const CodePointList3cxx . . $ CodePointList3# *folded;
702
703 if (code == I_WITH_DOT_ABOVEcxx . . $ I_WITH_DOT_ABOVE.) {
704 if (flags & (ONIGENC_CASE_DOWNCASEcxx . . $ `vendor/onigmo-source/onigmo.h:114:9`! | ONIGENC_CASE_FOLDcxx . . $ `vendor/onigmo-source/onigmo.h:120:9`!)) {
705 MODIFIEDcxx . . $ `vendor/onigmo-source/enc/unicode.c:656:9`!;
706 code = 'i';
707 if (!(flags & ONIGENC_CASE_FOLD_TURKISH_AZERIcxx . . $ `vendor/onigmo-source/onigmo.h:122:9`!)) { /* make dot above explicit */
708 to += ONIGENC_CODE_TO_MBCcxx . . $ `vendor/onigmo-source/onigmo.h:368:9`!(enc, code, to);
709 code = DOT_ABOVEcxx . . $ DOT_ABOVE.;
710 }
711 }
712 }
713 else if (code == DOTLESS_icxx . . $ DOTLESS_i.) { /* handle this manually, because it isn't involved in folding */
714 if (flags & ONIGENC_CASE_UPCASEcxx . . $ `vendor/onigmo-source/onigmo.h:113:9`!) {
715 MODIFIEDcxx . . $ `vendor/onigmo-source/enc/unicode.c:656:9`!;
716 code = 'I';
717 }
718 }
719 else if ((folded = onigenc_unicode_fold_lookupcxx . . $ `vendor/onigmo-source/enc/unicode.c:254:9`!(code)) != 0) { /* data about character found in CaseFold_11_Table */
720 if ((flags & ONIGENC_CASE_TITLECASEcxx . . $ `vendor/onigmo-source/onigmo.h:115:9`!) /* Titlecase needed, */
721 && (OnigCaseFoldFlagscxx . . $ `vendor/onigmo-source/onigmo.h:103:9`!(folded->n) & ONIGENC_CASE_IS_TITLECASEcxx . . $ `vendor/onigmo-source/onigmo.h:126:9`!)) { /* but already Titlecase */
722 /* already Titlecase, no changes needed */
723 }
724 else if (flags & OnigCaseFoldFlagscxx . . $ `vendor/onigmo-source/onigmo.h:103:9`!(folded->n)) { /* needs and data availability match */
725 const OnigCodePointcxx . . $ OnigCodePoint# *next;
726 int count;
727
728 MODIFIEDcxx . . $ `vendor/onigmo-source/enc/unicode.c:656:9`!;
729 if (flags & OnigCaseFoldFlagscxx . . $ `vendor/onigmo-source/onigmo.h:103:9`!(folded->n) & ONIGENC_CASE_SPECIALScxx . . $ `vendor/onigmo-source/enc/unicode.c:142:9`!) { /* special */
730 const OnigCodePointcxx . . $ OnigCodePoint# *SpecialsStart = CaseMappingSpecialscxx . . $ CaseMappingSpecials. + OnigSpecialIndexDecodecxx . . $ `vendor/onigmo-source/enc/unicode.c:152:9`!(folded->n);
731
732 if (OnigCaseFoldFlagscxx . . $ `vendor/onigmo-source/onigmo.h:103:9`!(folded->n) & ONIGENC_CASE_IS_TITLECASEcxx . . $ `vendor/onigmo-source/onigmo.h:126:9`!) { /* swapCASE available */
733 if ((flags & (ONIGENC_CASE_UPCASEcxx . . $ `vendor/onigmo-source/onigmo.h:113:9`! | ONIGENC_CASE_DOWNCASEcxx . . $ `vendor/onigmo-source/onigmo.h:114:9`!))
734 == (ONIGENC_CASE_UPCASEcxx . . $ `vendor/onigmo-source/onigmo.h:113:9`! | ONIGENC_CASE_DOWNCASEcxx . . $ `vendor/onigmo-source/onigmo.h:114:9`!)) /* swapCASE needed */
735 goto SpecialsCopy;
736 else /* swapCASE not needed */
737 SpecialsStart += SpecialsLengthExtractcxx . . $ `vendor/onigmo-source/enc/unicode.c:146:9`!(*SpecialsStart);
738 }
739 if (OnigCaseFoldFlagscxx . . $ `vendor/onigmo-source/onigmo.h:103:9`!(folded->n) & ONIGENC_CASE_TITLECASEcxx . . $ `vendor/onigmo-source/onigmo.h:115:9`!) { /* Titlecase available */
740 if (flags & ONIGENC_CASE_TITLECASEcxx . . $ `vendor/onigmo-source/onigmo.h:115:9`!) /* Titlecase needed, but not yet Titlecase */
741 goto SpecialsCopy;
742 else /* Titlecase not needed */
743 SpecialsStart += SpecialsLengthExtractcxx . . $ `vendor/onigmo-source/enc/unicode.c:146:9`!(*SpecialsStart);
744 }
745 if (OnigCaseFoldFlagscxx . . $ `vendor/onigmo-source/onigmo.h:103:9`!(folded->n) & ONIGENC_CASE_DOWN_SPECIALcxx . . $ `vendor/onigmo-source/onigmo.h:118:9`!) {
746 if (!(flags & ONIGENC_CASE_DOWN_SPECIALcxx . . $ `vendor/onigmo-source/onigmo.h:118:9`!))
747 SpecialsStart += SpecialsLengthExtractcxx . . $ `vendor/onigmo-source/enc/unicode.c:146:9`!(*SpecialsStart);
748 }
749 /* here, we know we use ONIGENC_CASE_UP_SPECIAL, and the position is right */
750 SpecialsCopy:
751 count = SpecialsLengthExtractcxx . . $ `vendor/onigmo-source/enc/unicode.c:146:9`!(*SpecialsStart);
752 next = SpecialsStart;
753 code = SpecialsCodepointExtractcxx . . $ `vendor/onigmo-source/enc/unicode.c:147:9`!(*next++);
754 }
755 else { /* no specials */
756 count = OnigCodePointCountcxx . . $ `vendor/onigmo-source/onigmo.h:102:9`!(folded->n);
757 next = folded->codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.;
758 code = *next++;
759 }
760 if (count == 1)
761 ;
762 else if (count == 2) {
763 to += ONIGENC_CODE_TO_MBCcxx . . $ `vendor/onigmo-source/onigmo.h:368:9`!(enc, code, to);
764 code = *next;
765 }
766 else { /* count == 3 */
767 to += ONIGENC_CODE_TO_MBCcxx . . $ `vendor/onigmo-source/onigmo.h:368:9`!(enc, code, to);
768 to += ONIGENC_CODE_TO_MBCcxx . . $ `vendor/onigmo-source/onigmo.h:368:9`!(enc, *next++, to);
769 code = *next;
770 }
771 }
772 }
773 else if ((folded = onigenc_unicode_unfold1_lookupcxx . . $ `vendor/onigmo-source/enc/unicode.c:255:9`!(code)) != 0 /* data about character found in CaseUnfold_11_Table */
774 && flags & OnigCaseFoldFlagscxx . . $ `vendor/onigmo-source/onigmo.h:103:9`!(folded->n)) { /* needs and data availability match */
775 MODIFIEDcxx . . $ `vendor/onigmo-source/enc/unicode.c:656:9`!;
776 code = folded->codecxx . . $ $anonymous_type_c9427807b9d3fb8_0#code.[(flags & OnigCaseFoldFlagscxx . . $ `vendor/onigmo-source/onigmo.h:103:9`!(folded->n) & ONIGENC_CASE_TITLECASEcxx . . $ `vendor/onigmo-source/onigmo.h:115:9`!) ? 1 : 0];
777 }
778 }
779 to += ONIGENC_CODE_TO_MBCcxx . . $ `vendor/onigmo-source/onigmo.h:368:9`!(enc, code, to);
780 /* switch from titlecase to lowercase for capitalize */
781 if (flags & ONIGENC_CASE_TITLECASEcxx . . $ `vendor/onigmo-source/onigmo.h:115:9`!)
782 flags ^= (ONIGENC_CASE_UPCASEcxx . . $ `vendor/onigmo-source/onigmo.h:113:9`! | ONIGENC_CASE_DOWNCASEcxx . . $ `vendor/onigmo-source/onigmo.h:114:9`! | ONIGENC_CASE_TITLECASEcxx . . $ `vendor/onigmo-source/onigmo.h:115:9`! |
783 ONIGENC_CASE_UP_SPECIALcxx . . $ `vendor/onigmo-source/onigmo.h:117:9`! | ONIGENC_CASE_DOWN_SPECIALcxx . . $ `vendor/onigmo-source/onigmo.h:118:9`!);
784 }
785 *flagP = flags;
786 return (int )(to - to_start);
787 }
788
789 #if 0
790 const char onigenc_unicode_version_string[] =
791 #ifdef ONIG_UNICODE_VERSION_STRING
792 ONIG_UNICODE_VERSION_STRING
793 #endif
794 "";
795
796 const int onigenc_unicode_version_number[3] = {
797 #ifdef ONIG_UNICODE_VERSION_MAJOR
798 ONIG_UNICODE_VERSION_MAJOR,
799 ONIG_UNICODE_VERSION_MINOR,
800 ONIG_UNICODE_VERSION_TEENY,
801 #else
802 0
803 #endif
804 };
805 #endif