]>
Commit | Line | Data |
---|---|---|
14b0e578 CS |
1 | #ifndef ONIGURUMA_H\r |
2 | #define ONIGURUMA_H\r | |
3 | /**********************************************************************\r | |
4 | oniguruma.h - Oniguruma (regular expression library)\r | |
5 | **********************************************************************/\r | |
6 | /*-\r | |
b26691c4 | 7 | * Copyright (c) 2002-2019 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>\r |
14b0e578 CS |
8 | * All rights reserved.\r |
9 | *\r | |
10 | * Redistribution and use in source and binary forms, with or without\r | |
11 | * modification, are permitted provided that the following conditions\r | |
12 | * are met:\r | |
13 | * 1. Redistributions of source code must retain the above copyright\r | |
14 | * notice, this list of conditions and the following disclaimer.\r | |
15 | * 2. Redistributions in binary form must reproduce the above copyright\r | |
16 | * notice, this list of conditions and the following disclaimer in the\r | |
17 | * documentation and/or other materials provided with the distribution.\r | |
18 | *\r | |
19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\r | |
20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r | |
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r | |
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\r | |
23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r | |
24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r | |
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r | |
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r | |
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r | |
28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r | |
29 | * SUCH DAMAGE.\r | |
30 | */\r | |
31 | \r | |
32 | #include "OnigurumaUefiPort.h"\r | |
33 | \r | |
34 | #ifdef __cplusplus\r | |
35 | extern "C" {\r | |
36 | #endif\r | |
37 | \r | |
38 | #define ONIGURUMA\r | |
b602265d | 39 | #define ONIGURUMA_VERSION_MAJOR 6\r |
14b0e578 | 40 | #define ONIGURUMA_VERSION_MINOR 9\r |
b26691c4 | 41 | #define ONIGURUMA_VERSION_TEENY 3\r |
14b0e578 | 42 | \r |
b26691c4 | 43 | #define ONIGURUMA_VERSION_INT 60903\r |
14b0e578 CS |
44 | \r |
45 | #ifndef P_\r | |
46 | #if defined(__STDC__) || defined(_WIN32)\r | |
47 | # define P_(args) args\r | |
48 | #else\r | |
49 | # define P_(args) ()\r | |
50 | #endif\r | |
51 | #endif\r | |
52 | \r | |
53 | #ifndef PV_\r | |
14b0e578 | 54 | # define PV_(args) args\r |
14b0e578 CS |
55 | #endif\r |
56 | \r | |
b26691c4 | 57 | #ifndef ONIG_STATIC\r |
14b0e578 CS |
58 | #ifndef ONIG_EXTERN\r |
59 | #if defined(_WIN32) && !defined(__GNUC__)\r | |
b602265d | 60 | #if defined(ONIGURUMA_EXPORT)\r |
14b0e578 CS |
61 | #define ONIG_EXTERN extern __declspec(dllexport)\r |
62 | #else\r | |
63 | #define ONIG_EXTERN extern __declspec(dllimport)\r | |
64 | #endif\r | |
65 | #endif\r | |
66 | #endif\r | |
67 | \r | |
68 | #ifndef ONIG_EXTERN\r | |
69 | #define ONIG_EXTERN extern\r | |
70 | #endif\r | |
b26691c4 LG |
71 | #else\r |
72 | #define ONIG_EXTERN extern\r | |
73 | #endif\r | |
14b0e578 CS |
74 | \r |
75 | /* PART: character encoding */\r | |
76 | \r | |
77 | #ifndef ONIG_ESCAPE_UCHAR_COLLISION\r | |
78 | #define UChar OnigUChar\r | |
79 | #endif\r | |
80 | \r | |
b602265d | 81 | typedef unsigned int OnigCodePoint;\r |
14b0e578 CS |
82 | typedef unsigned char OnigUChar;\r |
83 | typedef unsigned int OnigCtype;\r | |
b602265d | 84 | typedef unsigned int OnigLen;\r |
14b0e578 | 85 | \r |
b602265d | 86 | #define ONIG_INFINITE_DISTANCE ~((OnigLen )0)\r |
14b0e578 CS |
87 | \r |
88 | typedef unsigned int OnigCaseFoldType; /* case fold flag */\r | |
89 | \r | |
90 | ONIG_EXTERN OnigCaseFoldType OnigDefaultCaseFoldFlag;\r | |
91 | \r | |
92 | /* #define ONIGENC_CASE_FOLD_HIRAGANA_KATAKANA (1<<1) */\r | |
93 | /* #define ONIGENC_CASE_FOLD_KATAKANA_WIDTH (1<<2) */\r | |
94 | #define ONIGENC_CASE_FOLD_TURKISH_AZERI (1<<20)\r | |
95 | #define INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR (1<<30)\r | |
96 | \r | |
97 | #define ONIGENC_CASE_FOLD_MIN INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR\r | |
98 | #define ONIGENC_CASE_FOLD_DEFAULT OnigDefaultCaseFoldFlag\r | |
99 | \r | |
100 | \r | |
101 | #define ONIGENC_MAX_COMP_CASE_FOLD_CODE_LEN 3\r | |
102 | #define ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM 13\r | |
103 | /* 13 => Unicode:0x1ffc */\r | |
104 | \r | |
105 | /* code range */\r | |
106 | #define ONIGENC_CODE_RANGE_NUM(range) ((int )range[0])\r | |
107 | #define ONIGENC_CODE_RANGE_FROM(range,i) range[((i)*2) + 1]\r | |
108 | #define ONIGENC_CODE_RANGE_TO(range,i) range[((i)*2) + 2]\r | |
109 | \r | |
110 | typedef struct {\r | |
111 | int byte_len; /* argument(original) character(s) byte length */\r | |
112 | int code_len; /* number of code */\r | |
113 | OnigCodePoint code[ONIGENC_MAX_COMP_CASE_FOLD_CODE_LEN];\r | |
114 | } OnigCaseFoldCodeItem;\r | |
115 | \r | |
116 | typedef struct {\r | |
117 | OnigCodePoint esc;\r | |
118 | OnigCodePoint anychar;\r | |
119 | OnigCodePoint anytime;\r | |
120 | OnigCodePoint zero_or_one_time;\r | |
121 | OnigCodePoint one_or_more_time;\r | |
122 | OnigCodePoint anychar_anytime;\r | |
123 | } OnigMetaCharTableType;\r | |
b602265d | 124 | \r |
14b0e578 CS |
125 | typedef int (*OnigApplyAllCaseFoldFunc)(OnigCodePoint from, OnigCodePoint* to, int to_len, void* arg);\r |
126 | \r | |
127 | typedef struct OnigEncodingTypeST {\r | |
128 | int (*mbc_enc_len)(const OnigUChar* p);\r | |
129 | const char* name;\r | |
130 | int max_enc_len;\r | |
131 | int min_enc_len;\r | |
132 | int (*is_mbc_newline)(const OnigUChar* p, const OnigUChar* end);\r | |
133 | OnigCodePoint (*mbc_to_code)(const OnigUChar* p, const OnigUChar* end);\r | |
134 | int (*code_to_mbclen)(OnigCodePoint code);\r | |
135 | int (*code_to_mbc)(OnigCodePoint code, OnigUChar *buf);\r | |
136 | int (*mbc_case_fold)(OnigCaseFoldType flag, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to);\r | |
137 | int (*apply_all_case_fold)(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg);\r | |
138 | int (*get_case_fold_codes_by_str)(OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem acs[]);\r | |
139 | int (*property_name_to_ctype)(struct OnigEncodingTypeST* enc, OnigUChar* p, OnigUChar* end);\r | |
140 | int (*is_code_ctype)(OnigCodePoint code, OnigCtype ctype);\r | |
141 | int (*get_ctype_code_range)(OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[]);\r | |
142 | OnigUChar* (*left_adjust_char_head)(const OnigUChar* start, const OnigUChar* p);\r | |
143 | int (*is_allowed_reverse_match)(const OnigUChar* p, const OnigUChar* end);\r | |
b602265d DG |
144 | int (*init)(void);\r |
145 | int (*is_initialized)(void);\r | |
146 | int (*is_valid_mbc_string)(const OnigUChar* s, const OnigUChar* end);\r | |
147 | unsigned int flag;\r | |
148 | OnigCodePoint sb_range;\r | |
149 | int index;\r | |
14b0e578 CS |
150 | } OnigEncodingType;\r |
151 | \r | |
152 | typedef OnigEncodingType* OnigEncoding;\r | |
153 | \r | |
154 | ONIG_EXTERN OnigEncodingType OnigEncodingASCII;\r | |
155 | ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_1;\r | |
156 | ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_2;\r | |
157 | ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_3;\r | |
158 | ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_4;\r | |
159 | ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_5;\r | |
160 | ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_6;\r | |
161 | ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_7;\r | |
162 | ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_8;\r | |
163 | ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_9;\r | |
164 | ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_10;\r | |
165 | ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_11;\r | |
166 | ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_13;\r | |
167 | ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_14;\r | |
168 | ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_15;\r | |
169 | ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_16;\r | |
170 | ONIG_EXTERN OnigEncodingType OnigEncodingUTF8;\r | |
171 | ONIG_EXTERN OnigEncodingType OnigEncodingUTF16_BE;\r | |
172 | ONIG_EXTERN OnigEncodingType OnigEncodingUTF16_LE;\r | |
173 | ONIG_EXTERN OnigEncodingType OnigEncodingUTF32_BE;\r | |
174 | ONIG_EXTERN OnigEncodingType OnigEncodingUTF32_LE;\r | |
175 | ONIG_EXTERN OnigEncodingType OnigEncodingEUC_JP;\r | |
176 | ONIG_EXTERN OnigEncodingType OnigEncodingEUC_TW;\r | |
177 | ONIG_EXTERN OnigEncodingType OnigEncodingEUC_KR;\r | |
178 | ONIG_EXTERN OnigEncodingType OnigEncodingEUC_CN;\r | |
179 | ONIG_EXTERN OnigEncodingType OnigEncodingSJIS;\r | |
180 | ONIG_EXTERN OnigEncodingType OnigEncodingKOI8;\r | |
181 | ONIG_EXTERN OnigEncodingType OnigEncodingKOI8_R;\r | |
182 | ONIG_EXTERN OnigEncodingType OnigEncodingCP1251;\r | |
183 | ONIG_EXTERN OnigEncodingType OnigEncodingBIG5;\r | |
184 | ONIG_EXTERN OnigEncodingType OnigEncodingGB18030;\r | |
185 | \r | |
186 | #define ONIG_ENCODING_ASCII (&OnigEncodingASCII)\r | |
187 | #define ONIG_ENCODING_ISO_8859_1 (&OnigEncodingISO_8859_1)\r | |
188 | #define ONIG_ENCODING_ISO_8859_2 (&OnigEncodingISO_8859_2)\r | |
189 | #define ONIG_ENCODING_ISO_8859_3 (&OnigEncodingISO_8859_3)\r | |
190 | #define ONIG_ENCODING_ISO_8859_4 (&OnigEncodingISO_8859_4)\r | |
191 | #define ONIG_ENCODING_ISO_8859_5 (&OnigEncodingISO_8859_5)\r | |
192 | #define ONIG_ENCODING_ISO_8859_6 (&OnigEncodingISO_8859_6)\r | |
193 | #define ONIG_ENCODING_ISO_8859_7 (&OnigEncodingISO_8859_7)\r | |
194 | #define ONIG_ENCODING_ISO_8859_8 (&OnigEncodingISO_8859_8)\r | |
195 | #define ONIG_ENCODING_ISO_8859_9 (&OnigEncodingISO_8859_9)\r | |
196 | #define ONIG_ENCODING_ISO_8859_10 (&OnigEncodingISO_8859_10)\r | |
197 | #define ONIG_ENCODING_ISO_8859_11 (&OnigEncodingISO_8859_11)\r | |
198 | #define ONIG_ENCODING_ISO_8859_13 (&OnigEncodingISO_8859_13)\r | |
199 | #define ONIG_ENCODING_ISO_8859_14 (&OnigEncodingISO_8859_14)\r | |
200 | #define ONIG_ENCODING_ISO_8859_15 (&OnigEncodingISO_8859_15)\r | |
201 | #define ONIG_ENCODING_ISO_8859_16 (&OnigEncodingISO_8859_16)\r | |
202 | #define ONIG_ENCODING_UTF8 (&OnigEncodingUTF8)\r | |
203 | #define ONIG_ENCODING_UTF16_BE (&OnigEncodingUTF16_BE)\r | |
204 | #define ONIG_ENCODING_UTF16_LE (&OnigEncodingUTF16_LE)\r | |
205 | #define ONIG_ENCODING_UTF32_BE (&OnigEncodingUTF32_BE)\r | |
206 | #define ONIG_ENCODING_UTF32_LE (&OnigEncodingUTF32_LE)\r | |
207 | #define ONIG_ENCODING_EUC_JP (&OnigEncodingEUC_JP)\r | |
208 | #define ONIG_ENCODING_EUC_TW (&OnigEncodingEUC_TW)\r | |
209 | #define ONIG_ENCODING_EUC_KR (&OnigEncodingEUC_KR)\r | |
210 | #define ONIG_ENCODING_EUC_CN (&OnigEncodingEUC_CN)\r | |
211 | #define ONIG_ENCODING_SJIS (&OnigEncodingSJIS)\r | |
212 | #define ONIG_ENCODING_KOI8 (&OnigEncodingKOI8)\r | |
213 | #define ONIG_ENCODING_KOI8_R (&OnigEncodingKOI8_R)\r | |
214 | #define ONIG_ENCODING_CP1251 (&OnigEncodingCP1251)\r | |
215 | #define ONIG_ENCODING_BIG5 (&OnigEncodingBIG5)\r | |
216 | #define ONIG_ENCODING_GB18030 (&OnigEncodingGB18030)\r | |
217 | \r | |
218 | #define ONIG_ENCODING_UNDEF ((OnigEncoding )0)\r | |
219 | \r | |
220 | \r | |
221 | /* work size */\r | |
222 | #define ONIGENC_CODE_TO_MBC_MAXLEN 7\r | |
223 | #define ONIGENC_MBC_CASE_FOLD_MAXLEN 18\r | |
224 | /* 18: 6(max-byte) * 3(case-fold chars) */\r | |
225 | \r | |
226 | /* character types */\r | |
b602265d DG |
227 | typedef enum {\r |
228 | ONIGENC_CTYPE_NEWLINE = 0,\r | |
229 | ONIGENC_CTYPE_ALPHA = 1,\r | |
230 | ONIGENC_CTYPE_BLANK = 2,\r | |
231 | ONIGENC_CTYPE_CNTRL = 3,\r | |
232 | ONIGENC_CTYPE_DIGIT = 4,\r | |
233 | ONIGENC_CTYPE_GRAPH = 5,\r | |
234 | ONIGENC_CTYPE_LOWER = 6,\r | |
235 | ONIGENC_CTYPE_PRINT = 7,\r | |
236 | ONIGENC_CTYPE_PUNCT = 8,\r | |
237 | ONIGENC_CTYPE_SPACE = 9,\r | |
238 | ONIGENC_CTYPE_UPPER = 10,\r | |
239 | ONIGENC_CTYPE_XDIGIT = 11,\r | |
240 | ONIGENC_CTYPE_WORD = 12,\r | |
241 | ONIGENC_CTYPE_ALNUM = 13, /* alpha || digit */\r | |
242 | ONIGENC_CTYPE_ASCII = 14\r | |
243 | } OnigEncCtype;\r | |
244 | \r | |
14b0e578 CS |
245 | #define ONIGENC_MAX_STD_CTYPE ONIGENC_CTYPE_ASCII\r |
246 | \r | |
247 | \r | |
248 | #define onig_enc_len(enc,p,end) ONIGENC_MBC_ENC_LEN(enc,p)\r | |
249 | \r | |
250 | #define ONIGENC_IS_UNDEF(enc) ((enc) == ONIG_ENCODING_UNDEF)\r | |
251 | #define ONIGENC_IS_SINGLEBYTE(enc) (ONIGENC_MBC_MAXLEN(enc) == 1)\r | |
252 | #define ONIGENC_IS_MBC_HEAD(enc,p) (ONIGENC_MBC_ENC_LEN(enc,p) != 1)\r | |
253 | #define ONIGENC_IS_MBC_ASCII(p) (*(p) < 128)\r | |
254 | #define ONIGENC_IS_CODE_ASCII(code) ((code) < 128)\r | |
255 | #define ONIGENC_IS_MBC_WORD(enc,s,end) \\r | |
256 | ONIGENC_IS_CODE_WORD(enc,ONIGENC_MBC_TO_CODE(enc,s,end))\r | |
b602265d | 257 | #define ONIGENC_IS_MBC_WORD_ASCII(enc,s,end) onigenc_is_mbc_word_ascii(enc,s,end)\r |
14b0e578 CS |
258 | \r |
259 | #define ONIGENC_NAME(enc) ((enc)->name)\r | |
260 | \r | |
261 | #define ONIGENC_MBC_CASE_FOLD(enc,flag,pp,end,buf) \\r | |
262 | (enc)->mbc_case_fold(flag,(const OnigUChar** )pp,end,buf)\r | |
263 | #define ONIGENC_IS_ALLOWED_REVERSE_MATCH(enc,s,end) \\r | |
264 | (enc)->is_allowed_reverse_match(s,end)\r | |
265 | #define ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc,start,s) \\r | |
266 | (enc)->left_adjust_char_head(start, s)\r | |
b602265d DG |
267 | #define ONIGENC_IS_VALID_MBC_STRING(enc,s,end) \\r |
268 | (enc)->is_valid_mbc_string(s,end)\r | |
14b0e578 CS |
269 | #define ONIGENC_APPLY_ALL_CASE_FOLD(enc,case_fold_flag,f,arg) \\r |
270 | (enc)->apply_all_case_fold(case_fold_flag,f,arg)\r | |
271 | #define ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc,case_fold_flag,p,end,acs) \\r | |
272 | (enc)->get_case_fold_codes_by_str(case_fold_flag,p,end,acs)\r | |
273 | #define ONIGENC_STEP_BACK(enc,start,s,n) \\r | |
274 | onigenc_step_back((enc),(start),(s),(n))\r | |
275 | \r | |
276 | #define ONIGENC_MBC_ENC_LEN(enc,p) (enc)->mbc_enc_len(p)\r | |
277 | #define ONIGENC_MBC_MAXLEN(enc) ((enc)->max_enc_len)\r | |
278 | #define ONIGENC_MBC_MAXLEN_DIST(enc) ONIGENC_MBC_MAXLEN(enc)\r | |
279 | #define ONIGENC_MBC_MINLEN(enc) ((enc)->min_enc_len)\r | |
280 | #define ONIGENC_IS_MBC_NEWLINE(enc,p,end) (enc)->is_mbc_newline((p),(end))\r | |
281 | #define ONIGENC_MBC_TO_CODE(enc,p,end) (enc)->mbc_to_code((p),(end))\r | |
282 | #define ONIGENC_CODE_TO_MBCLEN(enc,code) (enc)->code_to_mbclen(code)\r | |
283 | #define ONIGENC_CODE_TO_MBC(enc,code,buf) (enc)->code_to_mbc(code,buf)\r | |
284 | #define ONIGENC_PROPERTY_NAME_TO_CTYPE(enc,p,end) \\r | |
285 | (enc)->property_name_to_ctype(enc,p,end)\r | |
286 | \r | |
287 | #define ONIGENC_IS_CODE_CTYPE(enc,code,ctype) (enc)->is_code_ctype(code,ctype)\r | |
288 | \r | |
289 | #define ONIGENC_IS_CODE_NEWLINE(enc,code) \\r | |
290 | ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_NEWLINE)\r | |
291 | #define ONIGENC_IS_CODE_GRAPH(enc,code) \\r | |
292 | ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_GRAPH)\r | |
293 | #define ONIGENC_IS_CODE_PRINT(enc,code) \\r | |
294 | ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_PRINT)\r | |
295 | #define ONIGENC_IS_CODE_ALNUM(enc,code) \\r | |
296 | ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_ALNUM)\r | |
297 | #define ONIGENC_IS_CODE_ALPHA(enc,code) \\r | |
298 | ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_ALPHA)\r | |
299 | #define ONIGENC_IS_CODE_LOWER(enc,code) \\r | |
300 | ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_LOWER)\r | |
301 | #define ONIGENC_IS_CODE_UPPER(enc,code) \\r | |
302 | ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_UPPER)\r | |
303 | #define ONIGENC_IS_CODE_CNTRL(enc,code) \\r | |
304 | ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_CNTRL)\r | |
305 | #define ONIGENC_IS_CODE_PUNCT(enc,code) \\r | |
306 | ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_PUNCT)\r | |
307 | #define ONIGENC_IS_CODE_SPACE(enc,code) \\r | |
308 | ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_SPACE)\r | |
309 | #define ONIGENC_IS_CODE_BLANK(enc,code) \\r | |
310 | ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_BLANK)\r | |
311 | #define ONIGENC_IS_CODE_DIGIT(enc,code) \\r | |
312 | ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_DIGIT)\r | |
313 | #define ONIGENC_IS_CODE_XDIGIT(enc,code) \\r | |
314 | ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_XDIGIT)\r | |
315 | #define ONIGENC_IS_CODE_WORD(enc,code) \\r | |
316 | ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_WORD)\r | |
317 | \r | |
318 | #define ONIGENC_GET_CTYPE_CODE_RANGE(enc,ctype,sbout,ranges) \\r | |
319 | (enc)->get_ctype_code_range(ctype,sbout,ranges)\r | |
320 | \r | |
321 | ONIG_EXTERN\r | |
322 | OnigUChar* onigenc_step_back P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, int n));\r | |
323 | \r | |
324 | \r | |
325 | /* encoding API */\r | |
326 | ONIG_EXTERN\r | |
327 | int onigenc_init P_((void));\r | |
328 | ONIG_EXTERN\r | |
b602265d DG |
329 | int onig_initialize_encoding P_((OnigEncoding enc));\r |
330 | ONIG_EXTERN\r | |
14b0e578 CS |
331 | int onigenc_set_default_encoding P_((OnigEncoding enc));\r |
332 | ONIG_EXTERN\r | |
333 | OnigEncoding onigenc_get_default_encoding P_((void));\r | |
334 | ONIG_EXTERN\r | |
335 | void onigenc_set_default_caseconv_table P_((const OnigUChar* table));\r | |
336 | ONIG_EXTERN\r | |
337 | OnigUChar* onigenc_get_right_adjust_char_head_with_prev P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar** prev));\r | |
338 | ONIG_EXTERN\r | |
339 | OnigUChar* onigenc_get_prev_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s));\r | |
340 | ONIG_EXTERN\r | |
341 | OnigUChar* onigenc_get_left_adjust_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s));\r | |
342 | ONIG_EXTERN\r | |
343 | OnigUChar* onigenc_get_right_adjust_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s));\r | |
344 | ONIG_EXTERN\r | |
345 | int onigenc_strlen P_((OnigEncoding enc, const OnigUChar* p, const OnigUChar* end));\r | |
346 | ONIG_EXTERN\r | |
347 | int onigenc_strlen_null P_((OnigEncoding enc, const OnigUChar* p));\r | |
348 | ONIG_EXTERN\r | |
349 | int onigenc_str_bytelen_null P_((OnigEncoding enc, const OnigUChar* p));\r | |
b602265d DG |
350 | ONIG_EXTERN\r |
351 | int onigenc_is_valid_mbc_string P_((OnigEncoding enc, const OnigUChar* s, const OnigUChar* end));\r | |
352 | ONIG_EXTERN\r | |
353 | OnigUChar* onigenc_strdup P_((OnigEncoding enc, const OnigUChar* s, const OnigUChar* end));\r | |
14b0e578 CS |
354 | \r |
355 | \r | |
356 | /* PART: regular expression */\r | |
357 | \r | |
358 | /* config parameters */\r | |
359 | #define ONIG_NREGION 10\r | |
b602265d | 360 | #define ONIG_MAX_CAPTURE_NUM 2147483647 /* 2**31 - 1 */\r |
14b0e578 CS |
361 | #define ONIG_MAX_BACKREF_NUM 1000\r |
362 | #define ONIG_MAX_REPEAT_NUM 100000\r | |
363 | #define ONIG_MAX_MULTI_BYTE_RANGES_NUM 10000\r | |
364 | /* constants */\r | |
365 | #define ONIG_MAX_ERROR_MESSAGE_LEN 90\r | |
366 | \r | |
367 | typedef unsigned int OnigOptionType;\r | |
368 | \r | |
369 | #define ONIG_OPTION_DEFAULT ONIG_OPTION_NONE\r | |
370 | \r | |
371 | /* options */\r | |
372 | #define ONIG_OPTION_NONE 0U\r | |
b602265d | 373 | /* options (compile time) */\r |
14b0e578 CS |
374 | #define ONIG_OPTION_IGNORECASE 1U\r |
375 | #define ONIG_OPTION_EXTEND (ONIG_OPTION_IGNORECASE << 1)\r | |
376 | #define ONIG_OPTION_MULTILINE (ONIG_OPTION_EXTEND << 1)\r | |
377 | #define ONIG_OPTION_SINGLELINE (ONIG_OPTION_MULTILINE << 1)\r | |
378 | #define ONIG_OPTION_FIND_LONGEST (ONIG_OPTION_SINGLELINE << 1)\r | |
379 | #define ONIG_OPTION_FIND_NOT_EMPTY (ONIG_OPTION_FIND_LONGEST << 1)\r | |
380 | #define ONIG_OPTION_NEGATE_SINGLELINE (ONIG_OPTION_FIND_NOT_EMPTY << 1)\r | |
381 | #define ONIG_OPTION_DONT_CAPTURE_GROUP (ONIG_OPTION_NEGATE_SINGLELINE << 1)\r | |
382 | #define ONIG_OPTION_CAPTURE_GROUP (ONIG_OPTION_DONT_CAPTURE_GROUP << 1)\r | |
383 | /* options (search time) */\r | |
b602265d DG |
384 | #define ONIG_OPTION_NOTBOL (ONIG_OPTION_CAPTURE_GROUP << 1)\r |
385 | #define ONIG_OPTION_NOTEOL (ONIG_OPTION_NOTBOL << 1)\r | |
386 | #define ONIG_OPTION_POSIX_REGION (ONIG_OPTION_NOTEOL << 1)\r | |
387 | #define ONIG_OPTION_CHECK_VALIDITY_OF_STRING (ONIG_OPTION_POSIX_REGION << 1)\r | |
388 | /* #define ONIG_OPTION_CRLF_AS_LINE_SEPARATOR (ONIG_OPTION_CHECK_VALIDITY_OF_STRING << 1) */\r | |
389 | /* options (compile time) */\r | |
390 | #define ONIG_OPTION_WORD_IS_ASCII (ONIG_OPTION_CHECK_VALIDITY_OF_STRING << 4)\r | |
391 | #define ONIG_OPTION_DIGIT_IS_ASCII (ONIG_OPTION_WORD_IS_ASCII << 1)\r | |
392 | #define ONIG_OPTION_SPACE_IS_ASCII (ONIG_OPTION_DIGIT_IS_ASCII << 1)\r | |
393 | #define ONIG_OPTION_POSIX_IS_ASCII (ONIG_OPTION_SPACE_IS_ASCII << 1)\r | |
b26691c4 LG |
394 | #define ONIG_OPTION_TEXT_SEGMENT_EXTENDED_GRAPHEME_CLUSTER (ONIG_OPTION_POSIX_IS_ASCII << 1)\r |
395 | #define ONIG_OPTION_TEXT_SEGMENT_WORD (ONIG_OPTION_TEXT_SEGMENT_EXTENDED_GRAPHEME_CLUSTER << 1)\r | |
b602265d | 396 | \r |
b26691c4 | 397 | #define ONIG_OPTION_MAXBIT ONIG_OPTION_TEXT_SEGMENT_WORD /* limit */\r |
14b0e578 CS |
398 | \r |
399 | #define ONIG_OPTION_ON(options,regopt) ((options) |= (regopt))\r | |
400 | #define ONIG_OPTION_OFF(options,regopt) ((options) &= ~(regopt))\r | |
401 | #define ONIG_IS_OPTION_ON(options,option) ((options) & (option))\r | |
402 | \r | |
403 | /* syntax */\r | |
404 | typedef struct {\r | |
405 | unsigned int op;\r | |
406 | unsigned int op2;\r | |
407 | unsigned int behavior;\r | |
408 | OnigOptionType options; /* default option */\r | |
409 | OnigMetaCharTableType meta_char_table;\r | |
410 | } OnigSyntaxType;\r | |
411 | \r | |
412 | ONIG_EXTERN OnigSyntaxType OnigSyntaxASIS;\r | |
413 | ONIG_EXTERN OnigSyntaxType OnigSyntaxPosixBasic;\r | |
414 | ONIG_EXTERN OnigSyntaxType OnigSyntaxPosixExtended;\r | |
415 | ONIG_EXTERN OnigSyntaxType OnigSyntaxEmacs;\r | |
416 | ONIG_EXTERN OnigSyntaxType OnigSyntaxGrep;\r | |
417 | ONIG_EXTERN OnigSyntaxType OnigSyntaxGnuRegex;\r | |
418 | ONIG_EXTERN OnigSyntaxType OnigSyntaxJava;\r | |
419 | ONIG_EXTERN OnigSyntaxType OnigSyntaxPerl;\r | |
420 | ONIG_EXTERN OnigSyntaxType OnigSyntaxPerl_NG;\r | |
421 | ONIG_EXTERN OnigSyntaxType OnigSyntaxRuby;\r | |
b602265d | 422 | ONIG_EXTERN OnigSyntaxType OnigSyntaxOniguruma;\r |
14b0e578 CS |
423 | \r |
424 | /* predefined syntaxes (see regsyntax.c) */\r | |
425 | #define ONIG_SYNTAX_ASIS (&OnigSyntaxASIS)\r | |
426 | #define ONIG_SYNTAX_POSIX_BASIC (&OnigSyntaxPosixBasic)\r | |
427 | #define ONIG_SYNTAX_POSIX_EXTENDED (&OnigSyntaxPosixExtended)\r | |
428 | #define ONIG_SYNTAX_EMACS (&OnigSyntaxEmacs)\r | |
429 | #define ONIG_SYNTAX_GREP (&OnigSyntaxGrep)\r | |
430 | #define ONIG_SYNTAX_GNU_REGEX (&OnigSyntaxGnuRegex)\r | |
431 | #define ONIG_SYNTAX_JAVA (&OnigSyntaxJava)\r | |
432 | #define ONIG_SYNTAX_PERL (&OnigSyntaxPerl)\r | |
433 | #define ONIG_SYNTAX_PERL_NG (&OnigSyntaxPerl_NG)\r | |
434 | #define ONIG_SYNTAX_RUBY (&OnigSyntaxRuby)\r | |
b602265d | 435 | #define ONIG_SYNTAX_ONIGURUMA (&OnigSyntaxOniguruma)\r |
14b0e578 CS |
436 | \r |
437 | /* default syntax */\r | |
438 | ONIG_EXTERN OnigSyntaxType* OnigDefaultSyntax;\r | |
439 | #define ONIG_SYNTAX_DEFAULT OnigDefaultSyntax\r | |
440 | \r | |
441 | /* syntax (operators) */\r | |
442 | #define ONIG_SYN_OP_VARIABLE_META_CHARACTERS (1U<<0)\r | |
443 | #define ONIG_SYN_OP_DOT_ANYCHAR (1U<<1) /* . */\r | |
444 | #define ONIG_SYN_OP_ASTERISK_ZERO_INF (1U<<2) /* * */\r | |
445 | #define ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF (1U<<3)\r | |
446 | #define ONIG_SYN_OP_PLUS_ONE_INF (1U<<4) /* + */\r | |
447 | #define ONIG_SYN_OP_ESC_PLUS_ONE_INF (1U<<5)\r | |
448 | #define ONIG_SYN_OP_QMARK_ZERO_ONE (1U<<6) /* ? */\r | |
449 | #define ONIG_SYN_OP_ESC_QMARK_ZERO_ONE (1U<<7)\r | |
450 | #define ONIG_SYN_OP_BRACE_INTERVAL (1U<<8) /* {lower,upper} */\r | |
451 | #define ONIG_SYN_OP_ESC_BRACE_INTERVAL (1U<<9) /* \{lower,upper\} */\r | |
452 | #define ONIG_SYN_OP_VBAR_ALT (1U<<10) /* | */\r | |
453 | #define ONIG_SYN_OP_ESC_VBAR_ALT (1U<<11) /* \| */\r | |
454 | #define ONIG_SYN_OP_LPAREN_SUBEXP (1U<<12) /* (...) */\r | |
455 | #define ONIG_SYN_OP_ESC_LPAREN_SUBEXP (1U<<13) /* \(...\) */\r | |
456 | #define ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR (1U<<14) /* \A, \Z, \z */\r | |
457 | #define ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR (1U<<15) /* \G */\r | |
458 | #define ONIG_SYN_OP_DECIMAL_BACKREF (1U<<16) /* \num */\r | |
459 | #define ONIG_SYN_OP_BRACKET_CC (1U<<17) /* [...] */\r | |
460 | #define ONIG_SYN_OP_ESC_W_WORD (1U<<18) /* \w, \W */\r | |
461 | #define ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END (1U<<19) /* \<. \> */\r | |
462 | #define ONIG_SYN_OP_ESC_B_WORD_BOUND (1U<<20) /* \b, \B */\r | |
463 | #define ONIG_SYN_OP_ESC_S_WHITE_SPACE (1U<<21) /* \s, \S */\r | |
464 | #define ONIG_SYN_OP_ESC_D_DIGIT (1U<<22) /* \d, \D */\r | |
465 | #define ONIG_SYN_OP_LINE_ANCHOR (1U<<23) /* ^, $ */\r | |
466 | #define ONIG_SYN_OP_POSIX_BRACKET (1U<<24) /* [:xxxx:] */\r | |
467 | #define ONIG_SYN_OP_QMARK_NON_GREEDY (1U<<25) /* ??,*?,+?,{n,m}? */\r | |
468 | #define ONIG_SYN_OP_ESC_CONTROL_CHARS (1U<<26) /* \n,\r,\t,\a ... */\r | |
469 | #define ONIG_SYN_OP_ESC_C_CONTROL (1U<<27) /* \cx */\r | |
470 | #define ONIG_SYN_OP_ESC_OCTAL3 (1U<<28) /* \OOO */\r | |
471 | #define ONIG_SYN_OP_ESC_X_HEX2 (1U<<29) /* \xHH */\r | |
472 | #define ONIG_SYN_OP_ESC_X_BRACE_HEX8 (1U<<30) /* \x{7HHHHHHH} */\r | |
b602265d | 473 | #define ONIG_SYN_OP_ESC_O_BRACE_OCTAL (1U<<31) /* \o{1OOOOOOOOOO} */\r |
14b0e578 CS |
474 | \r |
475 | #define ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE (1U<<0) /* \Q...\E */\r | |
476 | #define ONIG_SYN_OP2_QMARK_GROUP_EFFECT (1U<<1) /* (?...) */\r | |
477 | #define ONIG_SYN_OP2_OPTION_PERL (1U<<2) /* (?imsx),(?-imsx) */\r | |
478 | #define ONIG_SYN_OP2_OPTION_RUBY (1U<<3) /* (?imx), (?-imx) */\r | |
479 | #define ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT (1U<<4) /* ?+,*+,++ */\r | |
480 | #define ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL (1U<<5) /* {n,m}+ */\r | |
481 | #define ONIG_SYN_OP2_CCLASS_SET_OP (1U<<6) /* [...&&..[..]..] */\r | |
482 | #define ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP (1U<<7) /* (?<name>...) */\r | |
483 | #define ONIG_SYN_OP2_ESC_K_NAMED_BACKREF (1U<<8) /* \k<name> */\r | |
484 | #define ONIG_SYN_OP2_ESC_G_SUBEXP_CALL (1U<<9) /* \g<name>, \g<n> */\r | |
485 | #define ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY (1U<<10) /* (?@..),(?@<x>..) */\r | |
486 | #define ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL (1U<<11) /* \C-x */\r | |
487 | #define ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META (1U<<12) /* \M-x */\r | |
488 | #define ONIG_SYN_OP2_ESC_V_VTAB (1U<<13) /* \v as VTAB */\r | |
489 | #define ONIG_SYN_OP2_ESC_U_HEX4 (1U<<14) /* \uHHHH */\r | |
490 | #define ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR (1U<<15) /* \`, \' */\r | |
491 | #define ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY (1U<<16) /* \p{...}, \P{...} */\r | |
492 | #define ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT (1U<<17) /* \p{^..}, \P{^..} */\r | |
493 | /* #define ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS (1U<<18) */\r | |
494 | #define ONIG_SYN_OP2_ESC_H_XDIGIT (1U<<19) /* \h, \H */\r | |
495 | #define ONIG_SYN_OP2_INEFFECTIVE_ESCAPE (1U<<20) /* \ */\r | |
b602265d DG |
496 | #define ONIG_SYN_OP2_QMARK_LPAREN_IF_ELSE (1U<<21) /* (?(n)) (?(...)...|...) */\r |
497 | #define ONIG_SYN_OP2_ESC_CAPITAL_K_KEEP (1U<<22) /* \K */\r | |
498 | #define ONIG_SYN_OP2_ESC_CAPITAL_R_GENERAL_NEWLINE (1U<<23) /* \R \r\n else [\x0a-\x0d] */\r | |
499 | #define ONIG_SYN_OP2_ESC_CAPITAL_N_O_SUPER_DOT (1U<<24) /* \N (?-m:.), \O (?m:.) */\r | |
500 | #define ONIG_SYN_OP2_QMARK_TILDE_ABSENT_GROUP (1U<<25) /* (?~...) */\r | |
b26691c4 LG |
501 | #define ONIG_SYN_OP2_ESC_X_Y_GRAPHEME_CLUSTER (1U<<26) /* obsoleted: use next */\r |
502 | #define ONIG_SYN_OP2_ESC_X_Y_TEXT_SEGMENT (1U<<26) /* \X \y \Y */\r | |
b602265d DG |
503 | #define ONIG_SYN_OP2_QMARK_PERL_SUBEXP_CALL (1U<<27) /* (?R), (?&name)... */\r |
504 | #define ONIG_SYN_OP2_QMARK_BRACE_CALLOUT_CONTENTS (1U<<28) /* (?{...}) (?{{...}}) */\r | |
505 | #define ONIG_SYN_OP2_ASTERISK_CALLOUT_NAME (1U<<29) /* (*name) (*name{a,..}) */\r | |
b26691c4 | 506 | #define ONIG_SYN_OP2_OPTION_ONIGURUMA (1U<<30) /* (?imxWDSPy) */\r |
14b0e578 CS |
507 | \r |
508 | /* syntax (behavior) */\r | |
509 | #define ONIG_SYN_CONTEXT_INDEP_ANCHORS (1U<<31) /* not implemented */\r | |
510 | #define ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS (1U<<0) /* ?, *, +, {n,m} */\r | |
511 | #define ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS (1U<<1) /* error or ignore */\r | |
512 | #define ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP (1U<<2) /* ...)... */\r | |
513 | #define ONIG_SYN_ALLOW_INVALID_INTERVAL (1U<<3) /* {??? */\r | |
514 | #define ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV (1U<<4) /* {,n} => {0,n} */\r | |
515 | #define ONIG_SYN_STRICT_CHECK_BACKREF (1U<<5) /* /(\1)/,/\1()/ ..*/\r | |
516 | #define ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND (1U<<6) /* (?<=a|bc) */\r | |
517 | #define ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP (1U<<7) /* see doc/RE */\r | |
518 | #define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME (1U<<8) /* (?<x>)(?<x>) */\r | |
519 | #define ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY (1U<<9) /* a{n}?=(?:a{n})? */\r | |
520 | \r | |
521 | /* syntax (behavior) in char class [...] */\r | |
522 | #define ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC (1U<<20) /* [^...] */\r | |
523 | #define ONIG_SYN_BACKSLASH_ESCAPE_IN_CC (1U<<21) /* [..\w..] etc.. */\r | |
524 | #define ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC (1U<<22)\r | |
525 | #define ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC (1U<<23) /* [0-9-a]=[0-9\-a] */\r | |
b26691c4 | 526 | #define ONIG_SYN_ALLOW_INVALID_CODE_END_OF_RANGE_IN_CC (1U<<26)\r |
14b0e578 CS |
527 | /* syntax (behavior) warning */\r |
528 | #define ONIG_SYN_WARN_CC_OP_NOT_ESCAPED (1U<<24) /* [,-,] */\r | |
529 | #define ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT (1U<<25) /* (?:a*)+ */\r | |
530 | \r | |
531 | /* meta character specifiers (onig_set_meta_char()) */\r | |
532 | #define ONIG_META_CHAR_ESCAPE 0\r | |
533 | #define ONIG_META_CHAR_ANYCHAR 1\r | |
534 | #define ONIG_META_CHAR_ANYTIME 2\r | |
535 | #define ONIG_META_CHAR_ZERO_OR_ONE_TIME 3\r | |
536 | #define ONIG_META_CHAR_ONE_OR_MORE_TIME 4\r | |
537 | #define ONIG_META_CHAR_ANYCHAR_ANYTIME 5\r | |
538 | \r | |
539 | #define ONIG_INEFFECTIVE_META_CHAR 0\r | |
540 | \r | |
541 | /* error codes */\r | |
542 | #define ONIG_IS_PATTERN_ERROR(ecode) ((ecode) <= -100 && (ecode) > -1000)\r | |
543 | /* normal return */\r | |
544 | #define ONIG_NORMAL 0\r | |
545 | #define ONIG_MISMATCH -1\r | |
546 | #define ONIG_NO_SUPPORT_CONFIG -2\r | |
b602265d | 547 | #define ONIG_ABORT -3\r |
14b0e578 CS |
548 | \r |
549 | /* internal error */\r | |
550 | #define ONIGERR_MEMORY -5\r | |
551 | #define ONIGERR_TYPE_BUG -6\r | |
552 | #define ONIGERR_PARSER_BUG -11\r | |
553 | #define ONIGERR_STACK_BUG -12\r | |
554 | #define ONIGERR_UNDEFINED_BYTECODE -13\r | |
555 | #define ONIGERR_UNEXPECTED_BYTECODE -14\r | |
556 | #define ONIGERR_MATCH_STACK_LIMIT_OVER -15\r | |
b602265d DG |
557 | #define ONIGERR_PARSE_DEPTH_LIMIT_OVER -16\r |
558 | #define ONIGERR_RETRY_LIMIT_IN_MATCH_OVER -17\r | |
14b0e578 CS |
559 | #define ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED -21\r |
560 | #define ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR -22\r | |
b602265d | 561 | #define ONIGERR_FAIL_TO_INITIALIZE -23\r |
14b0e578 | 562 | /* general error */\r |
b602265d | 563 | #define ONIGERR_INVALID_ARGUMENT -30\r |
14b0e578 CS |
564 | /* syntax error */\r |
565 | #define ONIGERR_END_PATTERN_AT_LEFT_BRACE -100\r | |
566 | #define ONIGERR_END_PATTERN_AT_LEFT_BRACKET -101\r | |
567 | #define ONIGERR_EMPTY_CHAR_CLASS -102\r | |
568 | #define ONIGERR_PREMATURE_END_OF_CHAR_CLASS -103\r | |
569 | #define ONIGERR_END_PATTERN_AT_ESCAPE -104\r | |
570 | #define ONIGERR_END_PATTERN_AT_META -105\r | |
571 | #define ONIGERR_END_PATTERN_AT_CONTROL -106\r | |
572 | #define ONIGERR_META_CODE_SYNTAX -108\r | |
573 | #define ONIGERR_CONTROL_CODE_SYNTAX -109\r | |
574 | #define ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE -110\r | |
575 | #define ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE -111\r | |
576 | #define ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS -112\r | |
577 | #define ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED -113\r | |
578 | #define ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID -114\r | |
579 | #define ONIGERR_NESTED_REPEAT_OPERATOR -115\r | |
580 | #define ONIGERR_UNMATCHED_CLOSE_PARENTHESIS -116\r | |
581 | #define ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS -117\r | |
582 | #define ONIGERR_END_PATTERN_IN_GROUP -118\r | |
583 | #define ONIGERR_UNDEFINED_GROUP_OPTION -119\r | |
584 | #define ONIGERR_INVALID_POSIX_BRACKET_TYPE -121\r | |
585 | #define ONIGERR_INVALID_LOOK_BEHIND_PATTERN -122\r | |
586 | #define ONIGERR_INVALID_REPEAT_RANGE_PATTERN -123\r | |
587 | /* values error (syntax error) */\r | |
588 | #define ONIGERR_TOO_BIG_NUMBER -200\r | |
589 | #define ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE -201\r | |
590 | #define ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE -202\r | |
591 | #define ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS -203\r | |
592 | #define ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE -204\r | |
593 | #define ONIGERR_TOO_MANY_MULTI_BYTE_RANGES -205\r | |
594 | #define ONIGERR_TOO_SHORT_MULTI_BYTE_STRING -206\r | |
595 | #define ONIGERR_TOO_BIG_BACKREF_NUMBER -207\r | |
596 | #define ONIGERR_INVALID_BACKREF -208\r | |
597 | #define ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED -209\r | |
b602265d | 598 | #define ONIGERR_TOO_MANY_CAPTURES -210\r |
14b0e578 CS |
599 | #define ONIGERR_TOO_LONG_WIDE_CHAR_VALUE -212\r |
600 | #define ONIGERR_EMPTY_GROUP_NAME -214\r | |
601 | #define ONIGERR_INVALID_GROUP_NAME -215\r | |
602 | #define ONIGERR_INVALID_CHAR_IN_GROUP_NAME -216\r | |
603 | #define ONIGERR_UNDEFINED_NAME_REFERENCE -217\r | |
604 | #define ONIGERR_UNDEFINED_GROUP_REFERENCE -218\r | |
605 | #define ONIGERR_MULTIPLEX_DEFINED_NAME -219\r | |
606 | #define ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL -220\r | |
607 | #define ONIGERR_NEVER_ENDING_RECURSION -221\r | |
608 | #define ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY -222\r | |
609 | #define ONIGERR_INVALID_CHAR_PROPERTY_NAME -223\r | |
b602265d DG |
610 | #define ONIGERR_INVALID_IF_ELSE_SYNTAX -224\r |
611 | #define ONIGERR_INVALID_ABSENT_GROUP_PATTERN -225\r | |
612 | #define ONIGERR_INVALID_ABSENT_GROUP_GENERATOR_PATTERN -226\r | |
613 | #define ONIGERR_INVALID_CALLOUT_PATTERN -227\r | |
614 | #define ONIGERR_INVALID_CALLOUT_NAME -228\r | |
615 | #define ONIGERR_UNDEFINED_CALLOUT_NAME -229\r | |
616 | #define ONIGERR_INVALID_CALLOUT_BODY -230\r | |
617 | #define ONIGERR_INVALID_CALLOUT_TAG_NAME -231\r | |
618 | #define ONIGERR_INVALID_CALLOUT_ARG -232\r | |
14b0e578 CS |
619 | #define ONIGERR_INVALID_CODE_POINT_VALUE -400\r |
620 | #define ONIGERR_INVALID_WIDE_CHAR_VALUE -400\r | |
621 | #define ONIGERR_TOO_BIG_WIDE_CHAR_VALUE -401\r | |
622 | #define ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION -402\r | |
623 | #define ONIGERR_INVALID_COMBINATION_OF_OPTIONS -403\r | |
b602265d DG |
624 | #define ONIGERR_TOO_MANY_USER_DEFINED_OBJECTS -404\r |
625 | #define ONIGERR_TOO_LONG_PROPERTY_NAME -405\r | |
626 | #define ONIGERR_LIBRARY_IS_NOT_INITIALIZED -500\r | |
14b0e578 CS |
627 | \r |
628 | /* errors related to thread */\r | |
b602265d | 629 | /* #define ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT -1001 */\r |
14b0e578 CS |
630 | \r |
631 | \r | |
b602265d | 632 | /* must be smaller than MEM_STATUS_BITS_NUM (unsigned int * 8) */\r |
14b0e578 CS |
633 | #define ONIG_MAX_CAPTURE_HISTORY_GROUP 31\r |
634 | #define ONIG_IS_CAPTURE_HISTORY_GROUP(r, i) \\r | |
635 | ((i) <= ONIG_MAX_CAPTURE_HISTORY_GROUP && (r)->list && (r)->list[i])\r | |
636 | \r | |
637 | typedef struct OnigCaptureTreeNodeStruct {\r | |
638 | int group; /* group number */\r | |
639 | int beg;\r | |
640 | int end;\r | |
641 | int allocated;\r | |
642 | int num_childs;\r | |
643 | struct OnigCaptureTreeNodeStruct** childs;\r | |
644 | } OnigCaptureTreeNode;\r | |
645 | \r | |
646 | /* match result region type */\r | |
647 | struct re_registers {\r | |
648 | int allocated;\r | |
649 | int num_regs;\r | |
650 | int* beg;\r | |
651 | int* end;\r | |
652 | /* extended */\r | |
653 | OnigCaptureTreeNode* history_root; /* capture history tree root */\r | |
654 | };\r | |
655 | \r | |
656 | /* capture tree traverse */\r | |
657 | #define ONIG_TRAVERSE_CALLBACK_AT_FIRST 1\r | |
658 | #define ONIG_TRAVERSE_CALLBACK_AT_LAST 2\r | |
659 | #define ONIG_TRAVERSE_CALLBACK_AT_BOTH \\r | |
660 | ( ONIG_TRAVERSE_CALLBACK_AT_FIRST | ONIG_TRAVERSE_CALLBACK_AT_LAST )\r | |
661 | \r | |
662 | \r | |
663 | #define ONIG_REGION_NOTPOS -1\r | |
664 | \r | |
665 | typedef struct re_registers OnigRegion;\r | |
666 | \r | |
667 | typedef struct {\r | |
668 | OnigEncoding enc;\r | |
669 | OnigUChar* par;\r | |
670 | OnigUChar* par_end;\r | |
671 | } OnigErrorInfo;\r | |
672 | \r | |
673 | typedef struct {\r | |
674 | int lower;\r | |
675 | int upper;\r | |
676 | } OnigRepeatRange;\r | |
677 | \r | |
678 | typedef void (*OnigWarnFunc) P_((const char* s));\r | |
679 | extern void onig_null_warn P_((const char* s));\r | |
680 | #define ONIG_NULL_WARN onig_null_warn\r | |
681 | \r | |
682 | #define ONIG_CHAR_TABLE_SIZE 256\r | |
683 | \r | |
b602265d DG |
684 | struct re_pattern_buffer;\r |
685 | typedef struct re_pattern_buffer OnigRegexType;\r | |
14b0e578 CS |
686 | typedef OnigRegexType* OnigRegex;\r |
687 | \r | |
688 | #ifndef ONIG_ESCAPE_REGEX_T_COLLISION\r | |
689 | typedef OnigRegexType regex_t;\r | |
690 | #endif\r | |
691 | \r | |
692 | \r | |
693 | typedef struct {\r | |
694 | int num_of_elements;\r | |
695 | OnigEncoding pattern_enc;\r | |
696 | OnigEncoding target_enc;\r | |
697 | OnigSyntaxType* syntax;\r | |
698 | OnigOptionType option;\r | |
699 | OnigCaseFoldType case_fold_flag;\r | |
700 | } OnigCompileInfo;\r | |
701 | \r | |
b602265d DG |
702 | \r |
703 | /* types for callout */\r | |
704 | typedef enum {\r | |
705 | ONIG_CALLOUT_IN_PROGRESS = 1, /* 1<<0 */\r | |
706 | ONIG_CALLOUT_IN_RETRACTION = 2 /* 1<<1 */\r | |
707 | } OnigCalloutIn;\r | |
708 | \r | |
709 | #define ONIG_CALLOUT_IN_BOTH (ONIG_CALLOUT_IN_PROGRESS | ONIG_CALLOUT_IN_RETRACTION)\r | |
710 | \r | |
711 | typedef enum {\r | |
712 | ONIG_CALLOUT_OF_CONTENTS = 0,\r | |
713 | ONIG_CALLOUT_OF_NAME = 1\r | |
714 | } OnigCalloutOf;\r | |
715 | \r | |
716 | typedef enum {\r | |
717 | ONIG_CALLOUT_TYPE_SINGLE = 0,\r | |
718 | ONIG_CALLOUT_TYPE_START_CALL = 1,\r | |
719 | ONIG_CALLOUT_TYPE_BOTH_CALL = 2,\r | |
720 | ONIG_CALLOUT_TYPE_START_MARK_END_CALL = 3,\r | |
721 | } OnigCalloutType;\r | |
722 | \r | |
723 | \r | |
724 | #define ONIG_NON_NAME_ID -1\r | |
725 | #define ONIG_NON_CALLOUT_NUM 0\r | |
726 | \r | |
727 | #define ONIG_CALLOUT_MAX_ARGS_NUM 4\r | |
728 | #define ONIG_CALLOUT_DATA_SLOT_NUM 5\r | |
729 | \r | |
730 | struct OnigCalloutArgsStruct;\r | |
731 | typedef struct OnigCalloutArgsStruct OnigCalloutArgs;\r | |
732 | \r | |
733 | typedef int (*OnigCalloutFunc)(OnigCalloutArgs* args, void* user_data);\r | |
734 | \r | |
735 | /* callout function return values (less than -1: error code) */\r | |
736 | typedef enum {\r | |
737 | ONIG_CALLOUT_FAIL = 1,\r | |
738 | ONIG_CALLOUT_SUCCESS = 0\r | |
739 | } OnigCalloutResult;\r | |
740 | \r | |
741 | typedef enum {\r | |
742 | ONIG_TYPE_VOID = 0,\r | |
743 | ONIG_TYPE_LONG = 1<<0,\r | |
744 | ONIG_TYPE_CHAR = 1<<1,\r | |
745 | ONIG_TYPE_STRING = 1<<2,\r | |
746 | ONIG_TYPE_POINTER = 1<<3,\r | |
747 | ONIG_TYPE_TAG = 1<<4,\r | |
748 | } OnigType;\r | |
749 | \r | |
750 | typedef union {\r | |
751 | long l;\r | |
752 | OnigCodePoint c;\r | |
753 | struct {\r | |
754 | OnigUChar* start;\r | |
755 | OnigUChar* end;\r | |
756 | } s;\r | |
757 | void* p;\r | |
758 | int tag; /* tag -> callout_num */\r | |
759 | } OnigValue;\r | |
760 | \r | |
761 | \r | |
762 | struct OnigMatchParamStruct;\r | |
763 | typedef struct OnigMatchParamStruct OnigMatchParam;\r | |
764 | \r | |
765 | \r | |
14b0e578 | 766 | /* Oniguruma Native API */\r |
b602265d DG |
767 | \r |
768 | ONIG_EXTERN\r | |
769 | int onig_initialize P_((OnigEncoding encodings[], int number_of_encodings));\r | |
770 | /* onig_init(): deprecated function. Use onig_initialize(). */\r | |
14b0e578 CS |
771 | ONIG_EXTERN\r |
772 | int onig_init P_((void));\r | |
773 | ONIG_EXTERN\r | |
a12b214e | 774 | int EFIAPI onig_error_code_to_str PV_((OnigUChar* s, int err_code, ...));\r |
14b0e578 | 775 | ONIG_EXTERN\r |
b26691c4 LG |
776 | int onig_is_error_code_needs_param PV_((int code));\r |
777 | ONIG_EXTERN\r | |
14b0e578 CS |
778 | void onig_set_warn_func P_((OnigWarnFunc f));\r |
779 | ONIG_EXTERN\r | |
780 | void onig_set_verb_warn_func P_((OnigWarnFunc f));\r | |
781 | ONIG_EXTERN\r | |
782 | int onig_new P_((OnigRegex*, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));\r | |
783 | ONIG_EXTERN\r | |
b602265d | 784 | int onig_reg_init P_((OnigRegex reg, OnigOptionType option, OnigCaseFoldType case_fold_flag, OnigEncoding enc, OnigSyntaxType* syntax));\r |
14b0e578 CS |
785 | int onig_new_without_alloc P_((OnigRegex, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));\r |
786 | ONIG_EXTERN\r | |
787 | int onig_new_deluxe P_((OnigRegex* reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo));\r | |
788 | ONIG_EXTERN\r | |
789 | void onig_free P_((OnigRegex));\r | |
790 | ONIG_EXTERN\r | |
791 | void onig_free_body P_((OnigRegex));\r | |
792 | ONIG_EXTERN\r | |
b602265d | 793 | int onig_scan(OnigRegex reg, const OnigUChar* str, const OnigUChar* end, OnigRegion* region, OnigOptionType option, int (*scan_callback)(int, int, OnigRegion*, void*), void* callback_arg);\r |
14b0e578 CS |
794 | ONIG_EXTERN\r |
795 | int onig_search P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option));\r | |
796 | ONIG_EXTERN\r | |
b602265d DG |
797 | int onig_search_with_param P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option, OnigMatchParam* mp));\r |
798 | ONIG_EXTERN\r | |
14b0e578 CS |
799 | int onig_match P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* at, OnigRegion* region, OnigOptionType option));\r |
800 | ONIG_EXTERN\r | |
b602265d DG |
801 | int onig_match_with_param P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* at, OnigRegion* region, OnigOptionType option, OnigMatchParam* mp));\r |
802 | ONIG_EXTERN\r | |
14b0e578 CS |
803 | OnigRegion* onig_region_new P_((void));\r |
804 | ONIG_EXTERN\r | |
805 | void onig_region_init P_((OnigRegion* region));\r | |
806 | ONIG_EXTERN\r | |
807 | void onig_region_free P_((OnigRegion* region, int free_self));\r | |
808 | ONIG_EXTERN\r | |
809 | void onig_region_copy P_((OnigRegion* to, OnigRegion* from));\r | |
810 | ONIG_EXTERN\r | |
811 | void onig_region_clear P_((OnigRegion* region));\r | |
812 | ONIG_EXTERN\r | |
813 | int onig_region_resize P_((OnigRegion* region, int n));\r | |
814 | ONIG_EXTERN\r | |
815 | int onig_region_set P_((OnigRegion* region, int at, int beg, int end));\r | |
816 | ONIG_EXTERN\r | |
817 | int onig_name_to_group_numbers P_((OnigRegex reg, const OnigUChar* name, const OnigUChar* name_end, int** nums));\r | |
818 | ONIG_EXTERN\r | |
819 | int onig_name_to_backref_number P_((OnigRegex reg, const OnigUChar* name, const OnigUChar* name_end, OnigRegion *region));\r | |
820 | ONIG_EXTERN\r | |
821 | int onig_foreach_name P_((OnigRegex reg, int (*func)(const OnigUChar*, const OnigUChar*,int,int*,OnigRegex,void*), void* arg));\r | |
822 | ONIG_EXTERN\r | |
823 | int onig_number_of_names P_((OnigRegex reg));\r | |
824 | ONIG_EXTERN\r | |
825 | int onig_number_of_captures P_((OnigRegex reg));\r | |
826 | ONIG_EXTERN\r | |
827 | int onig_number_of_capture_histories P_((OnigRegex reg));\r | |
828 | ONIG_EXTERN\r | |
829 | OnigCaptureTreeNode* onig_get_capture_tree P_((OnigRegion* region));\r | |
830 | ONIG_EXTERN\r | |
831 | int onig_capture_tree_traverse P_((OnigRegion* region, int at, int(*callback_func)(int,int,int,int,int,void*), void* arg));\r | |
832 | ONIG_EXTERN\r | |
833 | int onig_noname_group_capture_is_active P_((OnigRegex reg));\r | |
834 | ONIG_EXTERN\r | |
835 | OnigEncoding onig_get_encoding P_((OnigRegex reg));\r | |
836 | ONIG_EXTERN\r | |
837 | OnigOptionType onig_get_options P_((OnigRegex reg));\r | |
838 | ONIG_EXTERN\r | |
839 | OnigCaseFoldType onig_get_case_fold_flag P_((OnigRegex reg));\r | |
840 | ONIG_EXTERN\r | |
841 | OnigSyntaxType* onig_get_syntax P_((OnigRegex reg));\r | |
842 | ONIG_EXTERN\r | |
843 | int onig_set_default_syntax P_((OnigSyntaxType* syntax));\r | |
844 | ONIG_EXTERN\r | |
845 | void onig_copy_syntax P_((OnigSyntaxType* to, OnigSyntaxType* from));\r | |
846 | ONIG_EXTERN\r | |
847 | unsigned int onig_get_syntax_op P_((OnigSyntaxType* syntax));\r | |
848 | ONIG_EXTERN\r | |
849 | unsigned int onig_get_syntax_op2 P_((OnigSyntaxType* syntax));\r | |
850 | ONIG_EXTERN\r | |
851 | unsigned int onig_get_syntax_behavior P_((OnigSyntaxType* syntax));\r | |
852 | ONIG_EXTERN\r | |
853 | OnigOptionType onig_get_syntax_options P_((OnigSyntaxType* syntax));\r | |
854 | ONIG_EXTERN\r | |
855 | void onig_set_syntax_op P_((OnigSyntaxType* syntax, unsigned int op));\r | |
856 | ONIG_EXTERN\r | |
857 | void onig_set_syntax_op2 P_((OnigSyntaxType* syntax, unsigned int op2));\r | |
858 | ONIG_EXTERN\r | |
859 | void onig_set_syntax_behavior P_((OnigSyntaxType* syntax, unsigned int behavior));\r | |
860 | ONIG_EXTERN\r | |
861 | void onig_set_syntax_options P_((OnigSyntaxType* syntax, OnigOptionType options));\r | |
862 | ONIG_EXTERN\r | |
863 | int onig_set_meta_char P_((OnigSyntaxType* syntax, unsigned int what, OnigCodePoint code));\r | |
864 | ONIG_EXTERN\r | |
865 | void onig_copy_encoding P_((OnigEncoding to, OnigEncoding from));\r | |
866 | ONIG_EXTERN\r | |
867 | OnigCaseFoldType onig_get_default_case_fold_flag P_((void));\r | |
868 | ONIG_EXTERN\r | |
869 | int onig_set_default_case_fold_flag P_((OnigCaseFoldType case_fold_flag));\r | |
870 | ONIG_EXTERN\r | |
871 | unsigned int onig_get_match_stack_limit_size P_((void));\r | |
872 | ONIG_EXTERN\r | |
873 | int onig_set_match_stack_limit_size P_((unsigned int size));\r | |
874 | ONIG_EXTERN\r | |
b602265d DG |
875 | unsigned long onig_get_retry_limit_in_match P_((void));\r |
876 | ONIG_EXTERN\r | |
877 | int onig_set_retry_limit_in_match P_((unsigned long n));\r | |
878 | ONIG_EXTERN\r | |
879 | unsigned int onig_get_parse_depth_limit P_((void));\r | |
880 | ONIG_EXTERN\r | |
881 | int onig_set_capture_num_limit P_((int num));\r | |
882 | ONIG_EXTERN\r | |
883 | int onig_set_parse_depth_limit P_((unsigned int depth));\r | |
884 | ONIG_EXTERN\r | |
885 | int onig_unicode_define_user_property P_((const char* name, OnigCodePoint* ranges));\r | |
886 | ONIG_EXTERN\r | |
14b0e578 CS |
887 | int onig_end P_((void));\r |
888 | ONIG_EXTERN\r | |
889 | const char* onig_version P_((void));\r | |
890 | ONIG_EXTERN\r | |
891 | const char* onig_copyright P_((void));\r | |
892 | \r | |
b602265d DG |
893 | /* for OnigMatchParam */\r |
894 | ONIG_EXTERN\r | |
895 | OnigMatchParam* onig_new_match_param P_((void));\r | |
896 | ONIG_EXTERN\r | |
897 | void onig_free_match_param P_((OnigMatchParam* p));\r | |
898 | ONIG_EXTERN\r | |
899 | void onig_free_match_param_content P_((OnigMatchParam* p));\r | |
900 | ONIG_EXTERN\r | |
901 | int onig_initialize_match_param P_((OnigMatchParam* mp));\r | |
902 | ONIG_EXTERN\r | |
903 | int onig_set_match_stack_limit_size_of_match_param P_((OnigMatchParam* param, unsigned int limit));\r | |
904 | ONIG_EXTERN\r | |
905 | int onig_set_retry_limit_in_match_of_match_param P_((OnigMatchParam* param, unsigned long limit));\r | |
906 | ONIG_EXTERN\r | |
907 | int onig_set_progress_callout_of_match_param P_((OnigMatchParam* param, OnigCalloutFunc f));\r | |
908 | ONIG_EXTERN\r | |
909 | int onig_set_retraction_callout_of_match_param P_((OnigMatchParam* param, OnigCalloutFunc f));\r | |
910 | ONIG_EXTERN\r | |
911 | int onig_set_callout_user_data_of_match_param P_((OnigMatchParam* param, void* user_data));\r | |
912 | \r | |
913 | /* for callout functions */\r | |
914 | ONIG_EXTERN\r | |
915 | OnigCalloutFunc onig_get_progress_callout P_((void));\r | |
916 | ONIG_EXTERN\r | |
917 | int onig_set_progress_callout P_((OnigCalloutFunc f));\r | |
918 | ONIG_EXTERN\r | |
919 | OnigCalloutFunc onig_get_retraction_callout P_((void));\r | |
920 | ONIG_EXTERN\r | |
921 | int onig_set_retraction_callout P_((OnigCalloutFunc f));\r | |
922 | ONIG_EXTERN\r | |
923 | int onig_set_callout_of_name P_((OnigEncoding enc, OnigCalloutType type, OnigUChar* name, OnigUChar* name_end, int callout_in, OnigCalloutFunc callout, OnigCalloutFunc end_callout, int arg_num, unsigned int arg_types[], int optional_arg_num, OnigValue opt_defaults[]));\r | |
924 | ONIG_EXTERN\r | |
925 | OnigUChar* onig_get_callout_name_by_name_id P_((int id));\r | |
926 | ONIG_EXTERN\r | |
927 | int onig_get_callout_num_by_tag P_((OnigRegex reg, const OnigUChar* tag, const OnigUChar* tag_end));\r | |
928 | ONIG_EXTERN\r | |
929 | int onig_get_callout_data_by_tag P_((OnigRegex reg, OnigMatchParam* mp, const OnigUChar* tag, const OnigUChar* tag_end, int slot, OnigType* type, OnigValue* val));\r | |
930 | ONIG_EXTERN\r | |
931 | int onig_set_callout_data_by_tag P_((OnigRegex reg, OnigMatchParam* mp, const OnigUChar* tag, const OnigUChar* tag_end, int slot, OnigType type, OnigValue* val));\r | |
932 | \r | |
933 | /* used in callout functions */\r | |
934 | ONIG_EXTERN\r | |
935 | int onig_get_callout_num_by_callout_args P_((OnigCalloutArgs* args));\r | |
936 | ONIG_EXTERN\r | |
937 | OnigCalloutIn onig_get_callout_in_by_callout_args P_((OnigCalloutArgs* args));\r | |
938 | ONIG_EXTERN\r | |
939 | int onig_get_name_id_by_callout_args P_((OnigCalloutArgs* args));\r | |
940 | ONIG_EXTERN\r | |
941 | const OnigUChar* onig_get_contents_by_callout_args P_((OnigCalloutArgs* args));\r | |
942 | ONIG_EXTERN\r | |
943 | const OnigUChar* onig_get_contents_end_by_callout_args P_((OnigCalloutArgs* args));\r | |
944 | ONIG_EXTERN\r | |
945 | int onig_get_args_num_by_callout_args P_((OnigCalloutArgs* args));\r | |
946 | ONIG_EXTERN\r | |
947 | int onig_get_passed_args_num_by_callout_args P_((OnigCalloutArgs* args));\r | |
948 | ONIG_EXTERN\r | |
949 | int onig_get_arg_by_callout_args P_((OnigCalloutArgs* args, int index, OnigType* type, OnigValue* val));\r | |
950 | ONIG_EXTERN\r | |
951 | const OnigUChar* onig_get_string_by_callout_args P_((OnigCalloutArgs* args));\r | |
952 | ONIG_EXTERN\r | |
953 | const OnigUChar* onig_get_string_end_by_callout_args P_((OnigCalloutArgs* args));\r | |
954 | ONIG_EXTERN\r | |
955 | const OnigUChar* onig_get_start_by_callout_args P_((OnigCalloutArgs* args));\r | |
956 | ONIG_EXTERN\r | |
957 | const OnigUChar* onig_get_right_range_by_callout_args P_((OnigCalloutArgs* args));\r | |
958 | ONIG_EXTERN\r | |
959 | const OnigUChar* onig_get_current_by_callout_args P_((OnigCalloutArgs* args));\r | |
960 | ONIG_EXTERN\r | |
961 | OnigRegex onig_get_regex_by_callout_args P_((OnigCalloutArgs* args));\r | |
962 | ONIG_EXTERN\r | |
963 | unsigned long onig_get_retry_counter_by_callout_args P_((OnigCalloutArgs* args));\r | |
964 | ONIG_EXTERN\r | |
965 | int onig_callout_tag_is_exist_at_callout_num P_((OnigRegex reg, int callout_num));\r | |
966 | ONIG_EXTERN\r | |
967 | const OnigUChar* onig_get_callout_tag_start P_((OnigRegex reg, int callout_num));\r | |
968 | ONIG_EXTERN\r | |
969 | const OnigUChar* onig_get_callout_tag_end P_((OnigRegex reg, int callout_num));\r | |
970 | ONIG_EXTERN\r | |
971 | int onig_get_callout_data_dont_clear_old P_((OnigRegex reg, OnigMatchParam* mp, int callout_num, int slot, OnigType* type, OnigValue* val));\r | |
972 | ONIG_EXTERN\r | |
973 | int onig_get_callout_data_by_callout_args_self_dont_clear_old P_((OnigCalloutArgs* args, int slot, OnigType* type, OnigValue* val));\r | |
974 | ONIG_EXTERN\r | |
975 | int onig_get_callout_data P_((OnigRegex reg, OnigMatchParam* mp, int callout_num, int slot, OnigType* type, OnigValue* val));\r | |
976 | ONIG_EXTERN\r | |
977 | int onig_get_callout_data_by_callout_args P_((OnigCalloutArgs* args, int callout_num, int slot, OnigType* type, OnigValue* val));\r | |
978 | ONIG_EXTERN\r | |
979 | int onig_get_callout_data_by_callout_args_self P_((OnigCalloutArgs* args, int slot, OnigType* type, OnigValue* val));\r | |
980 | ONIG_EXTERN\r | |
981 | int onig_set_callout_data P_((OnigRegex reg, OnigMatchParam* mp, int callout_num, int slot, OnigType type, OnigValue* val));\r | |
982 | ONIG_EXTERN\r | |
983 | int onig_set_callout_data_by_callout_args P_((OnigCalloutArgs* args, int callout_num, int slot, OnigType type, OnigValue* val));\r | |
984 | ONIG_EXTERN\r | |
985 | int onig_set_callout_data_by_callout_args_self P_((OnigCalloutArgs* args, int slot, OnigType type, OnigValue* val));\r | |
986 | ONIG_EXTERN\r | |
987 | int onig_get_capture_range_in_callout P_((OnigCalloutArgs* args, int mem_num, int* begin, int* end));\r | |
988 | ONIG_EXTERN\r | |
989 | int onig_get_used_stack_size_in_callout P_((OnigCalloutArgs* args, int* used_num, int* used_bytes));\r | |
990 | \r | |
991 | /* builtin callout functions */\r | |
992 | ONIG_EXTERN\r | |
993 | int onig_builtin_fail P_((OnigCalloutArgs* args, void* user_data));\r | |
994 | ONIG_EXTERN\r | |
995 | int onig_builtin_mismatch P_((OnigCalloutArgs* args, void* user_data));\r | |
996 | ONIG_EXTERN\r | |
997 | int onig_builtin_error P_((OnigCalloutArgs* args, void* user_data));\r | |
998 | ONIG_EXTERN\r | |
999 | int onig_builtin_count P_((OnigCalloutArgs* args, void* user_data));\r | |
1000 | ONIG_EXTERN\r | |
1001 | int onig_builtin_total_count P_((OnigCalloutArgs* args, void* user_data));\r | |
1002 | ONIG_EXTERN\r | |
1003 | int onig_builtin_max P_((OnigCalloutArgs* args, void* user_data));\r | |
1004 | ONIG_EXTERN\r | |
1005 | int onig_builtin_cmp P_((OnigCalloutArgs* args, void* user_data));\r | |
1006 | \r | |
1007 | ONIG_EXTERN\r | |
1008 | int onig_setup_builtin_monitors_by_ascii_encoded_name P_((void* fp));\r | |
1009 | \r | |
14b0e578 CS |
1010 | #ifdef __cplusplus\r |
1011 | }\r | |
1012 | #endif\r | |
1013 | \r | |
1014 | #endif /* ONIGURUMA_H */\r |