1Oniguruma API Version 6.9.4 2019/09/30 2 3#include <oniguruma.h> 4 5 6# int onig_initialize(OnigEncoding use_encodings[], int num_encodings) 7 8 Initialize library. 9 10 You have to call it explicitly. 11 12 * onig_init() is deprecated. 13 14 arguments 15 1 use_encodings: array of encodings used in application. 16 2 num_encodings: number of encodings. 17 18 19# int onig_error_code_to_str(UChar* err_buf, int err_code, ...) 20 21 Get error message string. 22 If this function is used for onig_new(), 23 don't call this after the pattern argument of onig_new() is freed. 24 25 normal return: error message string length 26 27 arguments 28 1 err_buf: error message string buffer. 29 (required size: ONIG_MAX_ERROR_MESSAGE_LEN) 30 2 err_code: error code returned by other API functions. 31 3 err_info (optional): error info returned by onig_new(). 32 33 34# void onig_set_warn_func(OnigWarnFunc func) 35 36 Set warning function. 37 38 WARNING: 39 '[', '-', ']' in character class without escape. 40 ']' in pattern without escape. 41 42 arguments 43 1 func: function pointer. void (*func)(char* warning_message) 44 45 46# void onig_set_verb_warn_func(OnigWarnFunc func) 47 48 Set verbose warning function. 49 50 WARNING: 51 redundant nested repeat operator. 52 53 arguments 54 1 func: function pointer. void (*func)(char* warning_message) 55 56 57# int onig_new(regex_t** reg, const UChar* pattern, const UChar* pattern_end, 58 OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, 59 OnigErrorInfo* err_info) 60 61 Create a regex object. 62 63 normal return: ONIG_NORMAL 64 65 arguments 66 1 reg: return regex object's address. 67 2 pattern: regex pattern string. 68 3 pattern_end: terminate address of pattern. (pattern + pattern length) 69 4 option: compile time options. 70 71 ONIG_OPTION_NONE no option 72 ONIG_OPTION_SINGLELINE '^' -> '\A', '$' -> '\Z' 73 ONIG_OPTION_MULTILINE '.' match with newline 74 ONIG_OPTION_IGNORECASE ambiguity match on 75 ONIG_OPTION_EXTEND extended pattern form 76 ONIG_OPTION_FIND_LONGEST find longest match 77 ONIG_OPTION_FIND_NOT_EMPTY ignore empty match 78 ONIG_OPTION_NEGATE_SINGLELINE 79 clear ONIG_OPTION_SINGLELINE which is enabled on 80 ONIG_SYNTAX_POSIX_BASIC, ONIG_SYNTAX_POSIX_EXTENDED, 81 ONIG_SYNTAX_PERL, ONIG_SYNTAX_PERL_NG, ONIG_SYNTAX_JAVA 82 83 ONIG_OPTION_DONT_CAPTURE_GROUP only named group captured. 84 ONIG_OPTION_CAPTURE_GROUP named and no-named group captured. 85 86 ONIG_OPTION_WORD_IS_ASCII ASCII only word (\w, \p{Word}, [[:word:]]) 87 ASCII only word bound (\b) 88 ONIG_OPTION_DIGIT_IS_ASCII ASCII only digit (\d, \p{Digit}, [[:digit:]]) 89 ONIG_OPTION_SPACE_IS_ASCII ASCII only space (\s, \p{Space}, [[:space:]]) 90 ONIG_OPTION_POSIX_IS_ASCII ASCII only POSIX properties 91 (includes word, digit, space) 92 (alnum, alpha, blank, cntrl, digit, graph, 93 lower, print, punct, space, upper, xdigit, 94 word) 95 ONIG_OPTION_TEXT_SEGMENT_EXTENDED_GRAPHEME_CLUSTER Extended Grapheme Cluster mode 96 ONIG_OPTION_TEXT_SEGMENT_WORD Word mode 97 98 5 enc: character encoding. 99 100 ONIG_ENCODING_ASCII ASCII 101 ONIG_ENCODING_ISO_8859_1 ISO 8859-1 102 ONIG_ENCODING_ISO_8859_2 ISO 8859-2 103 ONIG_ENCODING_ISO_8859_3 ISO 8859-3 104 ONIG_ENCODING_ISO_8859_4 ISO 8859-4 105 ONIG_ENCODING_ISO_8859_5 ISO 8859-5 106 ONIG_ENCODING_ISO_8859_6 ISO 8859-6 107 ONIG_ENCODING_ISO_8859_7 ISO 8859-7 108 ONIG_ENCODING_ISO_8859_8 ISO 8859-8 109 ONIG_ENCODING_ISO_8859_9 ISO 8859-9 110 ONIG_ENCODING_ISO_8859_10 ISO 8859-10 111 ONIG_ENCODING_ISO_8859_11 ISO 8859-11 112 ONIG_ENCODING_ISO_8859_13 ISO 8859-13 113 ONIG_ENCODING_ISO_8859_14 ISO 8859-14 114 ONIG_ENCODING_ISO_8859_15 ISO 8859-15 115 ONIG_ENCODING_ISO_8859_16 ISO 8859-16 116 ONIG_ENCODING_UTF8 UTF-8 117 ONIG_ENCODING_UTF16_BE UTF-16BE 118 ONIG_ENCODING_UTF16_LE UTF-16LE 119 ONIG_ENCODING_UTF32_BE UTF-32BE 120 ONIG_ENCODING_UTF32_LE UTF-32LE 121 ONIG_ENCODING_EUC_JP EUC-JP 122 ONIG_ENCODING_EUC_TW EUC-TW 123 ONIG_ENCODING_EUC_KR EUC-KR 124 ONIG_ENCODING_EUC_CN EUC-CN 125 ONIG_ENCODING_SJIS Shift_JIS 126 ONIG_ENCODING_KOI8_R KOI8-R 127 ONIG_ENCODING_CP1251 CP1251 128 ONIG_ENCODING_BIG5 Big5 129 ONIG_ENCODING_GB18030 GB18030 130 131 or any OnigEncodingType data address defined by user. 132 133 6 syntax: address of pattern syntax definition. 134 135 ONIG_SYNTAX_ASIS plain text 136 ONIG_SYNTAX_POSIX_BASIC POSIX Basic RE 137 ONIG_SYNTAX_POSIX_EXTENDED POSIX Extended RE 138 ONIG_SYNTAX_EMACS Emacs 139 ONIG_SYNTAX_GREP grep 140 ONIG_SYNTAX_GNU_REGEX GNU regex 141 ONIG_SYNTAX_JAVA Java (Sun java.util.regex) 142 ONIG_SYNTAX_PERL Perl 143 ONIG_SYNTAX_PERL_NG Perl + named group 144 ONIG_SYNTAX_RUBY Ruby 145 ONIG_SYNTAX_ONIGURUMA Oniguruma 146 ONIG_SYNTAX_DEFAULT default (== ONIG_SYNTAX_ONIGURUMA) 147 onig_set_default_syntax() 148 149 or any OnigSyntaxType data address defined by user. 150 151 7 err_info: address for return optional error info. 152 Use this value as 3rd argument of onig_error_code_to_str(). 153 154 155 156# int onig_new_without_alloc(regex_t* reg, const UChar* pattern, 157 const UChar* pattern_end, 158 OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, 159 OnigErrorInfo* err_info) 160 161 Create a regex object. 162 reg object area is not allocated in this function. 163 164 normal return: ONIG_NORMAL 165 166 167 168# int onig_new_deluxe(regex_t** reg, const UChar* pattern, const UChar* pattern_end, 169 OnigCompileInfo* ci, OnigErrorInfo* einfo) 170 171 This function is deprecated, and it does not allow the case where 172 the encoding of pattern and target is different. 173 174 Create a regex object. 175 This function is deluxe version of onig_new(). 176 177 normal return: ONIG_NORMAL 178 179 arguments 180 1 reg: return address of regex object. 181 2 pattern: regex pattern string. 182 3 pattern_end: terminate address of pattern. (pattern + pattern length) 183 4 ci: compile time info. 184 185 ci->num_of_elements: number of elements in ci. (current version: 5) 186 ci->pattern_enc: pattern string character encoding. 187 ci->target_enc: target string character encoding. 188 ci->syntax: address of pattern syntax definition. 189 ci->option: compile time option. 190 ci->case_fold_flag: character matching case fold bit flag for 191 ONIG_OPTION_IGNORECASE mode. 192 193 ONIGENC_CASE_FOLD_MIN: minimum 194 ONIGENC_CASE_FOLD_DEFAULT: minimum 195 onig_set_default_case_fold_flag() 196 197 5 err_info: address for return optional error info. 198 Use this value as 3rd argument of onig_error_code_to_str(). 199 200 201 Different character encoding combination is allowed for 202 the following cases only. 203 204 pattern_enc: ASCII, ISO_8859_1 205 target_enc: UTF16_BE, UTF16_LE, UTF32_BE, UTF32_LE 206 207 pattern_enc: UTF16_BE/LE 208 target_enc: UTF16_LE/BE 209 210 pattern_enc: UTF32_BE/LE 211 target_enc: UTF32_LE/BE 212 213 214# void onig_free(regex_t* reg) 215 216 Free memory used by regex object. 217 218 arguments 219 1 reg: regex object. 220 221 222# void onig_free_body(regex_t* reg) 223 224 Free memory used by regex object. (Except reg oneself.) 225 226 arguments 227 1 reg: regex object. 228 229 230# OnigMatchParam* onig_new_match_param() 231 232 Allocate a OnigMatchParam object and initialize the contents by 233 onig_initialize_match_param(). 234 235 236# void onig_free_match_param(OnigMatchParam* mp) 237 238 Free memory used by a OnigMatchParam object. 239 240 arguments 241 1 mp: OnigMatchParam object 242 243 244# void onig_initialize_match_param(OnigMatchParam* mp) 245 246 Set match-param fields to default values. 247 Match-param is used in onig_match_with_param() and onig_search_with_param(). 248 249 arguments 250 1 mp: match-param pointer 251 252 253# int onig_set_match_stack_limit_size_of_match_param(OnigMatchParam* mp, unsigned int limit) 254 255 Set a maximum number of match-stack depth. 256 0 means unlimited. 257 258 arguments 259 1 mp: match-param pointer 260 2 limit: number of limit 261 262 normal return: ONIG_NORMAL 263 264 265# int onig_set_retry_limit_in_match_of_match_param(OnigMatchParam* mp, unsigned long limit) 266 267 Set a retry limit count of a match process. 268 269 arguments 270 1 mp: match-param pointer 271 2 limit: number of limit 272 273 normal return: ONIG_NORMAL 274 275 276# int onig_set_progress_callout_of_match_param(OnigMatchParam* mp, OnigCalloutFunc f) 277 278 Set a function for callouts of contents in progress. 279 If 0 (NULL) is set, never called in progress. 280 281 arguments 282 1 mp: match-param pointer 283 2 f: function 284 285 normal return: ONIG_NORMAL 286 287 288# int onig_set_retraction_callout_of_match_param(OnigMatchParam* mp, OnigCalloutFunc f) 289 290 Set a function for callouts of contents in retraction (backtrack). 291 If 0 (NULL) is set, never called in retraction. 292 293 arguments 294 1 mp: match-param pointer 295 2 f: function 296 297 normal return: ONIG_NORMAL 298 299 300 301# int onig_search(regex_t* reg, const UChar* str, const UChar* end, const UChar* start, 302 const UChar* range, OnigRegion* region, OnigOptionType option) 303 304 Search string and return search result and matching region. 305 Do not pass invalid byte string in the regex character encoding. 306 307 normal return: match position offset (i.e. p - str >= 0) 308 not found: ONIG_MISMATCH (< 0) 309 error: error code (< 0) 310 311 arguments 312 1 reg: regex object 313 2 str: target string 314 3 end: terminate address of target string 315 4 start: search start address of target string 316 5 range: search terminate address of target string 317 in forward search (start <= searched string < range) 318 in backward search (range <= searched string <= start) 319 6 region: address for return group match range info (NULL is allowed) 320 7 option: search time option 321 322 ONIG_OPTION_NOTBOL string head(str) isn't considered as begin of line 323 ONIG_OPTION_NOTEOL string end (end) isn't considered as end of line 324 ONIG_OPTION_POSIX_REGION region argument is regmatch_t[] of POSIX API. 325 326 327# int onig_search_with_param(regex_t* reg, const UChar* str, const UChar* end, 328 const UChar* start, const UChar* range, OnigRegion* region, 329 OnigOptionType option, OnigMatchParam* mp) 330 331 Search string and return search result and matching region. 332 Do not pass invalid byte string in the regex character encoding. 333 334 arguments 335 1-7: same as onig_search() 336 8 mp: match parameter values (match_stack_limit, retry_limit_in_match) 337 338 339# int onig_match(regex_t* reg, const UChar* str, const UChar* end, const UChar* at, 340 OnigRegion* region, OnigOptionType option) 341 342 Match string and return result and matching region. 343 Do not pass invalid byte string in the regex character encoding. 344 345 normal return: match length (>= 0) 346 not match: ONIG_MISMATCH (< 0) 347 error: error code (< 0) 348 349 arguments 350 1 reg: regex object 351 2 str: target string 352 3 end: terminate address of target string 353 4 at: match address of target string 354 5 region: address for return group match range info (NULL is allowed) 355 6 option: search time option 356 357 ONIG_OPTION_NOTBOL string head(str) isn't considered as begin of line 358 ONIG_OPTION_NOTEOL string end (end) isn't considered as end of line 359 ONIG_OPTION_POSIX_REGION region argument is regmatch_t[] type of POSIX API. 360 361 362# int onig_match_with_param(regex_t* reg, const UChar* str, const UChar* end, 363 const UChar* at, OnigRegion* region, 364 OnigOptionType option, OnigMatchParam* mp) 365 366 Match string and return result and matching region. 367 Do not pass invalid byte string in the regex character encoding. 368 369 arguments 370 1-6: same as onig_match() 371 7 mp: match parameter values (match_stack_limit, retry_limit_in_match) 372 373 374# int onig_scan(regex_t* reg, const UChar* str, const UChar* end, 375 OnigRegion* region, OnigOptionType option, 376 int (*scan_callback)(int, int, OnigRegion*, void*), 377 void* callback_arg) 378 379 Scan string and callback with matching region. 380 Do not pass invalid byte string in the regex character encoding. 381 382 normal return: number of matching times 383 error: error code 384 interruption: return value of callback function (!= 0) 385 386 arguments 387 1 reg: regex object 388 2 str: target string 389 3 end: terminate address of target string 390 4 region: address for return group match range info (NULL is allowed) 391 5 option: search time option 392 6 scan_callback: callback function (defined by user) 393 7 callback_arg: optional argument passed to callback 394 395 396# int onig_regset_new(OnigRegSet** rset, int n, regex_t* regs[]) 397 398 Create a regset object. 399 All regex objects must have the same character encoding. 400 All regex objects are prohibited from having the ONIG_OPTION_FIND_LONGEST option. 401 402 arguments 403 1 rset: return address of regset object 404 2 n: number of regex in regs 405 3 regs: array of regex 406 407 normal return: ONIG_NORMAL 408 409 410# int onig_regset_add(OnigRegSet* set, regex_t* reg) 411 412 Add a regex into regset. 413 The regex object must have the same character encoding with the regset. 414 The regex object is prohibited from having the ONIG_OPTION_FIND_LONGEST option. 415 416 arguments 417 1 set: regset object 418 2 reg: regex object 419 420 normal return: ONIG_NORMAL 421 422 423# int onig_regset_replace(OnigRegSet* set, int at, regex_t* reg) 424 425 Replace a regex in regset with another one. 426 If the reg argument value is NULL, then remove at-th regex. (and indexes of other regexes are changed) 427 428 arguments 429 1 set: regset object 430 2 at: index of regex (zero origin) 431 3 reg: regex object 432 433 normal return: ONIG_NORMAL 434 435 436# void onig_regset_free(OnigRegSet* set) 437 438 Free memory used by regset object and regex objects in the regset. 439 If the same regex object is registered twice, the situation becomes destructive. 440 441 arguments 442 1 set: regset object 443 444 445# int onig_regset_number_of_regex(OnigRegSet* set) 446 447 Returns number of regex objects in the regset. 448 449 arguments 450 1 set: regset object 451 452 453# regex_t* onig_regset_get_regex(OnigRegSet* set, int at) 454 455 Returns the regex object corresponding to the at-th regex. 456 457 arguments 458 1 set: regset object 459 2 at: index of regex array (zero origin) 460 461 462# OnigRegion* onig_regset_get_region(OnigRegSet* set, int at) 463 464 Returns the region object corresponding to the at-th regex. 465 466 arguments 467 1 set: regset object 468 2 at: index of regex array (zero origin) 469 470 471# int onig_regset_search(OnigRegSet* set, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegSetLead lead, OnigOptionType option, int* rmatch_pos) 472 473 Perform a search with regset. 474 475 return value: 476 normal return: index of match regex (zero origin) 477 not found: ONIG_MISMATCH (< 0) 478 error: error code (< 0) 479 480 arguments 481 1 set: regset object 482 2 str: target string 483 3 end: terminate address of target string 484 4 start: search start address of target string 485 5 range: search terminate address of target string 486 6 lead: outer loop element 487 ONIG_REGSET_POSITION_LEAD (returns most left position) 488 ONIG_REGSET_REGEX_LEAD (returns most left position) 489 ONIG_REGSET_PRIORITY_TO_REGEX_ORDER (returns first match regex) 490 7 option: search time option 491 ONIG_OPTION_NOTBOL string head(str) isn't considered as begin of line 492 ONIG_OPTION_NOTEOL string end (end) isn't considered as end of line 493 8 rmatch_pos: return address of match position (match_address - str) 494 495 * ONIG_REGSET_POSITION_LEAD and ONIG_REGSET_REGEX_LEAD return the same result. 496 These differences only appear in search time. 497 In most cases, ONIG_REGSET_POSITION_LEAD seems to be faster. 498 499 500# int onig_regset_search_with_param(OnigRegSet* set, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegSetLead lead, OnigOptionType option, OnigMatchParam* mps[], int* rmatch_pos) 501 502 Perform a search with regset and match-params. 503 504 return value: 505 normal return: index of match regex (zero origin) 506 not found: ONIG_MISMATCH (< 0) 507 error: error code (< 0) 508 509 arguments 510 1 set: regset object 511 2 str: target string 512 3 end: terminate address of target string 513 4 start: search start address of target string 514 5 range: search terminate address of target string 515 6 lead: outer loop element 516 ONIG_REGSET_POSITION_LEAD (returns most left position) 517 ONIG_REGSET_REGEX_LEAD (returns most left position) 518 ONIG_REGSET_PRIORITY_TO_REGEX_ORDER (returns first match regex) 519 7 option: search time option 520 ONIG_OPTION_NOTBOL string head(str) isn't considered as begin of line 521 ONIG_OPTION_NOTEOL string end (end) isn't considered as end of line 522 8 mps: array of match-params 523 9 rmatch_pos: return address of match position (match_address - str) 524 525 526# OnigRegion* onig_region_new(void) 527 528 Create a region. 529 530 531# void onig_region_free(OnigRegion* region, int free_self) 532 533 Free memory used by region. 534 535 arguments 536 1 region: target region 537 2 free_self: [1: free all, 0: free memory used in region but not self] 538 539 540# void onig_region_copy(OnigRegion* to, OnigRegion* from) 541 542 Copy contents of region. 543 544 arguments 545 1 to: target region 546 2 from: source region 547 548 549# void onig_region_clear(OnigRegion* region) 550 551 Clear contents of region. 552 553 arguments 554 1 region: target region 555 556 557# int onig_region_resize(OnigRegion* region, int n) 558 559 Resize group range area of region. 560 561 normal return: ONIG_NORMAL 562 563 arguments 564 1 region: target region 565 2 n: new size 566 567 568# int onig_name_to_group_numbers(regex_t* reg, const UChar* name, const UChar* name_end, 569 int** num_list) 570 571 Return the group number list of the name. 572 Named subexp is defined by (?<name>....). 573 574 normal return: number of groups for the name. 575 (ex. /(?<x>..)(?<x>..)/ ==> 2) 576 name not found: -1 577 578 arguments 579 1 reg: regex object. 580 2 name: group name. 581 3 name_end: terminate address of group name. 582 4 num_list: return list of group number. 583 584 585# int onig_name_to_backref_number(regex_t* reg, const UChar* name, const UChar* name_end, 586 OnigRegion *region) 587 588 Return the group number corresponding to the named backref (\k<name>). 589 If two or more regions for the groups of the name are effective, 590 the greatest number in it is obtained. 591 592 normal return: group number. 593 594 arguments 595 1 reg: regex object. 596 2 name: group name. 597 3 name_end: terminate address of group name. 598 4 region: search/match result region. 599 600 601# int onig_foreach_name(regex_t* reg, 602 int (*func)(const UChar*, const UChar*, int,int*,regex_t*,void*), 603 void* arg) 604 605 Iterate function call for all names. 606 607 normal return: 0 608 error: func's return value. 609 610 arguments 611 1 reg: regex object. 612 2 func: callback function. 613 func(name, name_end, <number of groups>, <group number's list>, 614 reg, arg); 615 if func does not return 0, then iteration is stopped. 616 3 arg: argument for func. 617 618 619# int onig_number_of_names(regex_t* reg) 620 621 Return the number of names defined in the pattern. 622 Multiple definitions of one name is counted as one. 623 624 arguments 625 1 reg: regex object. 626 627 628# OnigEncoding onig_get_encoding(regex_t* reg) 629# OnigOptionType onig_get_options(regex_t* reg) 630# OnigCaseFoldType onig_get_case_fold_flag(regex_t* reg) 631# OnigSyntaxType* onig_get_syntax(regex_t* reg) 632 633 Return a value of the regex object. 634 635 arguments 636 1 reg: regex object. 637 638 639# int onig_number_of_captures(regex_t* reg) 640 641 Return the number of capture group in the pattern. 642 643 arguments 644 1 reg: regex object. 645 646 647# int onig_number_of_capture_histories(regex_t* reg) 648 649 Return the number of capture history defined in the pattern. 650 651 You can't use capture history if ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY 652 is disabled in the pattern syntax.(disabled in the default syntax) 653 654 arguments 655 1 reg: regex object. 656 657 658 659# OnigCaptureTreeNode* onig_get_capture_tree(OnigRegion* region) 660 661 Return the root node of capture history data tree. 662 663 This value is undefined if matching has faild. 664 665 arguments 666 1 region: matching result. 667 668 669# int onig_capture_tree_traverse(OnigRegion* region, int at, 670 int(*func)(int,int,int,int,int,void*), void* arg) 671 672 Traverse and callback in capture history data tree. 673 674 normal return: 0 675 error: callback func's return value. 676 677 arguments 678 1 region: match region data. 679 2 at: callback position. 680 681 ONIG_TRAVERSE_CALLBACK_AT_FIRST: callback first, then traverse children. 682 ONIG_TRAVERSE_CALLBACK_AT_LAST: traverse children first, then callback. 683 ONIG_TRAVERSE_CALLBACK_AT_BOTH: callback first, then traverse children, 684 and at last callback again. 685 686 3 func: callback function. 687 if func does not return 0, then traverse is stopped. 688 689 int func(int group, int beg, int end, int level, int at, 690 void* arg) 691 692 group: group number 693 beg: capture start position 694 end: capture end position 695 level: nest level (from 0) 696 at: callback position 697 ONIG_TRAVERSE_CALLBACK_AT_FIRST 698 ONIG_TRAVERSE_CALLBACK_AT_LAST 699 arg: optional callback argument 700 701 4 arg; optional callback argument. 702 703 704# int onig_noname_group_capture_is_active(regex_t* reg) 705 706 Return noname group capture activity. 707 708 active: 1 709 inactive: 0 710 711 arguments 712 1 reg: regex object. 713 714 if option ONIG_OPTION_DONT_CAPTURE_GROUP == ON 715 --> inactive 716 717 if the regex pattern have named group 718 and syntax ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP == ON 719 and option ONIG_OPTION_CAPTURE_GROUP == OFF 720 --> inactive 721 722 else --> active 723 724 725# UChar* onigenc_get_prev_char_head(OnigEncoding enc, const UChar* start, const UChar* s) 726 727 Return previous character head address. 728 729 arguments 730 1 enc: character encoding 731 2 start: string address 732 3 s: target address of string 733 734 735# UChar* onigenc_get_left_adjust_char_head(OnigEncoding enc, 736 const UChar* start, const UChar* s) 737 738 Return left-adjusted head address of a character. 739 740 arguments 741 1 enc: character encoding 742 2 start: string address 743 3 s: target address of string 744 745 746# UChar* onigenc_get_right_adjust_char_head(OnigEncoding enc, 747 const UChar* start, const UChar* s) 748 749 Return right-adjusted head address of a character. 750 751 arguments 752 1 enc: character encoding 753 2 start: string address 754 3 s: target address of string 755 756 757# int onigenc_strlen(OnigEncoding enc, const UChar* s, const UChar* end) 758 759 Return number of characters in the string. 760 761 762# int onigenc_strlen_null(OnigEncoding enc, const UChar* s) 763 764 Return number of characters in the string. 765 Do not pass invalid byte string in the character encoding. 766 767 768# int onigenc_str_bytelen_null(OnigEncoding enc, const UChar* s) 769 770 Return number of bytes in the string. 771 Do not pass invalid byte string in the character encoding. 772 773 774# int onig_set_default_syntax(OnigSyntaxType* syntax) 775 776 Set default syntax. 777 778 arguments 779 1 syntax: address of pattern syntax definition. 780 781 782# void onig_copy_syntax(OnigSyntaxType* to, OnigSyntaxType* from) 783 784 Copy syntax. 785 786 arguments 787 1 to: destination address. 788 2 from: source address. 789 790 791# unsigned int onig_get_syntax_op(OnigSyntaxType* syntax) 792# unsigned int onig_get_syntax_op2(OnigSyntaxType* syntax) 793# unsigned int onig_get_syntax_behavior(OnigSyntaxType* syntax) 794# OnigOptionType onig_get_syntax_options(OnigSyntaxType* syntax) 795 796# void onig_set_syntax_op(OnigSyntaxType* syntax, unsigned int op) 797# void onig_set_syntax_op2(OnigSyntaxType* syntax, unsigned int op2) 798# void onig_set_syntax_behavior(OnigSyntaxType* syntax, unsigned int behavior) 799# void onig_set_syntax_options(OnigSyntaxType* syntax, OnigOptionType options) 800 801 Get/Set elements of the syntax. 802 803 arguments 804 1 syntax: syntax 805 2 op, op2, behavior, options: value of element. 806 807 808# void onig_copy_encoding(OnigEncoding to, OnigEncoding from) 809 810 Copy encoding. 811 812 arguments 813 1 to: destination address. 814 2 from: source address. 815 816 817# int onig_set_meta_char(OnigSyntaxType* syntax, unsigned int what, 818 OnigCodePoint code) 819 820 Set a variable meta character to the code point value. 821 Except for an escape character, this meta characters specification 822 is not work, if ONIG_SYN_OP_VARIABLE_META_CHARACTERS is not effective 823 by the syntax. (Build-in syntaxes are not effective.) 824 825 normal return: ONIG_NORMAL 826 827 arguments 828 1 syntax: target syntax 829 2 what: specifies which meta character it is. 830 831 ONIG_META_CHAR_ESCAPE 832 ONIG_META_CHAR_ANYCHAR 833 ONIG_META_CHAR_ANYTIME 834 ONIG_META_CHAR_ZERO_OR_ONE_TIME 835 ONIG_META_CHAR_ONE_OR_MORE_TIME 836 ONIG_META_CHAR_ANYCHAR_ANYTIME 837 838 3 code: meta character or ONIG_INEFFECTIVE_META_CHAR. 839 840 841# OnigCaseFoldType onig_get_default_case_fold_flag() 842 843 Get default case fold flag. 844 845 846# int onig_set_default_case_fold_flag(OnigCaseFoldType case_fold_flag) 847 848 Set default case fold flag. 849 850 1 case_fold_flag: case fold flag 851 852 853# unsigned int onig_get_match_stack_limit_size(void) 854 855 Return the maximum number of stack size. 856 (default: 0 == unlimited) 857 858 859# int onig_set_match_stack_limit_size(unsigned int size) 860 861 Set the maximum number of stack size. 862 (size = 0: unlimited) 863 864 normal return: ONIG_NORMAL 865 866 867# unsigned long onig_get_retry_limit_in_match(void) 868 869 Return the limit of retry counts in matching process. 870 (default: 10000000) 871 872 normal return: limit value 873 874 875# int onig_set_retry_limit_in_match(unsigned long n) 876 877 Set the limit of retry counts in matching process. 878 879 normal return: ONIG_NORMAL 880 881 882# OnigCalloutFunc onig_get_progress_callout(void) 883 884 Get a function for callouts of contents in progress. 885 886 887# int onig_set_progress_callout(OnigCalloutFunc f) 888 889 Set a function for callouts of contents in progress. 890 If 0 (NULL) is set, never called in progress. 891 892 normal return: ONIG_NORMAL 893 894 895# OnigCalloutFunc onig_get_retraction_callout(void) 896 897 Get a function for callouts of contents in retraction (backtrack). 898 899 900# int onig_set_retraction_callout(OnigCalloutFunc f) 901 902 Set a function for callouts of contents in retraction (backtrack). 903 If 0 (NULL) is set, never called in retraction. 904 905 normal return: ONIG_NORMAL 906 907 908# int onig_unicode_define_user_property(const char* name, OnigCodePoint* ranges)) 909 910 Define new Unicode property. 911 (This function is not thread safe.) 912 913 arguments 914 1 name: property name (ASCII only. character ' ', '-', '_' are ignored.) 915 2 ranges: property code point ranges 916 (first element is number of ranges.) 917 918 [num-of-ranges, 1st-range-start, 1st-range-end, 2nd-range-start... ] 919 920 * Don't destroy the ranges after having called this function. 921 922 normal return: ONIG_NORMAL 923 924 925# unsigned int onig_get_parse_depth_limit(void) 926 927 Return the maximum depth of parser recursion. 928 (default: DEFAULT_PARSE_DEPTH_LIMIT defined in regint.h. Currently 4096.) 929 930 931# int onig_set_parse_depth_limit(unsigned int depth) 932 933 Set the maximum depth of parser recursion. 934 (depth = 0: Set to the default value defined in regint.h.) 935 936 normal return: ONIG_NORMAL 937 938 939# int onig_end(void) 940 941 The use of this library is finished. 942 943 normal return: ONIG_NORMAL 944 945 It is not allowed to use regex objects which created 946 before onig_end() call. 947 948 949# const char* onig_version(void) 950 951 Return version string. (ex. "5.0.3") 952 953// END 954