Ruby 2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)

regerror.c
Go to the documentation of this file.
1 /**********************************************************************
2 regerror.c - Onigmo (Oniguruma-mod) (regular expression library)
3 **********************************************************************/
4 /*-
5 * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
6 * Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp>
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 */
30
31 #include "regint.h"
32 #include <stdio.h> /* for vsnprintf() */
33
34 #include <stdarg.h>
35
36 extern UChar*
37 onig_error_code_to_format(OnigPosition code)
38 {
39 const char *p;
40
41 if (code >= 0) return (UChar* )0;
42
43 switch (code) {
44 case ONIG_MISMATCH:
45 p = "mismatch"; break;
46 case ONIG_NO_SUPPORT_CONFIG:
47 p = "no support in this configuration"; break;
48 case ONIGERR_MEMORY:
49 p = "failed to allocate memory"; break;
50 case ONIGERR_TYPE_BUG:
51 p = "undefined type (bug)"; break;
52 case ONIGERR_PARSER_BUG:
53 p = "internal parser error (bug)"; break;
54 case ONIGERR_STACK_BUG:
55 p = "stack error (bug)"; break;
56 case ONIGERR_UNDEFINED_BYTECODE:
57 p = "undefined bytecode (bug)"; break;
58 case ONIGERR_UNEXPECTED_BYTECODE:
59 p = "unexpected bytecode (bug)"; break;
60 case ONIGERR_MATCH_STACK_LIMIT_OVER:
61 p = "match-stack limit over"; break;
62 case ONIGERR_PARSE_DEPTH_LIMIT_OVER:
63 p = "parse depth limit over"; break;
64 case ONIGERR_DEFAULT_ENCODING_IS_NOT_SET:
65 p = "default multibyte-encoding is not set"; break;
66 case ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR:
67 p = "can't convert to wide-char on specified multibyte-encoding"; break;
68 case ONIGERR_INVALID_ARGUMENT:
69 p = "invalid argument"; break;
70 case ONIGERR_END_PATTERN_AT_LEFT_BRACE:
71 p = "end pattern at left brace"; break;
72 case ONIGERR_END_PATTERN_AT_LEFT_BRACKET:
73 p = "end pattern at left bracket"; break;
74 case ONIGERR_EMPTY_CHAR_CLASS:
75 p = "empty char-class"; break;
76 case ONIGERR_PREMATURE_END_OF_CHAR_CLASS:
77 p = "premature end of char-class"; break;
78 case ONIGERR_END_PATTERN_AT_ESCAPE:
79 p = "end pattern at escape"; break;
80 case ONIGERR_END_PATTERN_AT_META:
81 p = "end pattern at meta"; break;
82 case ONIGERR_END_PATTERN_AT_CONTROL:
83 p = "end pattern at control"; break;
84 case ONIGERR_META_CODE_SYNTAX:
85 p = "invalid meta-code syntax"; break;
86 case ONIGERR_CONTROL_CODE_SYNTAX:
87 p = "invalid control-code syntax"; break;
88 case ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE:
89 p = "char-class value at end of range"; break;
90 case ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE:
91 p = "char-class value at start of range"; break;
92 case ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS:
93 p = "unmatched range specifier in char-class"; break;
94 case ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED:
95 p = "target of repeat operator is not specified"; break;
96 case ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID:
97 p = "target of repeat operator is invalid"; break;
98 case ONIGERR_NESTED_REPEAT_OPERATOR:
99 p = "nested repeat operator"; break;
100 case ONIGERR_UNMATCHED_CLOSE_PARENTHESIS:
101 p = "unmatched close parenthesis"; break;
102 case ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS:
103 p = "end pattern with unmatched parenthesis"; break;
104 case ONIGERR_END_PATTERN_IN_GROUP:
105 p = "end pattern in group"; break;
106 case ONIGERR_UNDEFINED_GROUP_OPTION:
107 p = "undefined group option"; break;
108 case ONIGERR_INVALID_POSIX_BRACKET_TYPE:
109 p = "invalid POSIX bracket type"; break;
110 case ONIGERR_INVALID_LOOK_BEHIND_PATTERN:
111 p = "invalid pattern in look-behind"; break;
112 case ONIGERR_INVALID_REPEAT_RANGE_PATTERN:
113 p = "invalid repeat range {lower,upper}"; break;
114 case ONIGERR_INVALID_CONDITION_PATTERN:
115 p = "invalid conditional pattern"; break;
116 case ONIGERR_TOO_BIG_NUMBER:
117 p = "too big number"; break;
118 case ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE:
119 p = "too big number for repeat range"; break;
120 case ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE:
121 p = "upper is smaller than lower in repeat range"; break;
122 case ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS:
123 p = "empty range in char class"; break;
124 case ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE:
125 p = "mismatch multibyte code length in char-class range"; break;
126 case ONIGERR_TOO_MANY_MULTI_BYTE_RANGES:
127 p = "too many multibyte code ranges are specified"; break;
128 case ONIGERR_TOO_SHORT_MULTI_BYTE_STRING:
129 p = "too short multibyte code string"; break;
130 case ONIGERR_TOO_BIG_BACKREF_NUMBER:
131 p = "too big backref number"; break;
132 case ONIGERR_INVALID_BACKREF:
133 #ifdef USE_NAMED_GROUP
134 p = "invalid backref number/name"; break;
135 #else
136 p = "invalid backref number"; break;
137 #endif
138 case ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED:
139 p = "numbered backref/call is not allowed. (use name)"; break;
140 case ONIGERR_TOO_SHORT_DIGITS:
141 p = "too short digits"; break;
142 case ONIGERR_TOO_LONG_WIDE_CHAR_VALUE:
143 p = "too long wide-char value"; break;
144 case ONIGERR_EMPTY_GROUP_NAME:
145 p = "group name is empty"; break;
146 case ONIGERR_INVALID_GROUP_NAME:
147 p = "invalid group name <%n>"; break;
148 case ONIGERR_INVALID_CHAR_IN_GROUP_NAME:
149 #ifdef USE_NAMED_GROUP
150 p = "invalid char in group name <%n>"; break;
151 #else
152 p = "invalid char in group number <%n>"; break;
153 #endif
154 case ONIGERR_UNDEFINED_NAME_REFERENCE:
155 p = "undefined name <%n> reference"; break;
156 case ONIGERR_UNDEFINED_GROUP_REFERENCE:
157 p = "undefined group <%n> reference"; break;
158 case ONIGERR_MULTIPLEX_DEFINED_NAME:
159 p = "multiplex defined name <%n>"; break;
160 case ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL:
161 p = "multiplex definition name <%n> call"; break;
162 case ONIGERR_NEVER_ENDING_RECURSION:
163 p = "never ending recursion"; break;
164 case ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY:
165 p = "group number is too big for capture history"; break;
166 case ONIGERR_INVALID_CHAR_PROPERTY_NAME:
167 p = "invalid character property name {%n}"; break;
168 case ONIGERR_TOO_MANY_CAPTURE_GROUPS:
169 p = "too many capture groups are specified"; break;
170 case ONIGERR_INVALID_CODE_POINT_VALUE:
171 p = "invalid code point value"; break;
172 case ONIGERR_TOO_BIG_WIDE_CHAR_VALUE:
173 p = "too big wide-char value"; break;
174 case ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION:
175 p = "not supported encoding combination"; break;
176 case ONIGERR_INVALID_COMBINATION_OF_OPTIONS:
177 p = "invalid combination of options"; break;
178
179 default:
180 p = "undefined error code"; break;
181 }
182
183 return (UChar* )p;
184 }
185
186 static void sprint_byte(char* s, unsigned int v)
187 {
188 xsnprintf(s, 3, "%02x", (v & 0377));
189 }
190
191 static void sprint_byte_with_x(char* s, unsigned int v)
192 {
193 xsnprintf(s, 5, "\\x%02x", (v & 0377));
194 }
195
196 static int to_ascii(OnigEncoding enc, UChar *s, UChar *end,
197 UChar buf[], int buf_size, int *is_over)
198 {
199 int len;
200 UChar *p;
201 OnigCodePoint code;
202
203 if (ONIGENC_MBC_MINLEN(enc) > 1) {
204 p = s;
205 len = 0;
206 while (p < end) {
207 code = ONIGENC_MBC_TO_CODE(enc, p, end);
208 if (code >= 0x80) {
209 if (code > 0xffff && len + 10 <= buf_size) {
210 sprint_byte_with_x((char*)(&(buf[len])), (unsigned int)(code >> 24));
211 sprint_byte((char*)(&(buf[len+4])), (unsigned int)(code >> 16));
212 sprint_byte((char*)(&(buf[len+6])), (unsigned int)(code >> 8));
213 sprint_byte((char*)(&(buf[len+8])), (unsigned int)code);
214 len += 10;
215 }
216 else if (len + 6 <= buf_size) {
217 sprint_byte_with_x((char*)(&(buf[len])), (unsigned int)(code >> 8));
218 sprint_byte((char*)(&(buf[len+4])), (unsigned int)code);
219 len += 6;
220 }
221 else {
222 break;
223 }
224 }
225 else {
226 buf[len++] = (UChar )code;
227 }
228
229 p += enclen(enc, p, end);
230 if (len >= buf_size) break;
231 }
232
233 *is_over = ((p < end) ? 1 : 0);
234 }
235 else {
236 len = (int )MIN((end - s), buf_size);
237 xmemcpy(buf, s, (size_t )len);
238 *is_over = ((buf_size < (end - s)) ? 1 : 0);
239 }
240
241 return len;
242 }
243
244
245 /* < ONIG_MAX_ERROR_MESSAGE_LEN - max length of messages with %n */
246 #define MAX_ERROR_PAR_LEN 50
247
248 extern int
249 onig_error_code_to_str(UChar* s, OnigPosition code, ...)
250 {
251 UChar *p, *q;
252 OnigErrorInfo* einfo;
253 size_t len;
254 int is_over;
255 UChar parbuf[MAX_ERROR_PAR_LEN];
256 va_list vargs;
257
258 va_start(vargs, code);
259
260 switch (code) {
261 case ONIGERR_UNDEFINED_NAME_REFERENCE:
262 case ONIGERR_UNDEFINED_GROUP_REFERENCE:
263 case ONIGERR_MULTIPLEX_DEFINED_NAME:
264 case ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL:
265 case ONIGERR_INVALID_GROUP_NAME:
266 case ONIGERR_INVALID_CHAR_IN_GROUP_NAME:
267 case ONIGERR_INVALID_CHAR_PROPERTY_NAME:
268 einfo = va_arg(vargs, OnigErrorInfo*);
269 len = to_ascii(einfo->enc, einfo->par, einfo->par_end,
270 parbuf, MAX_ERROR_PAR_LEN - 3, &is_over);
271 q = onig_error_code_to_format(code);
272 p = s;
273 while (*q != '\0') {
274 if (*q == '%') {
275 q++;
276 if (*q == 'n') { /* '%n': name */
277 xmemcpy(p, parbuf, len);
278 p += len;
279 if (is_over != 0) {
280 xmemcpy(p, "...", 3);
281 p += 3;
282 }
283 q++;
284 }
285 else
286 goto normal_char;
287 }
288 else {
289 normal_char:
290 *p++ = *q++;
291 }
292 }
293 *p = '\0';
294 len = p - s;
295 break;
296
297 default:
298 q = onig_error_code_to_format(code);
299 if (q) {
300 len = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, q);
301 xmemcpy(s, q, len);
302 } else {
303 len = 0;
304 }
305 s[len] = '\0';
306 break;
307 }
308
309 va_end(vargs);
310 return (int )len;
311 }
312
313 void
314 onig_vsnprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,
315 UChar* pat, UChar* pat_end, const UChar *fmt, va_list args)
316 {
317 size_t need;
318 int n, len;
319 UChar *p, *s, *bp;
320 UChar bs[6];
321
322 n = xvsnprintf((char* )buf, bufsize, (const char* )fmt, args);
323
324 need = (pat_end - pat) * 4 + 4;
325
326 if (n + need < (size_t )bufsize) {
327 static const char sep[] = ": /";
328 memcpy((char* )buf + n, sep, sizeof(sep));
329 s = buf + onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, buf);
330
331 p = pat;
332 while (p < pat_end) {
333 if (ONIGENC_IS_MBC_HEAD(enc, p, pat_end)) {
334 len = enclen(enc, p, pat_end);
335 if (ONIGENC_MBC_MINLEN(enc) == 1) {
336 while (len-- > 0) *s++ = *p++;
337 }
338 else { /* for UTF16/32 */
339 int blen;
340
341 while (len-- > 0) {
342 sprint_byte_with_x((char* )bs, (unsigned int )(*p++));
343 blen = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, bs);
344 bp = bs;
345 while (blen-- > 0) *s++ = *bp++;
346 }
347 }
348 }
349 else if (*p == '\\') {
350 *s++ = *p++;
351 len = enclen(enc, p, pat_end);
352 while (len-- > 0) *s++ = *p++;
353 }
354 else if (*p == '/') {
355 *s++ = (unsigned char )'\\';
356 *s++ = *p++;
357 }
358 else if (!ONIGENC_IS_CODE_PRINT(enc, *p) &&
359 (!ONIGENC_IS_CODE_SPACE(enc, *p) ||
360 ONIGENC_IS_CODE_CNTRL(enc, *p))) {
361 sprint_byte_with_x((char* )bs, (unsigned int )(*p++));
362 len = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, bs);
363 bp = bs;
364 while (len-- > 0) *s++ = *bp++;
365 }
366 else {
367 *s++ = *p++;
368 }
369 }
370
371 *s++ = '/';
372 *s = '\0';
373 }
374 }
375
376 #if 0 /* unused */
377 void
378 onig_snprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,
379 UChar* pat, UChar* pat_end, const UChar *fmt, ...)
380 {
381 va_list args;
382 va_start(args, fmt);
383 onig_vsnprintf_with_pattern(buf, bufsize, enc,
384 pat, pat_end, fmt, args);
385 va_end(args);
386 }
387 #endif
ONIGERR_TOO_LONG_WIDE_CHAR_VALUE
#define ONIGERR_TOO_LONG_WIDE_CHAR_VALUE
Definition: onigmo.h:678
ONIGERR_INVALID_GROUP_NAME
#define ONIGERR_INVALID_GROUP_NAME
Definition: onigmo.h:680
ONIGERR_INVALID_ARGUMENT
#define ONIGERR_INVALID_ARGUMENT
Definition: onigmo.h:640
va_arg
#define va_arg(v, l)
Definition: rb_mjit_min_header-2.7.0.h:3980
ONIGERR_UNEXPECTED_BYTECODE
#define ONIGERR_UNEXPECTED_BYTECODE
Definition: onigmo.h:634
onig_snprintf_with_pattern
void onig_snprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc, UChar *pat, UChar *pat_end, const UChar *fmt,...)
ONIGENC_IS_CODE_SPACE
#define ONIGENC_IS_CODE_SPACE(enc, code)
Definition: onigmo.h:392
ONIGERR_UNDEFINED_NAME_REFERENCE
#define ONIGERR_UNDEFINED_NAME_REFERENCE
Definition: onigmo.h:682
ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS
#define ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS
Definition: onigmo.h:653
bp
#define bp()
Definition: internal.h:1445
ONIGERR_TOO_MANY_MULTI_BYTE_RANGES
#define ONIGERR_TOO_MANY_MULTI_BYTE_RANGES
Definition: onigmo.h:671
ONIGENC_MBC_MINLEN
#define ONIGENC_MBC_MINLEN(enc)
Definition: onigmo.h:364
ONIGERR_END_PATTERN_AT_META
#define ONIGERR_END_PATTERN_AT_META
Definition: onigmo.h:647
ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR
#define ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR
Definition: onigmo.h:638
ONIGERR_UNDEFINED_GROUP_REFERENCE
#define ONIGERR_UNDEFINED_GROUP_REFERENCE
Definition: onigmo.h:683
ONIGERR_NEVER_ENDING_RECURSION
#define ONIGERR_NEVER_ENDING_RECURSION
Definition: onigmo.h:686
ONIGERR_MATCH_STACK_LIMIT_OVER
#define ONIGERR_MATCH_STACK_LIMIT_OVER
Definition: onigmo.h:635
ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE
#define ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE
Definition: onigmo.h:651
ONIGERR_INVALID_POSIX_BRACKET_TYPE
#define ONIGERR_INVALID_POSIX_BRACKET_TYPE
Definition: onigmo.h:661
ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE
#define ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE
Definition: onigmo.h:667
onig_error_code_to_format
UChar * onig_error_code_to_format(OnigPosition code)
Definition: regerror.c:37
xmemcpy
#define xmemcpy
Definition: regint.h:202
OnigCodePoint
unsigned int OnigCodePoint
Definition: onigmo.h:80
int
__inline__ int
Definition: rb_mjit_min_header-2.7.0.h:2839
ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE
#define ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE
Definition: onigmo.h:670
ONIGERR_META_CODE_SYNTAX
#define ONIGERR_META_CODE_SYNTAX
Definition: onigmo.h:649
ONIGERR_INVALID_COMBINATION_OF_OPTIONS
#define ONIGERR_INVALID_COMBINATION_OF_OPTIONS
Definition: onigmo.h:693
ONIGERR_INVALID_BACKREF
#define ONIGERR_INVALID_BACKREF
Definition: onigmo.h:674
MAX_ERROR_PAR_LEN
#define MAX_ERROR_PAR_LEN
Definition: regerror.c:246
enclen
#define enclen(enc, p, e)
Definition: regenc.h:93
ONIGENC_IS_MBC_HEAD
#define ONIGENC_IS_MBC_HEAD(enc, p, e)
Definition: onigmo.h:319
ONIG_ENCODING_ASCII
#define ONIG_ENCODING_ASCII
Definition: onigmo.h:225
ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION
#define ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION
Definition: onigmo.h:692
ONIGERR_TOO_SHORT_MULTI_BYTE_STRING
#define ONIGERR_TOO_SHORT_MULTI_BYTE_STRING
Definition: onigmo.h:672
v
int VALUE v
Definition: rb_mjit_min_header-2.7.0.h:12332
xvsnprintf
#define xvsnprintf
Definition: regint.h:214
ONIGERR_END_PATTERN_AT_LEFT_BRACKET
#define ONIGERR_END_PATTERN_AT_LEFT_BRACKET
Definition: onigmo.h:643
memcpy
void * memcpy(void *__restrict, const void *__restrict, size_t)
ONIGERR_TOO_MANY_CAPTURE_GROUPS
#define ONIGERR_TOO_MANY_CAPTURE_GROUPS
Definition: onigmo.h:676
OnigErrorInfo::enc
OnigEncoding enc
Definition: onigmo.h:739
ONIGENC_IS_CODE_PRINT
#define ONIGENC_IS_CODE_PRINT(enc, code)
Definition: onigmo.h:378
ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE
#define ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE
Definition: onigmo.h:652
ONIGERR_STACK_BUG
#define ONIGERR_STACK_BUG
Definition: onigmo.h:632
ONIGERR_EMPTY_CHAR_CLASS
#define ONIGERR_EMPTY_CHAR_CLASS
Definition: onigmo.h:644
va_end
#define va_end(v)
Definition: rb_mjit_min_header-2.7.0.h:3979
ONIGERR_END_PATTERN_AT_LEFT_BRACE
#define ONIGERR_END_PATTERN_AT_LEFT_BRACE
Definition: onigmo.h:642
ONIGERR_TOO_BIG_BACKREF_NUMBER
#define ONIGERR_TOO_BIG_BACKREF_NUMBER
Definition: onigmo.h:673
ONIGENC_IS_CODE_CNTRL
#define ONIGENC_IS_CODE_CNTRL(enc, code)
Definition: onigmo.h:388
ONIGERR_END_PATTERN_AT_ESCAPE
#define ONIGERR_END_PATTERN_AT_ESCAPE
Definition: onigmo.h:646
ONIGERR_CONTROL_CODE_SYNTAX
#define ONIGERR_CONTROL_CODE_SYNTAX
Definition: onigmo.h:650
ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY
#define ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY
Definition: onigmo.h:687
OnigPosition
ptrdiff_t OnigPosition
Definition: onigmo.h:83
MIN
#define MIN(a, b)
Definition: ffi.c:30
OnigErrorInfo::par_end
OnigUChar * par_end
Definition: onigmo.h:741
ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS
#define ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS
Definition: onigmo.h:669
ONIGERR_DEFAULT_ENCODING_IS_NOT_SET
#define ONIGERR_DEFAULT_ENCODING_IS_NOT_SET
Definition: onigmo.h:637
ONIGERR_NESTED_REPEAT_OPERATOR
#define ONIGERR_NESTED_REPEAT_OPERATOR
Definition: onigmo.h:656
ONIGERR_PARSE_DEPTH_LIMIT_OVER
#define ONIGERR_PARSE_DEPTH_LIMIT_OVER
Definition: onigmo.h:636
onigenc_str_bytelen_null
ONIG_EXTERN int onigenc_str_bytelen_null(OnigEncoding enc, const OnigUChar *p)
onig_vsnprintf_with_pattern
void onig_vsnprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc, UChar *pat, UChar *pat_end, const UChar *fmt, va_list args)
Definition: regerror.c:314
ONIGERR_UNMATCHED_CLOSE_PARENTHESIS
#define ONIGERR_UNMATCHED_CLOSE_PARENTHESIS
Definition: onigmo.h:657
OnigEncoding
const typedef OnigEncodingType * OnigEncoding
Definition: onigmo.h:182
ONIGERR_END_PATTERN_AT_CONTROL
#define ONIGERR_END_PATTERN_AT_CONTROL
Definition: onigmo.h:648
ONIG_NO_SUPPORT_CONFIG
#define ONIG_NO_SUPPORT_CONFIG
Definition: onigmo.h:626
ONIGERR_PARSER_BUG
#define ONIGERR_PARSER_BUG
Definition: onigmo.h:631
ONIGERR_TOO_BIG_WIDE_CHAR_VALUE
#define ONIGERR_TOO_BIG_WIDE_CHAR_VALUE
Definition: onigmo.h:691
ONIG_MISMATCH
#define ONIG_MISMATCH
Definition: onigmo.h:625
ONIGERR_MULTIPLEX_DEFINED_NAME
#define ONIGERR_MULTIPLEX_DEFINED_NAME
Definition: onigmo.h:684
fmt
const VALUE int int int int int int VALUE char * fmt
Definition: rb_mjit_min_header-2.7.0.h:6462
ONIGERR_INVALID_REPEAT_RANGE_PATTERN
#define ONIGERR_INVALID_REPEAT_RANGE_PATTERN
Definition: onigmo.h:663
char
#define char
Definition: rb_mjit_min_header-2.7.0.h:2876
n
const char size_t n
Definition: rb_mjit_min_header-2.7.0.h:5456
buf
unsigned char buf[MIME_BUF_SIZE]
Definition: nkf.c:4322
UChar
#define UChar
Definition: onigmo.h:76
ONIGERR_INVALID_CODE_POINT_VALUE
#define ONIGERR_INVALID_CODE_POINT_VALUE
Definition: onigmo.h:689
ONIGERR_TOO_SHORT_DIGITS
#define ONIGERR_TOO_SHORT_DIGITS
Definition: onigmo.h:677
ONIGERR_TYPE_BUG
#define ONIGERR_TYPE_BUG
Definition: onigmo.h:630
ONIGERR_TOO_BIG_NUMBER
#define ONIGERR_TOO_BIG_NUMBER
Definition: onigmo.h:666
ONIGERR_MEMORY
#define ONIGERR_MEMORY
Definition: onigmo.h:629
OnigErrorInfo::par
OnigUChar * par
Definition: onigmo.h:740
regint.h
ONIGERR_INVALID_CHAR_IN_GROUP_NAME
#define ONIGERR_INVALID_CHAR_IN_GROUP_NAME
Definition: onigmo.h:681
ONIGERR_UNDEFINED_GROUP_OPTION
#define ONIGERR_UNDEFINED_GROUP_OPTION
Definition: onigmo.h:660
ONIGERR_INVALID_CONDITION_PATTERN
#define ONIGERR_INVALID_CONDITION_PATTERN
Definition: onigmo.h:664
ONIGERR_END_PATTERN_IN_GROUP
#define ONIGERR_END_PATTERN_IN_GROUP
Definition: onigmo.h:659
ONIGERR_EMPTY_GROUP_NAME
#define ONIGERR_EMPTY_GROUP_NAME
Definition: onigmo.h:679
ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS
#define ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS
Definition: onigmo.h:658
ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE
#define ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE
Definition: onigmo.h:668
len
uint8_t len
Definition: escape.c:17
ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED
#define ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED
Definition: onigmo.h:654
ONIGENC_MBC_TO_CODE
#define ONIGENC_MBC_TO_CODE(enc, p, end)
Definition: onigmo.h:366
va_start
#define va_start(v, l)
Definition: rb_mjit_min_header-2.7.0.h:3978
va_list
__gnuc_va_list va_list
Definition: rb_mjit_min_header-2.7.0.h:836
ONIGERR_PREMATURE_END_OF_CHAR_CLASS
#define ONIGERR_PREMATURE_END_OF_CHAR_CLASS
Definition: onigmo.h:645
ONIGERR_INVALID_CHAR_PROPERTY_NAME
#define ONIGERR_INVALID_CHAR_PROPERTY_NAME
Definition: onigmo.h:688
OnigErrorInfo
Definition: onigmo.h:738
ONIGERR_UNDEFINED_BYTECODE
#define ONIGERR_UNDEFINED_BYTECODE
Definition: onigmo.h:633
ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED
#define ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED
Definition: onigmo.h:675
ONIGERR_INVALID_LOOK_BEHIND_PATTERN
#define ONIGERR_INVALID_LOOK_BEHIND_PATTERN
Definition: onigmo.h:662
onig_error_code_to_str
int onig_error_code_to_str(UChar *s, OnigPosition code,...)
Definition: regerror.c:249
ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL
#define ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL
Definition: onigmo.h:685
xsnprintf
#define xsnprintf
Definition: regint.h:215
ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID
#define ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID
Definition: onigmo.h:655