Changeset 331 for EcnlProtoTool/trunk/onigmo-6.1.3/src/onigmo.h
- Timestamp:
- Jan 21, 2018, 12:10:09 AM (6 years ago)
- Location:
- EcnlProtoTool/trunk/onigmo-6.1.3
- Files:
-
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/onigmo-6.1.3/src/onigmo.h
r321 r331 1 #ifndef ONIG URUMA_H2 #define ONIG URUMA_H1 #ifndef ONIGMO_H 2 #define ONIGMO_H 3 3 /********************************************************************** 4 onig uruma.h - Onigmo (Oniguruma-mod) (regular expression library)4 onigmo.h - Onigmo (Oniguruma-mod) (regular expression library) 5 5 **********************************************************************/ 6 6 /*- 7 7 * Copyright (c) 2002-2009 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> 8 * Copyright (c) 2011-201 4K.Takata <kentkt AT csc DOT jp>8 * Copyright (c) 2011-2017 K.Takata <kentkt AT csc DOT jp> 9 9 * All rights reserved. 10 10 * … … 33 33 #ifdef __cplusplus 34 34 extern "C" { 35 #endif 36 37 #define ONIGURUMA 38 #define ONIGURUMA_VERSION_MAJOR 5 39 #define ONIGURUMA_VERSION_MINOR 15 40 #define ONIGURUMA_VERSION_TEENY 0 41 42 #ifdef __cplusplus 43 # ifndef HAVE_PROTOTYPES 44 # define HAVE_PROTOTYPES 1 45 # endif 46 # ifndef HAVE_STDARG_PROTOTYPES 47 # define HAVE_STDARG_PROTOTYPES 1 35 # if 0 36 } /* satisfy cc-mode */ 48 37 # endif 49 38 #endif 50 39 51 /* escape Mac OS X/Xcode 2.4/gcc 4.0.1 problem */ 52 #if defined(__APPLE__) && defined(__GNUC__) && __GNUC__ >= 4 53 # ifndef HAVE_STDARG_PROTOTYPES 54 # define HAVE_STDARG_PROTOTYPES 1 40 #define ONIGMO_VERSION_MAJOR 6 41 #define ONIGMO_VERSION_MINOR 1 42 #define ONIGMO_VERSION_TEENY 3 43 44 #ifndef ONIG_EXTERN 45 # ifdef RUBY_EXTERN 46 # define ONIG_EXTERN RUBY_EXTERN 47 # else 48 # if defined(_WIN32) && !defined(__GNUC__) 49 # if defined(EXPORT) || defined(RUBY_EXPORT) 50 # define ONIG_EXTERN extern __declspec(dllexport) 51 # else 52 # define ONIG_EXTERN extern __declspec(dllimport) 53 # endif 54 # endif 55 55 # endif 56 56 #endif 57 57 58 #if defined(HAVE_STDARG_H) || defined(_WIN32) 59 # ifndef HAVE_STDARG_PROTOTYPES 60 # define HAVE_STDARG_PROTOTYPES 1 58 #ifndef ONIG_EXTERN 59 # define ONIG_EXTERN extern 60 #endif 61 62 #ifndef RUBY 63 # ifndef RUBY_SYMBOL_EXPORT_BEGIN 64 # define RUBY_SYMBOL_EXPORT_BEGIN 65 # define RUBY_SYMBOL_EXPORT_END 61 66 # endif 62 67 #endif 63 68 64 #ifndef P_ 65 #if defined(__STDC__) || defined(_WIN32) 66 # define P_(args) args 67 #else 68 # define P_(args) () 69 #endif 70 #endif 71 72 #ifndef PV_ 73 #ifdef HAVE_STDARG_PROTOTYPES 74 # define PV_(args) args 75 #else 76 # define PV_(args) () 77 #endif 78 #endif 79 80 #ifndef ONIG_EXTERN 81 #if defined(_WIN32) && !defined(__GNUC__) 82 #if defined(EXPORT) || defined(RUBY_EXPORT) 83 #define ONIG_EXTERN extern __declspec(dllexport) 84 #else 85 #define ONIG_EXTERN extern __declspec(dllimport) 86 #endif 87 #endif 88 #endif 89 90 #ifndef ONIG_EXTERN 91 #define ONIG_EXTERN extern 92 #endif 69 RUBY_SYMBOL_EXPORT_BEGIN 93 70 94 71 #include <stddef.h> /* for size_t */ … … 97 74 98 75 #ifndef ONIG_ESCAPE_UCHAR_COLLISION 99 # define UChar OnigUChar76 # define UChar OnigUChar 100 77 #endif 101 78 … … 108 85 #define ONIG_INFINITE_DISTANCE ~((OnigDistance )0) 109 86 87 /* 88 * Onig casefold/case mapping flags and related definitions 89 * 90 * Subfields (starting with 0 at LSB): 91 * 0-2: Code point count in casefold.h 92 * 3-12: Index into SpecialCaseMapping array in casefold.h 93 * 13-22: Case folding/mapping flags 94 */ 110 95 typedef unsigned int OnigCaseFoldType; /* case fold flag */ 111 96 112 97 ONIG_EXTERN OnigCaseFoldType OnigDefaultCaseFoldFlag; 113 98 114 /* #define ONIGENC_CASE_FOLD_HIRAGANA_KATAKANA (1<<1) */ 115 /* #define ONIGENC_CASE_FOLD_KATAKANA_WIDTH (1<<2) */ 116 #define ONIGENC_CASE_FOLD_TURKISH_AZERI (1<<20) 117 #define INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR (1<<30) 99 /* bits for actual code point count; 3 bits is more than enough, currently only 2 used */ 100 #define OnigCodePointMaskWidth 3 101 #define OnigCodePointMask ((1<<OnigCodePointMaskWidth)-1) 102 #define OnigCodePointCount(n) ((n)&OnigCodePointMask) 103 #define OnigCaseFoldFlags(n) ((n)&~OnigCodePointMask) 104 105 /* #define ONIGENC_CASE_FOLD_HIRAGANA_KATAKANA (1<<1) */ /* no longer usable with these values! */ 106 /* #define ONIGENC_CASE_FOLD_KATAKANA_WIDTH (1<<2) */ /* no longer usable with these values! */ 107 108 /* bits for index into table with separate titlecase mappings */ 109 /* 10 bits provide 1024 values */ 110 #define OnigSpecialIndexShift 3 111 #define OnigSpecialIndexWidth 10 112 113 #define ONIGENC_CASE_UPCASE (1<<13) /* has/needs uppercase mapping */ 114 #define ONIGENC_CASE_DOWNCASE (1<<14) /* has/needs lowercase mapping */ 115 #define ONIGENC_CASE_TITLECASE (1<<15) /* has/needs (special) titlecase mapping */ 116 #define ONIGENC_CASE_SPECIAL_OFFSET 3 /* offset in bits from ONIGENC_CASE to ONIGENC_CASE_SPECIAL */ 117 #define ONIGENC_CASE_UP_SPECIAL (1<<16) /* has special upcase mapping */ 118 #define ONIGENC_CASE_DOWN_SPECIAL (1<<17) /* has special downcase mapping */ 119 #define ONIGENC_CASE_MODIFIED (1<<18) /* data has been modified */ 120 #define ONIGENC_CASE_FOLD (1<<19) /* has/needs case folding */ 121 122 #define ONIGENC_CASE_FOLD_TURKISH_AZERI (1<<20) /* needs mapping specific to Turkic languages; better not change original value! */ 123 124 #define ONIGENC_CASE_FOLD_LITHUANIAN (1<<21) /* needs Lithuanian-specific mapping */ 125 #define ONIGENC_CASE_ASCII_ONLY (1<<22) /* only modify ASCII range */ 126 #define ONIGENC_CASE_IS_TITLECASE (1<<23) /* character itself is already titlecase */ 127 128 #define INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR (1<<30) /* better not change original value! */ 118 129 119 130 #define ONIGENC_CASE_FOLD_MIN INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR … … 148 159 149 160 typedef struct OnigEncodingTypeST { 150 int (* mbc_enc_len)(const OnigUChar* p);161 int (*precise_mbc_enc_len)(const OnigUChar* p,const OnigUChar* e, const struct OnigEncodingTypeST* enc); 151 162 const char* name; 152 163 int max_enc_len; 153 164 int min_enc_len; 154 int (*is_mbc_newline)(const OnigUChar* p, const OnigUChar* end); 155 OnigCodePoint (*mbc_to_code)(const OnigUChar* p, const OnigUChar* end); 156 int (*code_to_mbclen)(OnigCodePoint code); 157 int (*code_to_mbc)(OnigCodePoint code, OnigUChar *buf); 158 int (*mbc_case_fold)(OnigCaseFoldType flag, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to); 159 int (*apply_all_case_fold)(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg); 160 int (*get_case_fold_codes_by_str)(OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem acs[]); 161 int (*property_name_to_ctype)(struct OnigEncodingTypeST* enc, OnigUChar* p, OnigUChar* end); 162 int (*is_code_ctype)(OnigCodePoint code, OnigCtype ctype); 163 int (*get_ctype_code_range)(OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[]); 164 OnigUChar* (*left_adjust_char_head)(const OnigUChar* start, const OnigUChar* p); 165 int (*is_allowed_reverse_match)(const OnigUChar* p, const OnigUChar* end); 165 int (*is_mbc_newline)(const OnigUChar* p, const OnigUChar* end, const struct OnigEncodingTypeST* enc); 166 OnigCodePoint (*mbc_to_code)(const OnigUChar* p, const OnigUChar* end, const struct OnigEncodingTypeST* enc); 167 int (*code_to_mbclen)(OnigCodePoint code, const struct OnigEncodingTypeST* enc); 168 int (*code_to_mbc)(OnigCodePoint code, OnigUChar *buf, const struct OnigEncodingTypeST* enc); 169 int (*mbc_case_fold)(OnigCaseFoldType flag, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, const struct OnigEncodingTypeST* enc); 170 int (*apply_all_case_fold)(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, const struct OnigEncodingTypeST* enc); 171 int (*get_case_fold_codes_by_str)(OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem acs[], const struct OnigEncodingTypeST* enc); 172 int (*property_name_to_ctype)(const struct OnigEncodingTypeST* enc, const OnigUChar* p, const OnigUChar* end); 173 int (*is_code_ctype)(OnigCodePoint code, OnigCtype ctype, const struct OnigEncodingTypeST* enc); 174 int (*get_ctype_code_range)(OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[], const struct OnigEncodingTypeST* enc); 175 OnigUChar* (*left_adjust_char_head)(const OnigUChar* start, const OnigUChar* p, const OnigUChar* end, const struct OnigEncodingTypeST* enc); 176 int (*is_allowed_reverse_match)(const OnigUChar* p, const OnigUChar* end, const struct OnigEncodingTypeST* enc); 177 int (*case_map)(OnigCaseFoldType* flagP, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, OnigUChar* to_end, const struct OnigEncodingTypeST* enc); 178 int ruby_encoding_index; 166 179 unsigned int flags; 167 180 } OnigEncodingType; 168 181 169 typedef OnigEncodingType* OnigEncoding; 170 171 ONIG_EXTERN OnigEncodingType OnigEncodingASCII; 172 ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_1; 173 ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_2; 174 ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_3; 175 ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_4; 176 ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_5; 177 ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_6; 178 ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_7; 179 ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_8; 180 ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_9; 181 ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_10; 182 ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_11; 183 ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_13; 184 ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_14; 185 ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_15; 186 ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_16; 187 ONIG_EXTERN OnigEncodingType OnigEncodingUTF8; 188 ONIG_EXTERN OnigEncodingType OnigEncodingUTF16_BE; 189 ONIG_EXTERN OnigEncodingType OnigEncodingUTF16_LE; 190 ONIG_EXTERN OnigEncodingType OnigEncodingUTF32_BE; 191 ONIG_EXTERN OnigEncodingType OnigEncodingUTF32_LE; 192 ONIG_EXTERN OnigEncodingType OnigEncodingEUC_JP; 193 ONIG_EXTERN OnigEncodingType OnigEncodingEUC_TW; 194 ONIG_EXTERN OnigEncodingType OnigEncodingEUC_KR; 195 ONIG_EXTERN OnigEncodingType OnigEncodingEUC_CN; 196 ONIG_EXTERN OnigEncodingType OnigEncodingSJIS; 197 ONIG_EXTERN OnigEncodingType OnigEncodingCP932; 198 ONIG_EXTERN OnigEncodingType OnigEncodingKOI8; 199 ONIG_EXTERN OnigEncodingType OnigEncodingKOI8_R; 200 ONIG_EXTERN OnigEncodingType OnigEncodingCP1251; 201 ONIG_EXTERN OnigEncodingType OnigEncodingBIG5; 202 ONIG_EXTERN OnigEncodingType OnigEncodingGB18030; 182 typedef const OnigEncodingType* OnigEncoding; 183 184 ONIG_EXTERN const OnigEncodingType OnigEncodingASCII; 185 #ifndef RUBY 186 ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_1; 187 ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_2; 188 ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_3; 189 ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_4; 190 ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_5; 191 ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_6; 192 ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_7; 193 ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_8; 194 ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_9; 195 ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_10; 196 ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_11; 197 ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_13; 198 ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_14; 199 ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_15; 200 ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_16; 201 ONIG_EXTERN const OnigEncodingType OnigEncodingUTF_8; 202 ONIG_EXTERN const OnigEncodingType OnigEncodingUTF_16BE; 203 ONIG_EXTERN const OnigEncodingType OnigEncodingUTF_16LE; 204 ONIG_EXTERN const OnigEncodingType OnigEncodingUTF_32BE; 205 ONIG_EXTERN const OnigEncodingType OnigEncodingUTF_32LE; 206 ONIG_EXTERN const OnigEncodingType OnigEncodingEUC_JP; 207 ONIG_EXTERN const OnigEncodingType OnigEncodingEUC_TW; 208 ONIG_EXTERN const OnigEncodingType OnigEncodingEUC_KR; 209 ONIG_EXTERN const OnigEncodingType OnigEncodingEUC_CN; 210 ONIG_EXTERN const OnigEncodingType OnigEncodingShift_JIS; 211 ONIG_EXTERN const OnigEncodingType OnigEncodingWindows_31J; 212 /* ONIG_EXTERN const OnigEncodingType OnigEncodingKOI8; */ 213 ONIG_EXTERN const OnigEncodingType OnigEncodingKOI8_R; 214 ONIG_EXTERN const OnigEncodingType OnigEncodingKOI8_U; 215 ONIG_EXTERN const OnigEncodingType OnigEncodingWindows_1250; 216 ONIG_EXTERN const OnigEncodingType OnigEncodingWindows_1251; 217 ONIG_EXTERN const OnigEncodingType OnigEncodingWindows_1252; 218 ONIG_EXTERN const OnigEncodingType OnigEncodingWindows_1253; 219 ONIG_EXTERN const OnigEncodingType OnigEncodingWindows_1254; 220 ONIG_EXTERN const OnigEncodingType OnigEncodingWindows_1257; 221 ONIG_EXTERN const OnigEncodingType OnigEncodingBIG5; 222 ONIG_EXTERN const OnigEncodingType OnigEncodingGB18030; 223 #endif /* RUBY */ 203 224 204 225 #define ONIG_ENCODING_ASCII (&OnigEncodingASCII) 205 #define ONIG_ENCODING_ISO_8859_1 (&OnigEncodingISO_8859_1) 206 #define ONIG_ENCODING_ISO_8859_2 (&OnigEncodingISO_8859_2) 207 #define ONIG_ENCODING_ISO_8859_3 (&OnigEncodingISO_8859_3) 208 #define ONIG_ENCODING_ISO_8859_4 (&OnigEncodingISO_8859_4) 209 #define ONIG_ENCODING_ISO_8859_5 (&OnigEncodingISO_8859_5) 210 #define ONIG_ENCODING_ISO_8859_6 (&OnigEncodingISO_8859_6) 211 #define ONIG_ENCODING_ISO_8859_7 (&OnigEncodingISO_8859_7) 212 #define ONIG_ENCODING_ISO_8859_8 (&OnigEncodingISO_8859_8) 213 #define ONIG_ENCODING_ISO_8859_9 (&OnigEncodingISO_8859_9) 214 #define ONIG_ENCODING_ISO_8859_10 (&OnigEncodingISO_8859_10) 215 #define ONIG_ENCODING_ISO_8859_11 (&OnigEncodingISO_8859_11) 216 #define ONIG_ENCODING_ISO_8859_13 (&OnigEncodingISO_8859_13) 217 #define ONIG_ENCODING_ISO_8859_14 (&OnigEncodingISO_8859_14) 218 #define ONIG_ENCODING_ISO_8859_15 (&OnigEncodingISO_8859_15) 219 #define ONIG_ENCODING_ISO_8859_16 (&OnigEncodingISO_8859_16) 220 #define ONIG_ENCODING_UTF8 (&OnigEncodingUTF8) 221 #define ONIG_ENCODING_UTF16_BE (&OnigEncodingUTF16_BE) 222 #define ONIG_ENCODING_UTF16_LE (&OnigEncodingUTF16_LE) 223 #define ONIG_ENCODING_UTF32_BE (&OnigEncodingUTF32_BE) 224 #define ONIG_ENCODING_UTF32_LE (&OnigEncodingUTF32_LE) 225 #define ONIG_ENCODING_EUC_JP (&OnigEncodingEUC_JP) 226 #define ONIG_ENCODING_EUC_TW (&OnigEncodingEUC_TW) 227 #define ONIG_ENCODING_EUC_KR (&OnigEncodingEUC_KR) 228 #define ONIG_ENCODING_EUC_CN (&OnigEncodingEUC_CN) 229 #define ONIG_ENCODING_SJIS (&OnigEncodingSJIS) 230 #define ONIG_ENCODING_CP932 (&OnigEncodingCP932) 231 #define ONIG_ENCODING_KOI8 (&OnigEncodingKOI8) 232 #define ONIG_ENCODING_KOI8_R (&OnigEncodingKOI8_R) 233 #define ONIG_ENCODING_CP1251 (&OnigEncodingCP1251) 234 #define ONIG_ENCODING_BIG5 (&OnigEncodingBIG5) 235 #define ONIG_ENCODING_GB18030 (&OnigEncodingGB18030) 226 #ifndef RUBY 227 # define ONIG_ENCODING_ISO_8859_1 (&OnigEncodingISO_8859_1) 228 # define ONIG_ENCODING_ISO_8859_2 (&OnigEncodingISO_8859_2) 229 # define ONIG_ENCODING_ISO_8859_3 (&OnigEncodingISO_8859_3) 230 # define ONIG_ENCODING_ISO_8859_4 (&OnigEncodingISO_8859_4) 231 # define ONIG_ENCODING_ISO_8859_5 (&OnigEncodingISO_8859_5) 232 # define ONIG_ENCODING_ISO_8859_6 (&OnigEncodingISO_8859_6) 233 # define ONIG_ENCODING_ISO_8859_7 (&OnigEncodingISO_8859_7) 234 # define ONIG_ENCODING_ISO_8859_8 (&OnigEncodingISO_8859_8) 235 # define ONIG_ENCODING_ISO_8859_9 (&OnigEncodingISO_8859_9) 236 # define ONIG_ENCODING_ISO_8859_10 (&OnigEncodingISO_8859_10) 237 # define ONIG_ENCODING_ISO_8859_11 (&OnigEncodingISO_8859_11) 238 # define ONIG_ENCODING_ISO_8859_13 (&OnigEncodingISO_8859_13) 239 # define ONIG_ENCODING_ISO_8859_14 (&OnigEncodingISO_8859_14) 240 # define ONIG_ENCODING_ISO_8859_15 (&OnigEncodingISO_8859_15) 241 # define ONIG_ENCODING_ISO_8859_16 (&OnigEncodingISO_8859_16) 242 # define ONIG_ENCODING_UTF_8 (&OnigEncodingUTF_8) 243 # define ONIG_ENCODING_UTF_16BE (&OnigEncodingUTF_16BE) 244 # define ONIG_ENCODING_UTF_16LE (&OnigEncodingUTF_16LE) 245 # define ONIG_ENCODING_UTF_32BE (&OnigEncodingUTF_32BE) 246 # define ONIG_ENCODING_UTF_32LE (&OnigEncodingUTF_32LE) 247 # define ONIG_ENCODING_EUC_JP (&OnigEncodingEUC_JP) 248 # define ONIG_ENCODING_EUC_TW (&OnigEncodingEUC_TW) 249 # define ONIG_ENCODING_EUC_KR (&OnigEncodingEUC_KR) 250 # define ONIG_ENCODING_EUC_CN (&OnigEncodingEUC_CN) 251 # define ONIG_ENCODING_SHIFT_JIS (&OnigEncodingShift_JIS) 252 # define ONIG_ENCODING_WINDOWS_31J (&OnigEncodingWindows_31J) 253 /* # define ONIG_ENCODING_KOI8 (&OnigEncodingKOI8) */ 254 # define ONIG_ENCODING_KOI8_R (&OnigEncodingKOI8_R) 255 # define ONIG_ENCODING_KOI8_U (&OnigEncodingKOI8_U) 256 # define ONIG_ENCODING_WINDOWS_1250 (&OnigEncodingWindows_1250) 257 # define ONIG_ENCODING_WINDOWS_1251 (&OnigEncodingWindows_1251) 258 # define ONIG_ENCODING_WINDOWS_1252 (&OnigEncodingWindows_1252) 259 # define ONIG_ENCODING_WINDOWS_1253 (&OnigEncodingWindows_1253) 260 # define ONIG_ENCODING_WINDOWS_1254 (&OnigEncodingWindows_1254) 261 # define ONIG_ENCODING_WINDOWS_1257 (&OnigEncodingWindows_1257) 262 # define ONIG_ENCODING_BIG5 (&OnigEncodingBIG5) 263 # define ONIG_ENCODING_GB18030 (&OnigEncodingGB18030) 264 265 /* old names */ 266 # define ONIG_ENCODING_SJIS ONIG_ENCODING_SHIFT_JIS 267 # define ONIG_ENCODING_CP932 ONIG_ENCODING_WINDOWS_31J 268 # define ONIG_ENCODING_CP1250 ONIG_ENCODING_WINDOWS_1250 269 # define ONIG_ENCODING_CP1251 ONIG_ENCODING_WINDOWS_1251 270 # define ONIG_ENCODING_CP1252 ONIG_ENCODING_WINDOWS_1252 271 # define ONIG_ENCODING_CP1253 ONIG_ENCODING_WINDOWS_1253 272 # define ONIG_ENCODING_CP1254 ONIG_ENCODING_WINDOWS_1254 273 # define ONIG_ENCODING_CP1257 ONIG_ENCODING_WINDOWS_1257 274 # define ONIG_ENCODING_UTF8 ONIG_ENCODING_UTF_8 275 # define ONIG_ENCODING_UTF16_BE ONIG_ENCODING_UTF_16BE 276 # define ONIG_ENCODING_UTF16_LE ONIG_ENCODING_UTF_16LE 277 # define ONIG_ENCODING_UTF32_BE ONIG_ENCODING_UTF_32BE 278 # define ONIG_ENCODING_UTF32_LE ONIG_ENCODING_UTF_32LE 279 #endif /* RUBY */ 236 280 237 281 #define ONIG_ENCODING_UNDEF ((OnigEncoding )0) 282 283 /* this declaration needs to be here because it is used in string.c in Ruby */ 284 ONIG_EXTERN 285 int onigenc_ascii_only_case_map(OnigCaseFoldType* flagP, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, OnigUChar* to_end, const struct OnigEncodingTypeST* enc); 238 286 239 287 … … 265 313 #define ONIGENC_FLAG_UNICODE 1U 266 314 267 268 #define onig_enc_len(enc,p,end) ONIGENC_MBC_ENC_LEN(enc,p) 315 #define onig_enc_len(enc,p,e) ONIGENC_MBC_ENC_LEN(enc, p, e) 269 316 270 317 #define ONIGENC_IS_UNDEF(enc) ((enc) == ONIG_ENCODING_UNDEF) 271 318 #define ONIGENC_IS_SINGLEBYTE(enc) (ONIGENC_MBC_MAXLEN(enc) == 1) 272 #define ONIGENC_IS_MBC_HEAD(enc,p ) (ONIGENC_MBC_ENC_LEN(enc,p) != 1)319 #define ONIGENC_IS_MBC_HEAD(enc,p,e) (ONIGENC_MBC_ENC_LEN(enc,p,e) != 1) 273 320 #define ONIGENC_IS_MBC_ASCII(p) (*(p) < 128) 274 321 #define ONIGENC_IS_CODE_ASCII(code) ((code) < 128) … … 277 324 #define ONIGENC_IS_MBC_ASCII_WORD(enc,s,end) \ 278 325 onigenc_ascii_is_code_ctype( \ 279 ONIGENC_MBC_TO_CODE(enc,s,end),ONIGENC_CTYPE_WORD )326 ONIGENC_MBC_TO_CODE(enc,s,end),ONIGENC_CTYPE_WORD,enc) 280 327 #define ONIGENC_IS_UNICODE(enc) ((enc)->flags & ONIGENC_FLAG_UNICODE) 281 328 … … 284 331 285 332 #define ONIGENC_MBC_CASE_FOLD(enc,flag,pp,end,buf) \ 286 (enc)->mbc_case_fold(flag,(const OnigUChar** )pp,end,buf )333 (enc)->mbc_case_fold(flag,(const OnigUChar** )pp,end,buf,enc) 287 334 #define ONIGENC_IS_ALLOWED_REVERSE_MATCH(enc,s,end) \ 288 (enc)->is_allowed_reverse_match(s,end )289 #define ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc,start,s ) \290 (enc)->left_adjust_char_head(start, s )335 (enc)->is_allowed_reverse_match(s,end,enc) 336 #define ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc,start,s,end) \ 337 (enc)->left_adjust_char_head(start, s, end, enc) 291 338 #define ONIGENC_APPLY_ALL_CASE_FOLD(enc,case_fold_flag,f,arg) \ 292 (enc)->apply_all_case_fold(case_fold_flag,f,arg )339 (enc)->apply_all_case_fold(case_fold_flag,f,arg,enc) 293 340 #define ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc,case_fold_flag,p,end,acs) \ 294 (enc)->get_case_fold_codes_by_str(case_fold_flag,p,end,acs) 295 #define ONIGENC_STEP_BACK(enc,start,s,n) \ 296 onigenc_step_back((enc),(start),(s),(n)) 297 298 #define ONIGENC_MBC_ENC_LEN(enc,p) (enc)->mbc_enc_len(p) 341 (enc)->get_case_fold_codes_by_str(case_fold_flag,p,end,acs,enc) 342 #define ONIGENC_STEP_BACK(enc,start,s,end,n) \ 343 onigenc_step_back((enc),(start),(s),(end),(n)) 344 345 #define ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(n) (n) 346 #define ONIGENC_MBCLEN_CHARFOUND_P(r) (0 < (r)) 347 #define ONIGENC_MBCLEN_CHARFOUND_LEN(r) (r) 348 349 #define ONIGENC_CONSTRUCT_MBCLEN_INVALID() (-1) 350 #define ONIGENC_MBCLEN_INVALID_P(r) ((r) == -1) 351 352 #define ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(n) (-1-(n)) 353 #define ONIGENC_MBCLEN_NEEDMORE_P(r) ((r) < -1) 354 #define ONIGENC_MBCLEN_NEEDMORE_LEN(r) (-1-(r)) 355 356 #define ONIGENC_PRECISE_MBC_ENC_LEN(enc,p,e) (enc)->precise_mbc_enc_len(p,e,enc) 357 358 ONIG_EXTERN 359 int onigenc_mbclen_approximate(const OnigUChar* p,const OnigUChar* e, const struct OnigEncodingTypeST* enc); 360 361 #define ONIGENC_MBC_ENC_LEN(enc,p,e) onigenc_mbclen_approximate(p,e,enc) 299 362 #define ONIGENC_MBC_MAXLEN(enc) ((enc)->max_enc_len) 300 363 #define ONIGENC_MBC_MAXLEN_DIST(enc) ONIGENC_MBC_MAXLEN(enc) 301 364 #define ONIGENC_MBC_MINLEN(enc) ((enc)->min_enc_len) 302 #define ONIGENC_IS_MBC_NEWLINE(enc,p,end) (enc)->is_mbc_newline((p),(end) )303 #define ONIGENC_MBC_TO_CODE(enc,p,end) (enc)->mbc_to_code((p),(end) )304 #define ONIGENC_CODE_TO_MBCLEN(enc,code) (enc)->code_to_mbclen(code )305 #define ONIGENC_CODE_TO_MBC(enc,code,buf) (enc)->code_to_mbc(code,buf )365 #define ONIGENC_IS_MBC_NEWLINE(enc,p,end) (enc)->is_mbc_newline((p),(end),enc) 366 #define ONIGENC_MBC_TO_CODE(enc,p,end) (enc)->mbc_to_code((p),(end),enc) 367 #define ONIGENC_CODE_TO_MBCLEN(enc,code) (enc)->code_to_mbclen(code,enc) 368 #define ONIGENC_CODE_TO_MBC(enc,code,buf) (enc)->code_to_mbc(code,buf,enc) 306 369 #define ONIGENC_PROPERTY_NAME_TO_CTYPE(enc,p,end) \ 307 370 (enc)->property_name_to_ctype(enc,p,end) 308 371 309 #define ONIGENC_IS_CODE_CTYPE(enc,code,ctype) (enc)->is_code_ctype(code,ctype )372 #define ONIGENC_IS_CODE_CTYPE(enc,code,ctype) (enc)->is_code_ctype(code,ctype,enc) 310 373 311 374 #define ONIGENC_IS_CODE_NEWLINE(enc,code) \ … … 339 402 340 403 #define ONIGENC_GET_CTYPE_CODE_RANGE(enc,ctype,sbout,ranges) \ 341 (enc)->get_ctype_code_range(ctype,sbout,ranges )342 343 ONIG_EXTERN 344 OnigUChar* onigenc_step_back P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, int n));404 (enc)->get_ctype_code_range(ctype,sbout,ranges,enc) 405 406 ONIG_EXTERN 407 OnigUChar* onigenc_step_back(OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end, int n); 345 408 346 409 347 410 /* encoding API */ 348 411 ONIG_EXTERN 349 int onigenc_init P_((void)); 350 ONIG_EXTERN 351 int onigenc_set_default_encoding P_((OnigEncoding enc)); 352 ONIG_EXTERN 353 OnigEncoding onigenc_get_default_encoding P_((void)); 354 ONIG_EXTERN 355 void onigenc_set_default_caseconv_table P_((const OnigUChar* table)); 356 ONIG_EXTERN 357 OnigUChar* onigenc_get_right_adjust_char_head_with_prev P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar** prev)); 358 ONIG_EXTERN 359 OnigUChar* onigenc_get_prev_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s)); 360 ONIG_EXTERN 361 OnigUChar* onigenc_get_left_adjust_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s)); 362 ONIG_EXTERN 363 OnigUChar* onigenc_get_right_adjust_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s)); 364 ONIG_EXTERN 365 int onigenc_strlen P_((OnigEncoding enc, const OnigUChar* p, const OnigUChar* end)); 366 ONIG_EXTERN 367 int onigenc_strlen_null P_((OnigEncoding enc, const OnigUChar* p)); 368 ONIG_EXTERN 369 int onigenc_str_bytelen_null P_((OnigEncoding enc, const OnigUChar* p)); 412 int onigenc_init(void); 413 ONIG_EXTERN 414 int onigenc_set_default_encoding(OnigEncoding enc); 415 ONIG_EXTERN 416 OnigEncoding onigenc_get_default_encoding(void); 417 ONIG_EXTERN 418 OnigUChar* onigenc_get_right_adjust_char_head_with_prev(OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end, const OnigUChar** prev); 419 ONIG_EXTERN 420 OnigUChar* onigenc_get_prev_char_head(OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end); 421 ONIG_EXTERN 422 OnigUChar* onigenc_get_left_adjust_char_head(OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end); 423 ONIG_EXTERN 424 OnigUChar* onigenc_get_right_adjust_char_head(OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end); 425 ONIG_EXTERN 426 int onigenc_strlen(OnigEncoding enc, const OnigUChar* p, const OnigUChar* end); 427 ONIG_EXTERN 428 int onigenc_strlen_null(OnigEncoding enc, const OnigUChar* p); 429 ONIG_EXTERN 430 int onigenc_str_bytelen_null(OnigEncoding enc, const OnigUChar* p); 370 431 371 432 … … 375 436 /* config parameters */ 376 437 #define ONIG_NREGION 10 438 #define ONIG_MAX_CAPTURE_GROUP_NUM 32767 377 439 #define ONIG_MAX_BACKREF_NUM 1000 378 #define ONIG_MAX_CAPTURE_GROUP_NUM 32767379 440 #define ONIG_MAX_REPEAT_NUM 100000 380 441 #define ONIG_MAX_MULTI_BYTE_RANGES_NUM 10000 … … 401 462 #define ONIG_OPTION_NOTBOL (ONIG_OPTION_CAPTURE_GROUP << 1) 402 463 #define ONIG_OPTION_NOTEOL (ONIG_OPTION_NOTBOL << 1) 403 #define ONIG_OPTION_POSIX_REGION (ONIG_OPTION_NOTEOL << 1) 464 #define ONIG_OPTION_NOTBOS (ONIG_OPTION_NOTEOL << 1) 465 #define ONIG_OPTION_NOTEOS (ONIG_OPTION_NOTBOS << 1) 404 466 /* options (ctype range) */ 405 #define ONIG_OPTION_ASCII_RANGE (ONIG_OPTION_ POSIX_REGION<< 1)467 #define ONIG_OPTION_ASCII_RANGE (ONIG_OPTION_NOTEOS << 1) 406 468 #define ONIG_OPTION_POSIX_BRACKET_ALL_RANGE (ONIG_OPTION_ASCII_RANGE << 1) 407 469 #define ONIG_OPTION_WORD_BOUND_ALL_RANGE (ONIG_OPTION_POSIX_BRACKET_ALL_RANGE << 1) 408 470 /* options (newline) */ 409 471 #define ONIG_OPTION_NEWLINE_CRLF (ONIG_OPTION_WORD_BOUND_ALL_RANGE << 1) 410 #define ONIG_OPTION_NOTBOS (ONIG_OPTION_NEWLINE_CRLF << 1) 411 #define ONIG_OPTION_NOTEOS (ONIG_OPTION_NOTBOS << 1) 412 #define ONIG_OPTION_MAXBIT ONIG_OPTION_NOTEOS /* limit */ 472 #define ONIG_OPTION_MAXBIT ONIG_OPTION_NEWLINE_CRLF /* limit */ 413 473 414 474 #define ONIG_OPTION_ON(options,regopt) ((options) |= (regopt)) … … 425 485 } OnigSyntaxType; 426 486 427 ONIG_EXTERN OnigSyntaxType OnigSyntaxASIS;428 ONIG_EXTERN OnigSyntaxType OnigSyntaxPosixBasic;429 ONIG_EXTERN OnigSyntaxType OnigSyntaxPosixExtended;430 ONIG_EXTERN OnigSyntaxType OnigSyntaxEmacs;431 ONIG_EXTERN OnigSyntaxType OnigSyntaxGrep;432 ONIG_EXTERN OnigSyntaxType OnigSyntaxGnuRegex;433 ONIG_EXTERN OnigSyntaxType OnigSyntaxJava;434 ONIG_EXTERN OnigSyntaxType OnigSyntaxPerl58;435 ONIG_EXTERN OnigSyntaxType OnigSyntaxPerl58_NG;436 ONIG_EXTERN OnigSyntaxType OnigSyntaxPerl;437 ONIG_EXTERN OnigSyntaxType OnigSyntaxRuby;438 ONIG_EXTERN OnigSyntaxType OnigSyntaxPython;487 ONIG_EXTERN const OnigSyntaxType OnigSyntaxASIS; 488 ONIG_EXTERN const OnigSyntaxType OnigSyntaxPosixBasic; 489 ONIG_EXTERN const OnigSyntaxType OnigSyntaxPosixExtended; 490 ONIG_EXTERN const OnigSyntaxType OnigSyntaxEmacs; 491 ONIG_EXTERN const OnigSyntaxType OnigSyntaxGrep; 492 ONIG_EXTERN const OnigSyntaxType OnigSyntaxGnuRegex; 493 ONIG_EXTERN const OnigSyntaxType OnigSyntaxJava; 494 ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl58; 495 ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl58_NG; 496 ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl; 497 ONIG_EXTERN const OnigSyntaxType OnigSyntaxRuby; 498 ONIG_EXTERN const OnigSyntaxType OnigSyntaxPython; 439 499 440 500 /* predefined syntaxes (see regsyntax.c) */ … … 453 513 454 514 /* default syntax */ 455 ONIG_EXTERN OnigSyntaxType* OnigDefaultSyntax;515 ONIG_EXTERN const OnigSyntaxType* OnigDefaultSyntax; 456 516 #define ONIG_SYNTAX_DEFAULT OnigDefaultSyntax 457 517 … … 488 548 #define ONIG_SYN_OP_ESC_X_HEX2 (1U<<29) /* \xHH */ 489 549 #define ONIG_SYN_OP_ESC_X_BRACE_HEX8 (1U<<30) /* \x{7HHHHHHH} */ 490 #define ONIG_SYN_OP_ESC_O_BRACE_OCTAL (1U<<31) /* \o{OOO} */ /* NOTIMPL */550 #define ONIG_SYN_OP_ESC_O_BRACE_OCTAL (1U<<31) /* \o{OOO} */ 491 551 492 552 #define ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE (1U<<0) /* \Q...\E */ … … 512 572 #define ONIG_SYN_OP2_INEFFECTIVE_ESCAPE (1U<<20) /* \ */ 513 573 #define ONIG_SYN_OP2_ESC_CAPITAL_R_LINEBREAK (1U<<21) /* \R as (?>\x0D\x0A|[\x0A-\x0D\x{85}\x{2028}\x{2029}]) */ 514 #define ONIG_SYN_OP2_ESC_CAPITAL_X_EXTENDED_GRAPHEME_CLUSTER (1U<<22) /* \X as (?>\P{M}\p{M}*)*/574 #define ONIG_SYN_OP2_ESC_CAPITAL_X_EXTENDED_GRAPHEME_CLUSTER (1U<<22) /* \X */ 515 575 #define ONIG_SYN_OP2_ESC_V_VERTICAL_WHITESPACE (1U<<23) /* \v, \V -- Perl */ /* NOTIMPL */ 516 576 #define ONIG_SYN_OP2_ESC_H_HORIZONTAL_WHITESPACE (1U<<24) /* \h, \H -- Perl */ /* NOTIMPL */ … … 521 581 #define ONIG_SYN_OP2_QMARK_LPAREN_CONDITION (1U<<29) /* (?(cond)yes...|no...) */ 522 582 #define ONIG_SYN_OP2_QMARK_CAPITAL_P_NAMED_GROUP (1U<<30) /* (?P<name>...), (?P=name), (?P>name) -- Python/PCRE */ 523 #define ONIG_SYN_OP2_OPTION_JAVA (1U<<31) /* (?idmsux), (?-idmsux) */ /* NOTIMPL */ 583 #define ONIG_SYN_OP2_QMARK_TILDE_ABSENT (1U<<31) /* (?~...) */ 584 /* #define ONIG_SYN_OP2_OPTION_JAVA (1U<<xx) */ /* (?idmsux), (?-idmsux) */ /* NOTIMPL */ 524 585 525 586 /* syntax (behavior) */ … … 536 597 #define ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY (1U<<9) /* a{n}?=(?:a{n})? */ 537 598 #define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME_CALL (1U<<10) /* (?<x>)(?<x>)(?&x) */ 599 #define ONIG_SYN_USE_LEFT_MOST_NAMED_GROUP (1U<<11) /* (?<x>)(?<x>)\k<x> */ 538 600 539 601 /* syntax (behavior) in char class [...] */ … … 545 607 #define ONIG_SYN_WARN_CC_OP_NOT_ESCAPED (1U<<24) /* [,-,] */ 546 608 #define ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT (1U<<25) /* (?:a*)+ */ 609 #define ONIG_SYN_WARN_CC_DUP (1U<<26) /* [aa] */ 547 610 548 611 /* meta character specifiers (onig_set_meta_char()) */ … … 571 634 #define ONIGERR_UNEXPECTED_BYTECODE -14 572 635 #define ONIGERR_MATCH_STACK_LIMIT_OVER -15 636 #define ONIGERR_PARSE_DEPTH_LIMIT_OVER -16 573 637 #define ONIGERR_DEFAULT_ENCODING_IS_NOT_SET -21 574 638 #define ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR -22 … … 610 674 #define ONIGERR_INVALID_BACKREF -208 611 675 #define ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED -209 612 #define ONIGERR_TOO_SHORT_DIGITS -210 676 #define ONIGERR_TOO_MANY_CAPTURE_GROUPS -210 677 #define ONIGERR_TOO_SHORT_DIGITS -211 613 678 #define ONIGERR_TOO_LONG_WIDE_CHAR_VALUE -212 614 679 #define ONIGERR_EMPTY_GROUP_NAME -214 … … 622 687 #define ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY -222 623 688 #define ONIGERR_INVALID_CHAR_PROPERTY_NAME -223 624 #define ONIGERR_TOO_MANY_CAPTURE_GROUPS -224625 689 #define ONIGERR_INVALID_CODE_POINT_VALUE -400 626 690 #define ONIGERR_INVALID_WIDE_CHAR_VALUE -400 … … 630 694 631 695 /* errors related to thread */ 632 #define ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT -1001 696 /* #define ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT -1001 */ 633 697 634 698 … … 679 743 } OnigRepeatRange; 680 744 681 typedef void (*OnigWarnFunc) P_((const char* s));682 extern void onig_null_warn P_((const char* s));745 typedef void (*OnigWarnFunc)(const char* s); 746 extern void onig_null_warn(const char* s); 683 747 #define ONIG_NULL_WARN onig_null_warn 684 748 685 749 #define ONIG_CHAR_TABLE_SIZE 256 686 687 /* regex_t state */688 #define ONIG_STATE_NORMAL 0689 #define ONIG_STATE_SEARCHING 1690 #define ONIG_STATE_COMPILING -1691 #define ONIG_STATE_MODIFY -2692 693 #define ONIG_STATE(reg) \694 ((reg)->state > 0 ? ONIG_STATE_SEARCHING : (reg)->state)695 750 696 751 typedef struct re_pattern_buffer { … … 700 755 unsigned int alloc; /* allocated space for p */ 701 756 702 int state; /* normal, searching, compiling */703 757 int num_mem; /* used memory(...) num counted from 1 */ 704 758 int num_repeat; /* OP_REPEAT/OP_REPEAT_NG id-counter */ … … 711 765 int stack_pop_level; 712 766 int repeat_range_alloc; 767 768 OnigOptionType options; 769 713 770 OnigRepeatRange* repeat_range; 714 771 715 772 OnigEncoding enc; 716 OnigOptionType options;717 OnigSyntaxType* syntax;773 const OnigSyntaxType* syntax; 774 void* name_table; 718 775 OnigCaseFoldType case_fold_flag; 719 void* name_table;720 776 721 777 /* optimization info (string search, char-map and anchors) */ … … 741 797 742 798 #ifndef ONIG_ESCAPE_REGEX_T_COLLISION 743 799 typedef OnigRegexType regex_t; 744 800 #endif 745 801 … … 749 805 OnigEncoding pattern_enc; 750 806 OnigEncoding target_enc; 751 OnigSyntaxType* syntax;807 const OnigSyntaxType* syntax; 752 808 OnigOptionType option; 753 809 OnigCaseFoldType case_fold_flag; … … 756 812 /* Oniguruma Native API */ 757 813 ONIG_EXTERN 758 int onig_init P_((void)); 759 ONIG_EXTERN 760 int onig_error_code_to_str PV_((OnigUChar* s, OnigPosition err_code, ...)); 761 ONIG_EXTERN 762 void onig_set_warn_func P_((OnigWarnFunc f)); 763 ONIG_EXTERN 764 void onig_set_verb_warn_func P_((OnigWarnFunc f)); 765 ONIG_EXTERN 766 int onig_new P_((OnigRegex*, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo)); 767 ONIG_EXTERN 768 int onig_reg_init P_((OnigRegex reg, OnigOptionType option, OnigCaseFoldType case_fold_flag, OnigEncoding enc, OnigSyntaxType* syntax)); 769 ONIG_EXTERN 770 int onig_new_without_alloc P_((OnigRegex, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo)); 771 ONIG_EXTERN 772 int onig_new_deluxe P_((OnigRegex* reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo)); 773 ONIG_EXTERN 774 void onig_free P_((OnigRegex)); 775 ONIG_EXTERN 776 void onig_free_body P_((OnigRegex)); 777 ONIG_EXTERN 778 int onig_recompile P_((OnigRegex, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo)); 779 ONIG_EXTERN 780 int onig_recompile_deluxe P_((OnigRegex reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo)); 781 ONIG_EXTERN 782 OnigPosition onig_search P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option)); 783 ONIG_EXTERN 784 OnigPosition onig_search_gpos P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* global_pos, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option)); 785 ONIG_EXTERN 786 OnigPosition onig_match P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* at, OnigRegion* region, OnigOptionType option)); 787 ONIG_EXTERN 788 OnigRegion* onig_region_new P_((void)); 789 ONIG_EXTERN 790 void onig_region_init P_((OnigRegion* region)); 791 ONIG_EXTERN 792 void onig_region_free P_((OnigRegion* region, int free_self)); 793 ONIG_EXTERN 794 void onig_region_copy P_((OnigRegion* to, OnigRegion* from)); 795 ONIG_EXTERN 796 void onig_region_clear P_((OnigRegion* region)); 797 ONIG_EXTERN 798 int onig_region_resize P_((OnigRegion* region, int n)); 799 ONIG_EXTERN 800 int onig_region_set P_((OnigRegion* region, int at, int beg, int end)); 801 ONIG_EXTERN 802 int onig_name_to_group_numbers P_((OnigRegex reg, const OnigUChar* name, const OnigUChar* name_end, int** nums)); 803 ONIG_EXTERN 804 int onig_name_to_backref_number P_((OnigRegex reg, const OnigUChar* name, const OnigUChar* name_end, OnigRegion *region)); 805 ONIG_EXTERN 806 int onig_foreach_name P_((OnigRegex reg, int (*func)(const OnigUChar*, const OnigUChar*,int,int*,OnigRegex,void*), void* arg)); 807 ONIG_EXTERN 808 int onig_number_of_names P_((OnigRegex reg)); 809 ONIG_EXTERN 810 int onig_number_of_captures P_((OnigRegex reg)); 811 ONIG_EXTERN 812 int onig_number_of_capture_histories P_((OnigRegex reg)); 813 ONIG_EXTERN 814 OnigCaptureTreeNode* onig_get_capture_tree P_((OnigRegion* region)); 815 ONIG_EXTERN 816 int onig_capture_tree_traverse P_((OnigRegion* region, int at, int(*callback_func)(int,OnigPosition,OnigPosition,int,int,void*), void* arg)); 817 ONIG_EXTERN 818 int onig_noname_group_capture_is_active P_((OnigRegex reg)); 819 ONIG_EXTERN 820 OnigEncoding onig_get_encoding P_((OnigRegex reg)); 821 ONIG_EXTERN 822 OnigOptionType onig_get_options P_((OnigRegex reg)); 823 ONIG_EXTERN 824 OnigCaseFoldType onig_get_case_fold_flag P_((OnigRegex reg)); 825 ONIG_EXTERN 826 OnigSyntaxType* onig_get_syntax P_((OnigRegex reg)); 827 ONIG_EXTERN 828 int onig_set_default_syntax P_((OnigSyntaxType* syntax)); 829 ONIG_EXTERN 830 void onig_copy_syntax P_((OnigSyntaxType* to, const OnigSyntaxType* from)); 831 ONIG_EXTERN 832 unsigned int onig_get_syntax_op P_((OnigSyntaxType* syntax)); 833 ONIG_EXTERN 834 unsigned int onig_get_syntax_op2 P_((OnigSyntaxType* syntax)); 835 ONIG_EXTERN 836 unsigned int onig_get_syntax_behavior P_((OnigSyntaxType* syntax)); 837 ONIG_EXTERN 838 OnigOptionType onig_get_syntax_options P_((OnigSyntaxType* syntax)); 839 ONIG_EXTERN 840 void onig_set_syntax_op P_((OnigSyntaxType* syntax, unsigned int op)); 841 ONIG_EXTERN 842 void onig_set_syntax_op2 P_((OnigSyntaxType* syntax, unsigned int op2)); 843 ONIG_EXTERN 844 void onig_set_syntax_behavior P_((OnigSyntaxType* syntax, unsigned int behavior)); 845 ONIG_EXTERN 846 void onig_set_syntax_options P_((OnigSyntaxType* syntax, OnigOptionType options)); 847 ONIG_EXTERN 848 int onig_set_meta_char P_((OnigSyntaxType* syntax, unsigned int what, OnigCodePoint code)); 849 ONIG_EXTERN 850 void onig_copy_encoding P_((OnigEncoding to, OnigEncoding from)); 851 ONIG_EXTERN 852 OnigCaseFoldType onig_get_default_case_fold_flag P_((void)); 853 ONIG_EXTERN 854 int onig_set_default_case_fold_flag P_((OnigCaseFoldType case_fold_flag)); 855 ONIG_EXTERN 856 unsigned int onig_get_match_stack_limit_size P_((void)); 857 ONIG_EXTERN 858 int onig_set_match_stack_limit_size P_((unsigned int size)); 859 ONIG_EXTERN 860 int onig_end P_((void)); 861 ONIG_EXTERN 862 const char* onig_version P_((void)); 863 ONIG_EXTERN 864 const char* onig_copyright P_((void)); 814 int onig_initialize(OnigEncoding encodings[], int n); 815 ONIG_EXTERN 816 int onig_init(void); 817 ONIG_EXTERN 818 int onig_error_code_to_str(OnigUChar* s, OnigPosition err_code, ...); 819 ONIG_EXTERN 820 void onig_set_warn_func(OnigWarnFunc f); 821 ONIG_EXTERN 822 void onig_set_verb_warn_func(OnigWarnFunc f); 823 ONIG_EXTERN 824 int onig_new(OnigRegex*, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, const OnigSyntaxType* syntax, OnigErrorInfo* einfo); 825 ONIG_EXTERN 826 int onig_reg_init(OnigRegex reg, OnigOptionType option, OnigCaseFoldType case_fold_flag, OnigEncoding enc, const OnigSyntaxType* syntax); 827 ONIG_EXTERN 828 int onig_new_without_alloc(OnigRegex, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, const OnigSyntaxType* syntax, OnigErrorInfo* einfo); 829 ONIG_EXTERN 830 int onig_new_deluxe(OnigRegex* reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo); 831 ONIG_EXTERN 832 void onig_free(OnigRegex); 833 ONIG_EXTERN 834 void onig_free_body(OnigRegex); 835 ONIG_EXTERN 836 OnigPosition onig_scan(OnigRegex reg, const OnigUChar* str, const OnigUChar* end, OnigRegion* region, OnigOptionType option, int (*scan_callback)(OnigPosition, OnigPosition, OnigRegion*, void*), void* callback_arg); 837 ONIG_EXTERN 838 OnigPosition onig_search(OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option); 839 ONIG_EXTERN 840 OnigPosition onig_search_gpos(OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* global_pos, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option); 841 ONIG_EXTERN 842 OnigPosition onig_match(OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* at, OnigRegion* region, OnigOptionType option); 843 ONIG_EXTERN 844 OnigRegion* onig_region_new(void); 845 ONIG_EXTERN 846 void onig_region_init(OnigRegion* region); 847 ONIG_EXTERN 848 void onig_region_free(OnigRegion* region, int free_self); 849 ONIG_EXTERN 850 void onig_region_copy(OnigRegion* to, const OnigRegion* from); 851 ONIG_EXTERN 852 void onig_region_clear(OnigRegion* region); 853 ONIG_EXTERN 854 int onig_region_resize(OnigRegion* region, int n); 855 ONIG_EXTERN 856 int onig_region_set(OnigRegion* region, int at, int beg, int end); 857 ONIG_EXTERN 858 int onig_name_to_group_numbers(OnigRegex reg, const OnigUChar* name, const OnigUChar* name_end, int** nums); 859 ONIG_EXTERN 860 int onig_name_to_backref_number(OnigRegex reg, const OnigUChar* name, const OnigUChar* name_end, const OnigRegion *region); 861 ONIG_EXTERN 862 int onig_foreach_name(OnigRegex reg, int (*func)(const OnigUChar*, const OnigUChar*,int,int*,OnigRegex,void*), void* arg); 863 ONIG_EXTERN 864 int onig_number_of_names(const OnigRegexType *reg); 865 ONIG_EXTERN 866 int onig_number_of_captures(const OnigRegexType *reg); 867 ONIG_EXTERN 868 int onig_number_of_capture_histories(const OnigRegexType *reg); 869 ONIG_EXTERN 870 OnigCaptureTreeNode* onig_get_capture_tree(OnigRegion* region); 871 ONIG_EXTERN 872 int onig_capture_tree_traverse(OnigRegion* region, int at, int(*callback_func)(int,OnigPosition,OnigPosition,int,int,void*), void* arg); 873 ONIG_EXTERN 874 int onig_noname_group_capture_is_active(const OnigRegexType *reg); 875 ONIG_EXTERN 876 OnigEncoding onig_get_encoding(const OnigRegexType *reg); 877 ONIG_EXTERN 878 OnigOptionType onig_get_options(const OnigRegexType *reg); 879 ONIG_EXTERN 880 OnigCaseFoldType onig_get_case_fold_flag(const OnigRegexType *reg); 881 ONIG_EXTERN 882 const OnigSyntaxType* onig_get_syntax(const OnigRegexType *reg); 883 ONIG_EXTERN 884 int onig_set_default_syntax(const OnigSyntaxType* syntax); 885 ONIG_EXTERN 886 void onig_copy_syntax(OnigSyntaxType* to, const OnigSyntaxType* from); 887 ONIG_EXTERN 888 unsigned int onig_get_syntax_op(const OnigSyntaxType* syntax); 889 ONIG_EXTERN 890 unsigned int onig_get_syntax_op2(const OnigSyntaxType* syntax); 891 ONIG_EXTERN 892 unsigned int onig_get_syntax_behavior(const OnigSyntaxType* syntax); 893 ONIG_EXTERN 894 OnigOptionType onig_get_syntax_options(const OnigSyntaxType* syntax); 895 ONIG_EXTERN 896 void onig_set_syntax_op(OnigSyntaxType* syntax, unsigned int op); 897 ONIG_EXTERN 898 void onig_set_syntax_op2(OnigSyntaxType* syntax, unsigned int op2); 899 ONIG_EXTERN 900 void onig_set_syntax_behavior(OnigSyntaxType* syntax, unsigned int behavior); 901 ONIG_EXTERN 902 void onig_set_syntax_options(OnigSyntaxType* syntax, OnigOptionType options); 903 ONIG_EXTERN 904 int onig_set_meta_char(OnigSyntaxType* syntax, unsigned int what, OnigCodePoint code); 905 ONIG_EXTERN 906 void onig_copy_encoding(OnigEncodingType *to, OnigEncoding from); 907 ONIG_EXTERN 908 OnigCaseFoldType onig_get_default_case_fold_flag(void); 909 ONIG_EXTERN 910 int onig_set_default_case_fold_flag(OnigCaseFoldType case_fold_flag); 911 ONIG_EXTERN 912 unsigned int onig_get_match_stack_limit_size(void); 913 ONIG_EXTERN 914 int onig_set_match_stack_limit_size(unsigned int size); 915 ONIG_EXTERN 916 unsigned int onig_get_parse_depth_limit(void); 917 ONIG_EXTERN 918 int onig_set_parse_depth_limit(unsigned int depth); 919 ONIG_EXTERN 920 int onig_end(void); 921 ONIG_EXTERN 922 const char* onig_version(void); 923 ONIG_EXTERN 924 const char* onig_copyright(void); 925 926 RUBY_SYMBOL_EXPORT_END 865 927 866 928 #ifdef __cplusplus 929 # if 0 930 { /* satisfy cc-mode */ 931 # endif 867 932 } 868 933 #endif 869 934 870 #endif /* ONIG URUMA_H */935 #endif /* ONIGMO_H */
Note:
See TracChangeset
for help on using the changeset viewer.