152
int (*mbc_enc_len)(const UChar* p);
156
int (*mbc_enc_len)(const OnigUChar* p);
153
157
const char* name;
156
160
OnigAmbigType support_ambig_flag;
157
161
OnigMetaCharTableType meta_char_table;
158
int (*is_mbc_newline)(const UChar* p, const UChar* end);
159
OnigCodePoint (*mbc_to_code)(const UChar* p, const UChar* end);
162
int (*is_mbc_newline)(const OnigUChar* p, const OnigUChar* end);
163
OnigCodePoint (*mbc_to_code)(const OnigUChar* p, const OnigUChar* end);
160
164
int (*code_to_mbclen)(OnigCodePoint code);
161
int (*code_to_mbc)(OnigCodePoint code, UChar *buf);
162
int (*mbc_to_normalize)(OnigAmbigType flag, const UChar** pp, const UChar* end, UChar* to);
163
int (*is_mbc_ambiguous)(OnigAmbigType flag, const UChar** pp, const UChar* end);
164
int (*get_all_pair_ambig_codes)(OnigAmbigType flag, OnigPairAmbigCodes** acs);
165
int (*get_all_comp_ambig_codes)(OnigAmbigType flag, OnigCompAmbigCodes** acs);
165
int (*code_to_mbc)(OnigCodePoint code, OnigUChar *buf);
166
int (*mbc_to_normalize)(OnigAmbigType flag, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to);
167
int (*is_mbc_ambiguous)(OnigAmbigType flag, const OnigUChar** pp, const OnigUChar* end);
168
int (*get_all_pair_ambig_codes)(OnigAmbigType flag, const OnigPairAmbigCodes** acs);
169
int (*get_all_comp_ambig_codes)(OnigAmbigType flag, const OnigCompAmbigCodes** acs);
166
170
int (*is_code_ctype)(OnigCodePoint code, unsigned int ctype);
167
int (*get_ctype_code_range)(int ctype, OnigCodePoint* sb_range[], OnigCodePoint* mb_range[]);
168
UChar* (*left_adjust_char_head)(const UChar* start, const UChar* p);
169
int (*is_allowed_reverse_match)(const UChar* p, const UChar* end);
171
int (*get_ctype_code_range)(int ctype, const OnigCodePoint* sb_range[], const OnigCodePoint* mb_range[]);
172
OnigUChar* (*left_adjust_char_head)(const OnigUChar* start, const OnigUChar* p);
173
int (*is_allowed_reverse_match)(const OnigUChar* p, const OnigUChar* end);
170
174
} OnigEncodingType;
172
176
typedef OnigEncodingType* OnigEncoding;
334
340
int onigenc_is_code_ctype P_((OnigEncoding enc, OnigCodePoint code, int ctype));
336
int onigenc_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, UChar *buf));
338
int onigenc_mbc_to_normalize P_((OnigEncoding enc, OnigAmbigType flag, const UChar** pp, const UChar* end, UChar* buf));
340
int onigenc_is_mbc_ambiguous P_((OnigEncoding enc, OnigAmbigType flag, const UChar** pp, const UChar* end));
342
int onigenc_is_allowed_reverse_match P_((OnigEncoding enc, const UChar* s, const UChar* end));
342
int onigenc_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, OnigUChar *buf));
344
int onigenc_mbc_to_normalize P_((OnigEncoding enc, OnigAmbigType flag, const OnigUChar** pp, const OnigUChar* end, OnigUChar* buf));
346
int onigenc_is_mbc_ambiguous P_((OnigEncoding enc, OnigAmbigType flag, const OnigUChar** pp, const OnigUChar* end));
348
int onigenc_is_allowed_reverse_match P_((OnigEncoding enc, const OnigUChar* s, const OnigUChar* end));
344
350
#else /* ONIG_RUBY_M17N */
346
352
#define ONIGENC_NAME(enc) ((enc)->name)
348
354
#define ONIGENC_MBC_TO_NORMALIZE(enc,flag,pp,end,buf) \
349
(enc)->mbc_to_normalize(flag,(const UChar** )pp,end,buf)
355
(enc)->mbc_to_normalize(flag,(const OnigUChar** )pp,end,buf)
350
356
#define ONIGENC_IS_MBC_AMBIGUOUS(enc,flag,pp,end) \
351
(enc)->is_mbc_ambiguous(flag,(const UChar** )pp,end)
357
(enc)->is_mbc_ambiguous(flag,(const OnigUChar** )pp,end)
352
358
#define ONIGENC_SUPPORT_AMBIG_FLAG(enc) ((enc)->support_ambig_flag)
353
359
#define ONIGENC_IS_ALLOWED_REVERSE_MATCH(enc,s,end) \
354
360
(enc)->is_allowed_reverse_match(s,end)
405
411
(enc)->get_ctype_code_range(ctype,sbr,mbr)
408
UChar* onigenc_step_back P_((OnigEncoding enc, const UChar* start, const UChar* s, int n));
414
OnigUChar* onigenc_step_back P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, int n));
410
416
#endif /* is not ONIG_RUBY_M17N */
419
425
OnigEncoding onigenc_get_default_encoding P_(());
421
void onigenc_set_default_caseconv_table P_((const UChar* table));
423
UChar* onigenc_get_right_adjust_char_head_with_prev P_((OnigEncoding enc, const UChar* start, const UChar* s, const UChar** prev));
425
UChar* onigenc_get_prev_char_head P_((OnigEncoding enc, const UChar* start, const UChar* s));
427
UChar* onigenc_get_left_adjust_char_head P_((OnigEncoding enc, const UChar* start, const UChar* s));
429
UChar* onigenc_get_right_adjust_char_head P_((OnigEncoding enc, const UChar* start, const UChar* s));
431
int onigenc_strlen P_((OnigEncoding enc, const UChar* p, const UChar* end));
433
int onigenc_strlen_null P_((OnigEncoding enc, const UChar* p));
435
int onigenc_str_bytelen_null P_((OnigEncoding enc, const UChar* p));
427
void onigenc_set_default_caseconv_table P_((const OnigUChar* table));
429
OnigUChar* onigenc_get_right_adjust_char_head_with_prev P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar** prev));
431
OnigUChar* onigenc_get_prev_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s));
433
OnigUChar* onigenc_get_left_adjust_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s));
435
OnigUChar* onigenc_get_right_adjust_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s));
437
int onigenc_strlen P_((OnigEncoding enc, const OnigUChar* p, const OnigUChar* end));
439
int onigenc_strlen_null P_((OnigEncoding enc, const OnigUChar* p));
441
int onigenc_str_bytelen_null P_((OnigEncoding enc, const OnigUChar* p));
465
471
#define ONIG_OPTION_NOTBOL (ONIG_OPTION_CAPTURE_GROUP << 1)
466
472
#define ONIG_OPTION_NOTEOL (ONIG_OPTION_NOTBOL << 1)
467
473
#define ONIG_OPTION_POSIX_REGION (ONIG_OPTION_NOTEOL << 1)
474
#define ONIG_OPTION_MAXBIT ONIG_OPTION_POSIX_REGION /* limit */
469
476
#define ONIG_OPTION_ON(options,regopt) ((options) |= (regopt))
470
477
#define ONIG_OPTION_OFF(options,regopt) ((options) &= ~(regopt))
485
493
ONIG_EXTERN OnigSyntaxType OnigSyntaxGnuRegex;
486
494
ONIG_EXTERN OnigSyntaxType OnigSyntaxJava;
487
495
ONIG_EXTERN OnigSyntaxType OnigSyntaxPerl;
496
ONIG_EXTERN OnigSyntaxType OnigSyntaxPerl_NG;
488
497
ONIG_EXTERN OnigSyntaxType OnigSyntaxRuby;
490
499
/* predefined syntaxes (see regsyntax.c) */
500
#define ONIG_SYNTAX_ASIS (&OnigSyntaxASIS)
491
501
#define ONIG_SYNTAX_POSIX_BASIC (&OnigSyntaxPosixBasic)
492
502
#define ONIG_SYNTAX_POSIX_EXTENDED (&OnigSyntaxPosixExtended)
493
503
#define ONIG_SYNTAX_EMACS (&OnigSyntaxEmacs)
777
796
int onig_init P_((void));
779
int onig_error_code_to_str PV_((UChar* s, int err_code, ...));
798
int onig_error_code_to_str PV_((OnigUChar* s, int err_code, ...));
781
800
void onig_set_warn_func P_((OnigWarnFunc f));
783
802
void onig_set_verb_warn_func P_((OnigWarnFunc f));
785
int onig_new P_((regex_t**, const UChar* pattern, const UChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));
787
int onig_new_deluxe P_((regex_t** reg, const UChar* pattern, const UChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo));
789
void onig_free P_((regex_t*));
791
int onig_recompile P_((regex_t*, const UChar* pattern, const UChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));
793
int onig_recompile_deluxe P_((regex_t* reg, const UChar* pattern, const UChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo));
795
int onig_search P_((regex_t*, const UChar* str, const UChar* end, const UChar* start, const UChar* range, OnigRegion* region, OnigOptionType option));
797
int onig_match P_((regex_t*, const UChar* str, const UChar* end, const UChar* at, OnigRegion* region, OnigOptionType option));
804
int onig_new P_((OnigRegex*, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));
806
int onig_new_deluxe P_((OnigRegex* reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo));
808
void onig_free P_((OnigRegex));
810
int onig_recompile P_((OnigRegex, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));
812
int onig_recompile_deluxe P_((OnigRegex reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo));
814
int onig_search P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option));
816
int onig_match P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* at, OnigRegion* region, OnigOptionType option));
799
818
OnigRegion* onig_region_new P_((void));
811
830
int onig_region_set P_((OnigRegion* region, int at, int beg, int end));
813
int onig_name_to_group_numbers P_((regex_t* reg, const UChar* name, const UChar* name_end, int** nums));
815
int onig_name_to_backref_number P_((regex_t* reg, const UChar* name, const UChar* name_end, OnigRegion *region));
817
int onig_foreach_name P_((regex_t* reg, int (*func)(const UChar*, const UChar*,int,int*,regex_t*,void*), void* arg));
819
int onig_number_of_names P_((regex_t* reg));
821
int onig_number_of_captures P_((regex_t* reg));
823
int onig_number_of_capture_histories P_((regex_t* reg));
832
int onig_name_to_group_numbers P_((OnigRegex reg, const OnigUChar* name, const OnigUChar* name_end, int** nums));
834
int onig_name_to_backref_number P_((OnigRegex reg, const OnigUChar* name, const OnigUChar* name_end, OnigRegion *region));
836
int onig_foreach_name P_((OnigRegex reg, int (*func)(const OnigUChar*, const OnigUChar*,int,int*,OnigRegex,void*), void* arg));
838
int onig_number_of_names P_((OnigRegex reg));
840
int onig_number_of_captures P_((OnigRegex reg));
842
int onig_number_of_capture_histories P_((OnigRegex reg));
825
844
OnigCaptureTreeNode* onig_get_capture_tree P_((OnigRegion* region));
827
846
int onig_capture_tree_traverse P_((OnigRegion* region, int at, int(*callback_func)(int,int,int,int,int,void*), void* arg));
829
OnigEncoding onig_get_encoding P_((regex_t* reg));
831
OnigOptionType onig_get_options P_((regex_t* reg));
833
OnigAmbigType onig_get_ambig_flag P_((regex_t* reg));
835
OnigSyntaxType* onig_get_syntax P_((regex_t* reg));
848
int onig_noname_group_capture_is_active P_((OnigRegex reg));
850
OnigEncoding onig_get_encoding P_((OnigRegex reg));
852
OnigOptionType onig_get_options P_((OnigRegex reg));
854
OnigAmbigType onig_get_ambig_flag P_((OnigRegex reg));
856
OnigSyntaxType* onig_get_syntax P_((OnigRegex reg));
837
858
int onig_set_default_syntax P_((OnigSyntaxType* syntax));