summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2021-04-26 17:40:17 +0200
committerJörg Frings-Fürst <debian@jff.email>2021-04-26 17:40:17 +0200
commit98f7065a3f7b386564840bb5b24b94f9335b2e97 (patch)
tree0bd27b59da70360ac879db886b2cfbf7f2f56e41 /doc
parentfc9ba4264eafbb5a6ec0f3cc4cd2e1964c9b8fcf (diff)
New upstream version 6.9.7.1upstream/6.9.7.1
Diffstat (limited to 'doc')
-rw-r--r--doc/API192
-rw-r--r--doc/API.ja169
-rw-r--r--doc/CALLOUTS.API60
-rw-r--r--doc/CALLOUTS.API.ja63
4 files changed, 327 insertions, 157 deletions
diff --git a/doc/API b/doc/API
index b13a503..30e9a26 100644
--- a/doc/API
+++ b/doc/API
@@ -1,4 +1,4 @@
-Oniguruma API Version 6.9.6 2020/07/12
+Oniguruma API Version 6.9.7 2021/03/03
#include <oniguruma.h>
@@ -15,6 +15,10 @@ Oniguruma API Version 6.9.6 2020/07/12
1 use_encodings: array of encodings used in application.
2 num_encodings: number of encodings.
+ return value
+ normal: ONIG_NORMAL == 0
+ error: error code < 0
+
# int onig_error_code_to_str(UChar* err_buf, int err_code, ...)
@@ -22,7 +26,8 @@ Oniguruma API Version 6.9.6 2020/07/12
If this function is used for onig_new(),
don't call this after the pattern argument of onig_new() is freed.
- normal return: error message string length
+ return value
+ normal: error message string length
arguments
1 err_buf: error message string buffer.
@@ -60,7 +65,9 @@ Oniguruma API Version 6.9.6 2020/07/12
Create a regex object.
- normal return: ONIG_NORMAL
+ return value
+ normal: ONIG_NORMAL == 0
+ error: error code < 0
arguments
1 reg: return regex object's address.
@@ -75,14 +82,12 @@ Oniguruma API Version 6.9.6 2020/07/12
ONIG_OPTION_EXTEND extended pattern form
ONIG_OPTION_FIND_LONGEST find longest match
ONIG_OPTION_FIND_NOT_EMPTY ignore empty match
- ONIG_OPTION_NEGATE_SINGLELINE
- clear ONIG_OPTION_SINGLELINE which is enabled on
- ONIG_SYNTAX_POSIX_BASIC, ONIG_SYNTAX_POSIX_EXTENDED,
- ONIG_SYNTAX_PERL, ONIG_SYNTAX_PERL_NG, ONIG_SYNTAX_JAVA
+ ONIG_OPTION_NEGATE_SINGLELINE clear ONIG_OPTION_SINGLELINE which is enabled on ONIG_SYNTAX_POSIX_BASIC/POSIX_EXTENDED/PERL/PERL_NG/PYTHON/JAVA
ONIG_OPTION_DONT_CAPTURE_GROUP only named group captured.
ONIG_OPTION_CAPTURE_GROUP named and no-named group captured.
+ ONIG_OPTION_IGNORECASE_IS_ASCII Limit IGNORECASE((?i)) to a range of ASCII characters
ONIG_OPTION_WORD_IS_ASCII ASCII only word (\w, \p{Word}, [[:word:]])
ASCII only word bound (\b)
ONIG_OPTION_DIGIT_IS_ASCII ASCII only digit (\d, \p{Digit}, [[:digit:]])
@@ -145,6 +150,7 @@ Oniguruma API Version 6.9.6 2020/07/12
ONIG_SYNTAX_JAVA Java (Sun java.util.regex)
ONIG_SYNTAX_PERL Perl
ONIG_SYNTAX_PERL_NG Perl + named group
+ ONIG_SYNTAX_PYTHON Python
ONIG_SYNTAX_ONIGURUMA Oniguruma
ONIG_SYNTAX_DEFAULT default (== ONIG_SYNTAX_ONIGURUMA)
onig_set_default_syntax()
@@ -164,8 +170,9 @@ Oniguruma API Version 6.9.6 2020/07/12
Create a regex object.
reg object area is not allocated in this function.
- normal return: ONIG_NORMAL
-
+ return value
+ normal: ONIG_NORMAL == 0
+ error: error code < 0
# int onig_new_deluxe(regex_t** reg, const UChar* pattern, const UChar* pattern_end,
@@ -177,7 +184,9 @@ Oniguruma API Version 6.9.6 2020/07/12
Create a regex object.
This function is deluxe version of onig_new().
- normal return: ONIG_NORMAL
+ return value
+ normal: ONIG_NORMAL == 0
+ error: error code < 0
arguments
1 reg: return address of regex object.
@@ -319,9 +328,13 @@ Oniguruma API Version 6.9.6 2020/07/12
Search string and return search result and matching region.
Do not pass invalid byte string in the regex character encoding.
- normal return: match position offset (i.e. p - str >= 0)
- not found: ONIG_MISMATCH (< 0)
- error: error code (< 0)
+ return value
+ normal: match position offset (i.e. p - str >= 0)
+ not found: ONIG_MISMATCH (< 0)
+ error: error code (< 0)
+
+ * If option ONIG_OPTION_CALLBACK_EACH_MATCH is used,
+ it will return ONIG_MISMATCH even if there is a match.
arguments
1 reg: regex object
@@ -334,11 +347,24 @@ Oniguruma API Version 6.9.6 2020/07/12
6 region: address for return group match range info (NULL is allowed)
7 option: search time option
- ONIG_OPTION_NOTBOL (str) isn't considered as begin of line and begin of string (* ONIG_OPTION_NOT_BEGIN_STRING)
- ONIG_OPTION_NOTEOL (end) isn't considered as end of line and end of string (* ONIG_OPTION_NOT_END_STRING)
- ONIG_OPTION_NOT_BEGIN_STRING (str) isn't considered as begin of string (* fail \A)
- ONIG_OPTION_NOT_END_STRING (end) isn't considered as end of string (* fail \z, \Z)
- ONIG_OPTION_NOT_BEGIN_POSITION (start) isn't considered as start position of search (* fail \G)
+ ONIG_OPTION_NOTBOL Do not regard the beginning of the (str) as the beginning of the line and the beginning of the string
+ ONIG_OPTION_NOTEOL Do not regard the (end) as the end of a line and the end of a string
+ ONIG_OPTION_NOT_BEGIN_STRING Do not regard the beginning of the (str) as the beginning of a string (* fail \A)
+ ONIG_OPTION_NOT_END_STRING Do not regard the (end) as a string endpoint (* fail \z, \Z)
+ ONIG_OPTION_NOT_BEGIN_POSITION Do not regard the (start) as start position of search (* fail \G)
+
+ ONIG_OPTION_CALLBACK_EACH_MATCH
+ Call back for all successful matches.
+ (including the case of the same matching start position)
+ The search does not stop when a match is found at a certain position.
+ The callback function to be called is set by
+ onig_set_callback_each_match().
+ The user_data in the argument passed to the callback function is
+ specified by onig_set_callout_user_data_of_match_param(mp, user_data).
+ Therefore, if you want to specify user_data,
+ use onig_search_with_param() instead of onig_search().
+ The user_data specified by onig_set_callout_user_data_of_match_param()
+ will be shared with callout.
# int onig_search_with_param(regex_t* reg, const UChar* str, const UChar* end,
@@ -359,9 +385,13 @@ Oniguruma API Version 6.9.6 2020/07/12
Match string and return result and matching region.
Do not pass invalid byte string in the regex character encoding.
- normal return: match length (>= 0)
- not match: ONIG_MISMATCH (< 0)
- error: error code (< 0)
+ return value
+ normal: match length (>= 0)
+ not match: ONIG_MISMATCH (< 0)
+ error: error code (< 0)
+
+ * If option ONIG_OPTION_CALLBACK_EACH_MATCH is used,
+ it will return ONIG_MISMATCH even if there is a match.
arguments
1 reg: regex object
@@ -371,11 +401,12 @@ Oniguruma API Version 6.9.6 2020/07/12
5 region: address for return group match range info (NULL is allowed)
6 option: search time option
- ONIG_OPTION_NOTBOL (str) isn't considered as begin of line and begin of string (* ONIG_OPTION_NOT_BEGIN_STRING)
- ONIG_OPTION_NOTEOL (end) isn't considered as end of line and end of string (* ONIG_OPTION_NOT_END_STRING)
- ONIG_OPTION_NOT_BEGIN_STRING (str) isn't considered as begin of string (* fail \A)
- ONIG_OPTION_NOT_END_STRING (end) isn't considered as end of string (* fail \z, \Z)
- ONIG_OPTION_NOT_BEGIN_POSITION (at) isn't considered as start position of search (* fail \G)
+ ONIG_OPTION_NOTBOL Do not regard the beginning of the (str) as the beginning of the line and the beginning of the string
+ ONIG_OPTION_NOTEOL Do not regard the (end) as the end of a line and the end of a string
+ ONIG_OPTION_NOT_BEGIN_STRING Do not regard the beginning of the (str) as the beginning of a string (* fail \A)
+ ONIG_OPTION_NOT_END_STRING Do not regard the (end) as a string endpoint (* fail \z, \Z)
+ ONIG_OPTION_NOT_BEGIN_POSITION Do not regard the (start) as start position of search (* fail \G)
+ ONIG_OPTION_CALLBACK_EACH_MATCH Call back for all successful matches.
# int onig_match_with_param(regex_t* reg, const UChar* str, const UChar* end,
@@ -398,9 +429,10 @@ Oniguruma API Version 6.9.6 2020/07/12
Scan string and callback with matching region.
Do not pass invalid byte string in the regex character encoding.
- normal return: number of matching times
- error: error code
- interruption: return value of callback function (!= 0)
+ return value
+ normal: number of matching times
+ error: error code
+ interruption: return value of callback function (!= 0)
arguments
1 reg: regex object
@@ -423,7 +455,9 @@ Oniguruma API Version 6.9.6 2020/07/12
2 n: number of regex in regs
3 regs: array of regex
- normal return: ONIG_NORMAL
+ return value
+ normal: ONIG_NORMAL == 0
+ error: error code < 0
# int onig_regset_add(OnigRegSet* set, regex_t* reg)
@@ -436,7 +470,9 @@ Oniguruma API Version 6.9.6 2020/07/12
1 set: regset object
2 reg: regex object
- normal return: ONIG_NORMAL
+ return value
+ normal: ONIG_NORMAL == 0
+ error: error code < 0
# int onig_regset_replace(OnigRegSet* set, int at, regex_t* reg)
@@ -449,7 +485,9 @@ Oniguruma API Version 6.9.6 2020/07/12
2 at: index of regex (zero origin)
3 reg: regex object
- normal return: ONIG_NORMAL
+ return value
+ normal: ONIG_NORMAL == 0
+ error: error code < 0
# void onig_regset_free(OnigRegSet* set)
@@ -492,9 +530,9 @@ Oniguruma API Version 6.9.6 2020/07/12
Perform a search with regset.
return value:
- normal return: index of match regex (zero origin)
- not found: ONIG_MISMATCH (< 0)
- error: error code (< 0)
+ normal: index of match regex (zero origin)
+ not found: ONIG_MISMATCH (< 0)
+ error: error code (< 0)
arguments
1 set: regset object
@@ -507,11 +545,11 @@ Oniguruma API Version 6.9.6 2020/07/12
ONIG_REGSET_REGEX_LEAD (returns most left position)
ONIG_REGSET_PRIORITY_TO_REGEX_ORDER (returns first match regex)
7 option: search time option
- ONIG_OPTION_NOTBOL (str) isn't considered as begin of line and begin of string (* ONIG_OPTION_NOT_BEGIN_STRING)
- ONIG_OPTION_NOTEOL end (end) isn't considered as end of line and end of string (* ONIG_OPTION_NOT_END_STRING)
- ONIG_OPTION_NOT_BEGIN_STRING (str) isn't considered as begin of string (* fail \A)
- ONIG_OPTION_NOT_END_STRING (end) isn't considered as end of string (* fail \z, \Z)
- ONIG_OPTION_NOT_BEGIN_POSITION (start) isn't considered as start position of search (* fail \G)
+ ONIG_OPTION_NOTBOL Do not regard the beginning of the (str) as the beginning of the line and the beginning of the string
+ ONIG_OPTION_NOTEOL Do not regard the (end) as the end of a line and the end of a string
+ ONIG_OPTION_NOT_BEGIN_STRING Do not regard the beginning of the (str) as the beginning of a string (* fail \A)
+ ONIG_OPTION_NOT_END_STRING Do not regard the (end) as a string endpoint (* fail \z, \Z)
+ ONIG_OPTION_NOT_BEGIN_POSITION Do not regard the (start) as start position of search (* fail \G)
8 rmatch_pos: return address of match position (match_address - str)
@@ -525,9 +563,9 @@ Oniguruma API Version 6.9.6 2020/07/12
Perform a search with regset and match-params.
return value:
- normal return: index of match regex (zero origin)
- not found: ONIG_MISMATCH (< 0)
- error: error code (< 0)
+ normal: index of match regex (zero origin)
+ not found: ONIG_MISMATCH (< 0)
+ error: error code (< 0)
arguments
1 set: regset object
@@ -540,11 +578,11 @@ Oniguruma API Version 6.9.6 2020/07/12
ONIG_REGSET_REGEX_LEAD (returns most left position)
ONIG_REGSET_PRIORITY_TO_REGEX_ORDER (returns first match regex)
7 option: search time option
- ONIG_OPTION_NOTBOL (str) isn't considered as begin of line and begin of string (* ONIG_OPTION_NOT_BEGIN_STRING)
- ONIG_OPTION_NOTEOL (end) isn't considered as end of line and end of string (* ONIG_OPTION_NOT_END_STRING)
- ONIG_OPTION_NOT_BEGIN_STRING (str) isn't considered as begin of string (* fail \A)
- ONIG_OPTION_NOT_END_STRING (end) isn't considered as end of string (* fail \z, \Z)
- ONIG_OPTION_NOT_BEGIN_POSITION (start) isn't considered as start position of search (* fail \G)
+ ONIG_OPTION_NOTBOL Do not regard the beginning of the (str) as the beginning of the line and the beginning of the string
+ ONIG_OPTION_NOTEOL Do not regard the (end) as the end of a line and the end of a string
+ ONIG_OPTION_NOT_BEGIN_STRING Do not regard the beginning of the (str) as the beginning of a string (* fail \A)
+ ONIG_OPTION_NOT_END_STRING Do not regard the (end) as a string endpoint (* fail \z, \Z)
+ ONIG_OPTION_NOT_BEGIN_POSITION Do not regard the (start) as start position of search (* fail \G)
8 mps: array of match-params
9 rmatch_pos: return address of match position (match_address - str)
@@ -585,7 +623,9 @@ Oniguruma API Version 6.9.6 2020/07/12
Resize group range area of region.
- normal return: ONIG_NORMAL
+ return value
+ normal: ONIG_NORMAL == 0
+ error: error code < 0
arguments
1 region: target region
@@ -598,8 +638,9 @@ Oniguruma API Version 6.9.6 2020/07/12
Return the group number list of the name.
Named subexp is defined by (?<name>....).
- normal return: number of groups for the name.
- (ex. /(?<x>..)(?<x>..)/ ==> 2)
+ return value
+ normal: number of groups for the name.
+ (ex. /(?<x>..)(?<x>..)/ ==> 2)
name not found: -1
arguments
@@ -616,7 +657,9 @@ Oniguruma API Version 6.9.6 2020/07/12
If two or more regions for the groups of the name are effective,
the greatest number in it is obtained.
- normal return: group number.
+ return value
+ normal: group number
+ error: error code < 0
arguments
1 reg: regex object.
@@ -631,8 +674,9 @@ Oniguruma API Version 6.9.6 2020/07/12
Iterate function call for all names.
- normal return: 0
- error: func's return value.
+ return value
+ normal: 0
+ error: return value of callback function
arguments
1 reg: regex object.
@@ -654,7 +698,6 @@ Oniguruma API Version 6.9.6 2020/07/12
# OnigEncoding onig_get_encoding(regex_t* reg)
# OnigOptionType onig_get_options(regex_t* reg)
-# OnigCaseFoldType onig_get_case_fold_flag(regex_t* reg)
# OnigSyntaxType* onig_get_syntax(regex_t* reg)
Return a value of the regex object.
@@ -663,6 +706,15 @@ Oniguruma API Version 6.9.6 2020/07/12
1 reg: regex object.
+# OnigCaseFoldType onig_get_case_fold_flag(regex_t* reg)
+
+ Return the case_fold_flag of the regex object.
+ This function is deprecated.
+
+ arguments
+ 1 reg: regex object.
+
+
# int onig_number_of_captures(regex_t* reg)
Return the number of capture group in the pattern.
@@ -671,6 +723,23 @@ Oniguruma API Version 6.9.6 2020/07/12
1 reg: regex object.
+# OnigCallbackEachMatchFunc onig_get_callback_each_match(void)
+
+ Return the current callback function for ONIG_OPTION_CALLBACK_EACH_MATCH.
+
+
+# int onig_set_callback_each_match(OnigCallbackEachMatchFunc func)
+
+ Set the callback function for ONIG_OPTION_CALLBACK_EACH_MATCH.
+ If NULL is set, the callback will never be executed.
+
+ return value
+ normal: 0
+
+ arguments
+ 1 func: callback function
+
+
# int onig_number_of_capture_histories(regex_t* reg)
Return the number of capture history defined in the pattern.
@@ -682,7 +751,6 @@ Oniguruma API Version 6.9.6 2020/07/12
1 reg: regex object.
-
# OnigCaptureTreeNode* onig_get_capture_tree(OnigRegion* region)
Return the root node of capture history data tree.
@@ -698,8 +766,9 @@ Oniguruma API Version 6.9.6 2020/07/12
Traverse and callback in capture history data tree.
- normal return: 0
- error: callback func's return value.
+ return value
+ normal: 0
+ error: return value of callback function
arguments
1 region: match region data.
@@ -732,6 +801,7 @@ Oniguruma API Version 6.9.6 2020/07/12
Return noname group capture activity.
+ return value
active: 1
inactive: 0
@@ -868,11 +938,13 @@ Oniguruma API Version 6.9.6 2020/07/12
# OnigCaseFoldType onig_get_default_case_fold_flag()
Get default case fold flag.
+ This function is deprecated.
# int onig_set_default_case_fold_flag(OnigCaseFoldType case_fold_flag)
Set default case fold flag.
+ This function is deprecated.
1 case_fold_flag: case fold flag
@@ -993,7 +1065,9 @@ Oniguruma API Version 6.9.6 2020/07/12
* Don't destroy the ranges after having called this function.
- normal return: ONIG_NORMAL
+ return value
+ normal: ONIG_NORMAL == 0
+ error: error code < 0
# unsigned int onig_get_parse_depth_limit(void)
diff --git a/doc/API.ja b/doc/API.ja
index 283bea3..21dc527 100644
--- a/doc/API.ja
+++ b/doc/API.ja
@@ -1,4 +1,4 @@
-鬼車インターフェース Version 6.9.6 2020/07/12
+鬼車インターフェース Version 6.9.7 2021/03/16
#include <oniguruma.h>
@@ -14,6 +14,10 @@
1 use_encodings: 使用する文字エンコーディングの配列
2 num_encodings: 文字エンコーディングの数
+ 戻り値
+ 正常終了: ONIG_NORMAL == 0
+ エラー時: エラーコード < 0
+
# int onig_error_code_to_str(UChar* err_buf, int err_code, ...)
@@ -22,7 +26,8 @@
この関数を、onig_new()の結果に対して呼び出す場合には、onig_new()のpattern引数を
メモリ解放するよりも前に呼び出さなければならない。
- 正常終了戻り値: エラーメッセージ文字列のバイト長
+ 戻り値
+ 正常終了: エラーメッセージ文字列のバイト長
引数
1 err_buf: エラーメッセージを格納する領域
@@ -60,7 +65,9 @@
正規表現オブジェクト(regex)を作成する。
- 正常終了戻り値: ONIG_NORMAL
+ 戻り値
+ 正常終了: ONIG_NORMAL == 0
+ エラー時: エラーコード < 0
引数
1 reg: 作成された正規表現オブジェクトを返すアドレス
@@ -75,13 +82,11 @@
ONIG_OPTION_EXTEND パターン拡張形式
ONIG_OPTION_FIND_LONGEST 最長マッチ
ONIG_OPTION_FIND_NOT_EMPTY 空マッチを無視
- ONIG_OPTION_NEGATE_SINGLELINE
- ONIG_SYNTAX_POSIX_BASIC, ONIG_SYNTAX_POSIX_EXTENDED,
- ONIG_SYNTAX_PERL, ONIG_SYNTAX_PERL_NG, ONIG_SYNTAX_JAVAで
- デフォルトで有効なONIG_OPTION_SINGLELINEをクリアする。
+ ONIG_OPTION_NEGATE_SINGLELINE ONIG_SYNTAX_POSIX_BASIC/POSIX_EXTENDED/PERL/PERL_NG/PYTHON/JAVAでデフォルトで有効なONIG_OPTION_SINGLELINEをクリアする。
ONIG_OPTION_DONT_CAPTURE_GROUP 名前付き捕獲式集合のみ捕獲
ONIG_OPTION_CAPTURE_GROUP 名前無し捕獲式集合も捕獲
+ ONIG_OPTION_IGNORECASE_IS_ASCII IGNORECASE((?i))をASCII文字の範囲に制限する
ONIG_OPTION_WORD_IS_ASCII wordがASCIIのみ (\w, \p{Word}, [[:word:]])
word boundがASCIIのみ (\b)
ONIG_OPTION_DIGIT_IS_ASCII digitがASCIIのみ (\d, \p{Digit}, [[:digit:]])
@@ -142,6 +147,7 @@
ONIG_SYNTAX_JAVA Java (Sun java.util.regex)
ONIG_SYNTAX_PERL Perl
ONIG_SYNTAX_PERL_NG Perl + 名前付き捕獲式集合
+ ONIG_SYNTAX_PYTHON Python
ONIG_SYNTAX_ONIGURUMA Oniguruma
ONIG_SYNTAX_DEFAULT default (== ONIG_SYNTAX_ONIGURUMA)
onig_set_default_syntax()
@@ -161,20 +167,24 @@
正規表現オブジェクト(regex)を作成する。
regの領域を内部で割り当てない。
- 正常終了戻り値: ONIG_NORMAL
+ 戻り値
+ 正常終了: ONIG_NORMAL == 0
+ エラー時: エラーコード < 0
# int onig_new_deluxe(regex_t** reg, const UChar* pattern, const UChar* pattern_end,
OnigCompileInfo* ci, OnigErrorInfo* einfo)
- この関数は廃止予定。
+ この関数は廃止(使用不可)。
パターンと対象文字列の文字エンコーディングが異なる場合を許さなくなった。
正規表現オブジェクト(regex)を作成する。
この関数は、onig_new()のデラックス版。
- 正常終了戻り値: ONIG_NORMAL
+ 戻り値
+ 正常終了: ONIG_NORMAL == 0
+ エラー時: エラーコード < 0
引数
1 reg: 作成された正規表現オブジェクトを返すアドレス
@@ -316,8 +326,11 @@
正規表現で文字列を検索し、検索結果とマッチ領域を返す。
正規表現オブジェクトの文字エンコーディングで、検索文字列として不正な文字列を渡してはいけない。
- 正常終了戻り値: マッチ位置 (p - str >= 0)
- 検索失敗: ONIG_MISMATCH (< 0)
+ 戻り値
+ 正常終了: マッチ位置 (p - str >= 0)
+ 検索失敗: ONIG_MISMATCH (< 0)
+
+ * 若しONIG_OPTION_CALLBACK_EACH_MATCHが使用されると、マッチするものがあってもONIG_MISMATCHが返される。
引数
1 reg: 正規表現オブジェクト
@@ -330,12 +343,24 @@
6 region: マッチ領域情報(region) (NULLも許される)
7 option: 検索時オプション
- ONIG_OPTION_NOTBOL strを行頭および文字列先頭と看做さない
+ ONIG_OPTION_NOTBOL strの先頭を行頭および文字列先頭と看做さない
ONIG_OPTION_NOTEOL endを行末および文字列終端と看做さない
- ONIG_OPTION_NOT_BEGIN_STRING strを文字列の先頭と看做さない (\A 失敗)
- ONIG_OPTION_NOT_END_STRING end文字列終端と看做さない (\z, \Z 失敗)
+ ONIG_OPTION_NOT_BEGIN_STRING strの先頭を文字列の先頭と看做さない (\A 失敗)
+ ONIG_OPTION_NOT_END_STRING endを文字列終端と看做さない (\z, \Z 失敗)
ONIG_OPTION_NOT_BEGIN_POSITION startを検索開始位置と看做さない (\G 失敗)
+ ONIG_OPTION_CALLBACK_EACH_MATCH
+ 全てのマッチ成功に対してコールバック関数が呼び出される。
+ (マッチ開始位置が同じものも含めて)
+ ある位置でマッチするものが見つかっても探索が止まることはない。
+ 呼び出されるコールバック関数は、onig_set_callback_each_match()で与える。
+ コールバック関数に渡される引数の中のuser_dataは、
+ onig_set_callout_user_data_of_match_param(mp, user_data)で指定する。
+ このため、user_dataを指定したい場合には、onig_search()ではなく、
+ onig_search_with_param()を使用することになる。
+ onig_set_callout_user_data_of_match_param()で指定するuser_dataは、
+ calloutで使用されるuser_dataと共用される。
+
# int onig_search_with_param(regex_t* reg, const UChar* str, const UChar* end,
const UChar* start, const UChar* range, OnigRegion* region,
@@ -355,8 +380,11 @@
文字列の指定位置でマッチングを行い、結果とマッチ領域を返す。
正規表現オブジェクトの文字エンコーディングで、検索文字列として不正な文字列を渡してはいけない。
- 正常終了戻り値: マッチしたバイト長 (>= 0)
- not match: ONIG_MISMATCH ( < 0)
+ 戻り値
+ 正常終了: マッチしたバイト長 (>= 0)
+ not match: ONIG_MISMATCH ( < 0)
+
+ * 若しONIG_OPTION_CALLBACK_EACH_MATCHが使用されると、マッチするものがあってもONIG_MISMATCHが返される。
引数
1 reg: 正規表現オブジェクト
@@ -366,11 +394,12 @@
5 region: マッチ領域情報(region) (NULLも許される)
6 option: 検索時オプション
- ONIG_OPTION_NOTBOL strを行頭および文字列先頭と看做さない
+ ONIG_OPTION_NOTBOL strの先頭を行頭および文字列先頭と看做さない
ONIG_OPTION_NOTEOL endを行末および文字列終端と看做さない
- ONIG_OPTION_NOT_BEGIN_STRING strを文字列の先頭と看做さない (\A 失敗)
- ONIG_OPTION_NOT_END_STRING end文字列終端と看做さない (\z, \Z 失敗)
- ONIG_OPTION_NOT_BEGIN_POSITION atを検索開始位置と看做さない (\G 失敗)
+ ONIG_OPTION_NOT_BEGIN_STRING strの先頭を文字列の先頭と看做さない (\A 失敗)
+ ONIG_OPTION_NOT_END_STRING endを文字列終端と看做さない (\z, \Z 失敗)
+ ONIG_OPTION_NOT_BEGIN_POSITION startを検索開始位置と看做さない (\G 失敗)
+ ONIG_OPTION_CALLBACK_EACH_MATCH 全てのマッチ成功に対してコールバック関数が呼び出される。
# int onig_match_with_param(regex_t* reg, const UChar* str, const UChar* end,
@@ -393,6 +422,7 @@
正規表現で文字列をスキャンして、マッチングする毎にコールバック関数を呼び出す。
正規表現オブジェクトの文字エンコーディングで、検索文字列として不正な文字列を渡してはいけない。
+ 戻り値
正常終了: マッチ回数 (0回も含める)
エラー: エラーコード (< 0)
中断: コールバック関数が0以外の戻り値を返したとき、その値を戻り値として中断
@@ -418,7 +448,9 @@
2 n: 正規表現の個数
3 regs: 正規表現オブジェクトの配列
- 正常終了戻り値: ONIG_NORMAL
+ 戻り値
+ 正常終了: ONIG_NORMAL == 0
+ エラー時: エラーコード < 0
# int onig_regset_add(OnigRegSet* set, regex_t* reg)
@@ -431,7 +463,9 @@
1 set: regsetオブジェクト
2 reg: 正規表現オブジェクト
- 正常終了戻り値: ONIG_NORMAL
+ 戻り値
+ 正常終了: ONIG_NORMAL == 0
+ エラー時: エラーコード < 0
# int onig_regset_replace(OnigRegSet* set, int at, regex_t* reg)
@@ -444,7 +478,9 @@
2 at: 変更する場所のインデックス
2 reg: 正規表現オブジェクト
- 正常終了戻り値: ONIG_NORMAL
+ 戻り値
+ 正常終了: ONIG_NORMAL == 0
+ エラー時: エラーコード < 0
# void onig_regset_free(OnigRegSet* set)
@@ -486,10 +522,10 @@
regsetによる検索を実行する。
- 戻り値:
- 検索成功: マッチした正規表現オブジェクトのインデックス (ゼロ開始)
- 検索失敗: ONIG_MISMATCH (< 0)
- エラー: エラーコード (< 0)
+ 戻り値
+ 検索成功: マッチした正規表現オブジェクトのインデックス (ゼロ開始)
+ 検索失敗: ONIG_MISMATCH (< 0)
+ エラー: エラーコード (< 0)
引数
1 set: regsetオブジェクト
@@ -503,10 +539,10 @@
ONIG_REGSET_REGEX_LEAD (最左位置でマッチした結果を返す)
ONIG_REGSET_PRIORITY_TO_REGEX_ORDER (最初にマッチした正規表現の結果を返す)
7 option: 検索時オプション
- ONIG_OPTION_NOTBOL strを行頭および文字列先頭と看做さない
+ ONIG_OPTION_NOTBOL strの先頭を行頭および文字列先頭と看做さない
ONIG_OPTION_NOTEOL endを行末および文字列終端と看做さない
- ONIG_OPTION_NOT_BEGIN_STRING strを文字列の先頭と看做さない (\A 失敗)
- ONIG_OPTION_NOT_END_STRING end文字列終端と看做さない (\z, \Z 失敗)
+ ONIG_OPTION_NOT_BEGIN_STRING strの先頭を文字列の先頭と看做さない (\A 失敗)
+ ONIG_OPTION_NOT_END_STRING endを文字列終端と看做さない (\z, \Z 失敗)
ONIG_OPTION_NOT_BEGIN_POSITION startを検索開始位置と看做さない (\G 失敗)
8 rmatch_pos: マッチした位置を返すためのアドレス (match_address - str)
@@ -519,10 +555,10 @@
regsetとOnigMatchParamオブジェクトによる検索を実行する。
- 戻り値:
- 検索成功: マッチした正規表現オブジェクトのインデックス (ゼロ開始)
- 検索失敗: ONIG_MISMATCH (< 0)
- エラー: エラーコード (< 0)
+ 戻り値
+ 検索成功: マッチした正規表現オブジェクトのインデックス (ゼロ開始)
+ 検索失敗: ONIG_MISMATCH (< 0)
+ エラー: エラーコード (< 0)
引数
1 set: regsetオブジェクト
@@ -536,10 +572,10 @@
ONIG_REGSET_REGEX_LEAD (最左位置でマッチした結果を返す)
ONIG_REGSET_PRIORITY_TO_REGEX_ORDER (最初にマッチした正規表現の結果を返す)
7 option: 検索時オプション
- ONIG_OPTION_NOTBOL strを行頭および文字列先頭と看做さない
+ ONIG_OPTION_NOTBOL strの先頭を行頭および文字列先頭と看做さない
ONIG_OPTION_NOTEOL endを行末および文字列終端と看做さない
- ONIG_OPTION_NOT_BEGIN_STRING strを文字列の先頭と看做さない (\A 失敗)
- ONIG_OPTION_NOT_END_STRING end文字列終端と看做さない (\z, \Z 失敗)
+ ONIG_OPTION_NOT_BEGIN_STRING strの先頭を文字列の先頭と看做さない (\A 失敗)
+ ONIG_OPTION_NOT_END_STRING endを文字列終端と看做さない (\z, \Z 失敗)
ONIG_OPTION_NOT_BEGIN_POSITION startを検索開始位置と看做さない (\G 失敗)
8 mps: OnigMatchParamオブジェクトの配列
9 rmatch_pos: マッチした位置を返すためのアドレス (match_address - str)
@@ -580,7 +616,9 @@
マッチ領域情報(region)の捕獲式集合(グループ)数を変更する。
- 正常終了戻り値: ONIG_NORMAL
+ 戻り値
+ 正常終了: ONIG_NORMAL == 0
+ エラー時: エラーコード < 0
引数
1 region: 対象領域
@@ -594,8 +632,9 @@
グループ番号リストを返す。
名前付き捕獲式集合は、(?<name>....)によって定義できる。
- 正常終了戻り値: 指定された名前に対するグループ数
- (例 /(?<x>..)(?<x>..)/ ==> 2)
+ 戻り値
+ 正常終了: 指定された名前に対するグループ数
+ (例 /(?<x>..)(?<x>..)/ ==> 2)
名前に対するグループが存在しない: -1
引数
@@ -613,7 +652,9 @@
名前に対する捕獲式集合が一個しかないときには、対応するマッチ領域が有効か
どうかに関係なく、その番号を返す。(従って、regionにはNULLを渡してもよい。)
- 正常終了戻り値: 番号
+ 戻り値
+ 正常終了: 番号
+ エラー時: エラーコード < 0
引数
1 reg: 正規表現オブジェクト
@@ -628,8 +669,9 @@
全ての名前に対してコールバック関数呼び出しを実行する。
- 正常終了戻り値: 0
- エラー: コールバック関数の戻り値
+ 戻り値
+ 正常終了: ONIG_NORMAL == 0
+ エラー時: コールバック関数の戻り値
引数
1 reg: 正規表現オブジェクト
@@ -654,7 +696,6 @@
# OnigEncoding onig_get_encoding(regex_t* reg)
# OnigOptionType onig_get_options(regex_t* reg)
-# OnigCaseFoldType onig_get_case_fold_flag(regex_t* reg)
# OnigSyntaxType* onig_get_syntax(regex_t* reg)
正規表現オブジェクトに対して、対応する値を返す。
@@ -663,6 +704,15 @@
1 reg: 正規表現オブジェクト
+# OnigCaseFoldType onig_get_case_fold_flag(regex_t* reg)
+
+ 正規表現オブジェクトに対して、case_fold_flag値を返す。
+ この関数は廃止予定(非推奨)。
+
+ 引数
+ 1 reg: 正規表現オブジェクト
+
+
# int onig_number_of_captures(regex_t* reg)
パターン中で定義された捕獲グループの数を返す。
@@ -671,6 +721,23 @@
1 reg: 正規表現オブジェクト
+# OnigCallbackEachMatchFunc onig_get_callback_each_match(void)
+
+ ONIG_OPTION_CALLBACK_EACH_MATCHに対する現在のコールバック関数を返す。
+
+
+# int onig_set_callback_each_match(OnigCallbackEachMatchFunc func)
+
+ ONIG_OPTION_CALLBACK_EACH_MATCHに対するコールバック関数をセットする。
+ 若しNULLがセットされると、コールバックは実行されない。
+
+ 戻り値
+ 正常終了: ONIG_NORMAL == 0
+
+ 引数
+ 1 func: コールバック関数
+
+
# int onig_number_of_capture_histories(regex_t* reg)
パターン中で定義された捕獲履歴(?@...)の数を返す。
@@ -697,8 +764,9 @@
捕獲履歴データ木を巡回してコールバックする。
- 正常終了戻り値: 0
- エラー: コールバック関数の戻り値
+ 戻り値
+ 正常終了: ONIG_NORMAL == 0
+ エラー時: コールバック関数の戻り値
引数
1 region: マッチ領域
@@ -733,6 +801,7 @@
名前なし式集合の捕獲機能が有効かどうかを返す。
+ 戻り値
有効: 1
無効: 0
@@ -869,11 +938,13 @@
# OnigCaseFoldType onig_get_default_case_fold_flag()
デフォルトのcase foldフラグを取得する。
+ この関数は廃止予定(非推奨)。
# int onig_set_default_case_fold_flag(OnigCaseFoldType case_fold_flag)
デフォルトのcase foldフラグをセットする。
+ この関数は廃止予定(非推奨)。
引数
1 case_fold_flag: case foldフラグ
@@ -996,7 +1067,9 @@
* この関数を呼んだ後で、rangesを変更/破壊しないこと
- 正常終了戻り値: ONIG_NORMAL
+ 戻り値
+ 正常終了: ONIG_NORMAL == 0
+ エラー時: エラーコード < 0
# unsigned int onig_get_parse_depth_limit(void)
diff --git a/doc/CALLOUTS.API b/doc/CALLOUTS.API
index c4a13c8..7ecf6bc 100644
--- a/doc/CALLOUTS.API
+++ b/doc/CALLOUTS.API
@@ -1,4 +1,4 @@
-Callouts API Version 6.8.2 2018/06/08
+Callouts API Version 6.9.7 2021/03/21
#include <oniguruma.h>
@@ -273,48 +273,51 @@ Callouts API Version 6.8.2 2018/06/08
Returns the callout data value/type for a callout slot indicated by
callout_num/slot.
- normal return: ONIG_NORMAL
- 1: not yet set (type is ONIG_TYPE_VOID)
- < 0: error code
+ ONIG_NORMAL: normal return
+ ONIG_VALUE_IS_NOT_SET: value is not set / type is ONIG_TYPE_VOID
+ < 0: error code
# int onig_get_callout_data_by_callout_args_self(OnigCalloutArgs* args, int slot, OnigType* type, OnigValue* val)
Returns self callout data value/type.
- normal return: ONIG_NORMAL
- 1: not yet set (type is ONIG_TYPE_VOID)
- < 0: error code
+ ONIG_NORMAL: normal return
+ ONIG_VALUE_IS_NOT_SET: value is not set / type is ONIG_TYPE_VOID
+ < 0: error code
# int onig_set_callout_data_by_callout_args(OnigCalloutArgs* args, int callout_num, int slot, OnigType type, OnigValue* val)
Set the callout data value/type for a callout slot indicated by callout_num/slot.
- normal return: ONIG_NORMAL
- < 0: error code
+ ONIG_NORMAL: normal return
+ < 0: error code
# int onig_set_callout_data_by_callout_args_self(OnigCalloutArgs* args, int slot, OnigType type, OnigValue* val)
Set self callout data value/type for a callout slot indicated by slot.
- normal return: ONIG_NORMAL
- < 0: error code
+ ONIG_NORMAL: normal return
+ < 0: error code
# int onig_get_callout_data_by_callout_args_self_dont_clear_old(OnigCalloutArgs* args, int slot, OnigType* type, OnigValue* val)
This function is almost same as onig_get_callout_data_by_callout_args_self().
- But this function doesn't clear values which set in previous failed match process.
- Other onig_get_callout_data_xxxx() functions clear all values which set
- in previous failed match process.
+ But this function does not clear the value set in the collation position before the current position. (dont_clear_old)
+ The other onig_get_callout_data_xxxx() function clears the value set in the collation process of the previous position.
For example, Builtin callout (*TOTAL_COUNT) is implemented by using this
function for accumulate count of all of match processes in a search process.
Builtin callout (*COUNT) returns count in last success match process only,
because it doesn't use this function.
+ ONIG_NORMAL: normal return
+ ONIG_VALUE_IS_NOT_SET: value is not set / type is ONIG_TYPE_VOID
+ < 0: error code
+
(8) Callout data (used in applications)
@@ -323,34 +326,34 @@ Callouts API Version 6.8.2 2018/06/08
Returns the callout data value/type for a callout slot indicated by
callout_num/slot.
- normal return: ONIG_NORMAL
- 1: not yet set (type is ONIG_TYPE_VOID)
- < 0: error code
+ ONIG_NORMAL: normal return
+ ONIG_VALUE_IS_NOT_SET: value is not set / type is ONIG_TYPE_VOID
+ < 0: error code
# int onig_get_callout_data_by_tag(OnigRegex reg, OnigMatchParam* mp, const OnigUChar* tag, const OnigUChar* tag_end, int slot, OnigType* type, OnigValue* val)
Returns the callout data value/type for a callout slot indicated by tag/slot.
- normal return: ONIG_NORMAL
- 1: not yet set (type is ONIG_TYPE_VOID)
- < 0: error code
+ ONIG_NORMAL: normal return
+ ONIG_VALUE_IS_NOT_SET: value is not set / type is ONIG_TYPE_VOID
+ < 0: error code
# int onig_set_callout_data(OnigRegex reg, OnigMatchParam* mp, int callout_num, int slot, OnigType type, OnigValue* val)
Set the callout data value/type for a callout slot indicated by callout_num/slot.
- normal return: ONIG_NORMAL
- < 0: error code
+ ONIG_NORMAL: normal return
+ < 0: error code
# int onig_set_callout_data_by_tag(OnigRegex reg, OnigMatchParam* mp, const OnigUChar* tag, const OnigUChar* tag_end, int slot, OnigType type, OnigValue* val)
Set the callout data value/type for a callout slot indicated by tag/slot.
- normal return: ONIG_NORMAL
- < 0: error code
+ ONIG_NORMAL: normal return
+ < 0: error code
# int onig_get_callout_data_dont_clear_old(OnigRegex reg, OnigMatchParam* mp, int callout_num, int slot, OnigType* type, OnigValue* val)
@@ -359,6 +362,15 @@ Callouts API Version 6.8.2 2018/06/08
It will be abolished.
+# int onig_get_callout_data_by_tag_dont_clear_old(regex_t* reg, OnigMatchParam* mp, const UChar* tag, const UChar* tag_end, int slot, OnigType* type, OnigValue* val)
+
+ Returns the callout data value/type for a callout slot indicated by tag/slot.
+ This function does not clear the value set in the collation position before the current position. (dont_clear_old)
+
+ ONIG_NORMAL: 正常終了
+ ONIG_VALUE_IS_NOT_SET: 値が未セット / 型がVOID
+ < 0: エラーコード
+
(9) Miscellaneous functions
diff --git a/doc/CALLOUTS.API.ja b/doc/CALLOUTS.API.ja
index c56555a..028e07a 100644
--- a/doc/CALLOUTS.API.ja
+++ b/doc/CALLOUTS.API.ja
@@ -1,4 +1,4 @@
-Callouts API Version 6.8.2 2018/06/08
+Callouts API Version 6.9.7 2021/03/21
#include <oniguruma.h>
@@ -269,49 +269,50 @@ Callouts API Version 6.8.2 2018/06/08
callout_num/slotによって示された呼び出しスロットに対するデータの値/型を返す。
- 正常終了: ONIG_NORMAL
- 1: 値が未セット (typeは ONIG_TYPE_VOID)
- < 0: エラーコード
+ ONIG_NORMAL: 正常終了
+ ONIG_VALUE_IS_NOT_SET: 値が未セット / 型がVOID
+ < 0: エラーコード
# int onig_get_callout_data_by_callout_args_self(OnigCalloutArgs* args, int slot, OnigType* type, OnigValue* val)
自分自身の呼び出しのslotによって示されたスロットに対するデータの値/型を返す。
- 正常終了: ONIG_NORMAL
- 1: 値が未セット (typeは ONIG_TYPE_VOID)
- < 0: エラーコード
+ ONIG_NORMAL: 正常終了
+ ONIG_VALUE_IS_NOT_SET: 値が未セット / 型がVOID
+ < 0: エラーコード
# int onig_set_callout_data_by_callout_args(OnigCalloutArgs* args, int callout_num, int slot, OnigType type, OnigValue* val)
callout_num/slotによって示された呼び出しスロットに対する値/型をセットする。。
- 正常終了: ONIG_NORMAL
- < 0: エラーコード
+ ONIG_NORMAL: 正常終了
+ < 0: エラーコード
# int onig_set_callout_data_by_callout_args_self(OnigCalloutArgs* args, int slot, OnigType type, OnigValue* val)
自分自身の呼び出しのslotによって示されたスロットに対する値/型をセットする。。
- 正常終了: ONIG_NORMAL
- < 0: エラーコード
+ ONIG_NORMAL: 正常終了
+ < 0: エラーコード
# int onig_get_callout_data_by_callout_args_self_dont_clear_old(OnigCalloutArgs* args, int slot, OnigType* type, OnigValue* val)
この関数は、onig_get_callout_data_by_callout_args_self()とほぼ同じである。
- しかしこの関数は、現在の照合処理以前の失敗した照合処理の中でセットされた値を
- クリアしない。
- 他のonig_get_callout_data_xxxx()関数は、以前の失敗した照合処理の中でセットされた値を
- クリアする。
+ しかしこの関数は、現在の位置より以前の照合位置の中でセットされた値をクリアしない。(dont_clear_old)
+ 他のonig_get_callout_data_xxxx()関数は、以前の位置の照合処理の中でセットされた値をクリアする。
例えば、組み込み呼び出し(*TOTAL_COUNT)は、検索処理の中の全ての照合処理の積算カウントを
得るためにこの関数を使用して実装されている。
組み込む呼び出し(*COUNT)は、この関数を使用しないので、最後の成功した照合処理だけの
カウントを返す。
+ ONIG_NORMAL: 正常終了
+ ONIG_VALUE_IS_NOT_SET: 値が未セット / 型がVOID
+ < 0: エラーコード
(8) 呼び出しデータ (アプリケーションから使用される)
@@ -320,34 +321,34 @@ Callouts API Version 6.8.2 2018/06/08
callout_num/slotによって示された呼び出しスロットに対するデータの値/型を返す。
- 正常終了: ONIG_NORMAL
- 1: 値が未セット (typeは ONIG_TYPE_VOID)
- < 0: エラーコード
+ ONIG_NORMAL: 正常終了
+ ONIG_VALUE_IS_NOT_SET: 値が未セット / 型がVOID
+ < 0: エラーコード
# int onig_get_callout_data_by_tag(OnigRegex reg, OnigMatchParam* mp, const OnigUChar* tag, const OnigUChar* tag_end, int slot, OnigType* type, OnigValue* val)
tag/slotによって示された呼び出しスロットに対するデータの値/型を返す。
- 正常終了: ONIG_NORMAL
- 1: 値が未セット (typeは ONIG_TYPE_VOID)
- < 0: エラーコード
+ ONIG_NORMAL: 正常終了
+ ONIG_VALUE_IS_NOT_SET: 値が未セット / 型がVOID
+ < 0: エラーコード
# int onig_set_callout_data(OnigRegex reg, OnigMatchParam* mp, int callout_num, int slot, OnigType type, OnigValue* val)
callout_num/slotによって示された呼び出しスロットに対する値/型をセットする。。
- 正常終了: ONIG_NORMAL
- < 0: エラーコード
+ ONIG_NORMAL: 正常終了
+ < 0: エラーコード
# int onig_set_callout_data_by_tag(OnigRegex reg, OnigMatchParam* mp, const OnigUChar* tag, const OnigUChar* tag_end, int slot, OnigType type, OnigValue* val)
- tag/slotによって示された呼び出しスロットに対する値/型をセットする。。
+ tag/slotによって示された呼び出しスロットに対する値/型をセットする。
- 正常終了: ONIG_NORMAL
- < 0: エラーコード
+ ONIG_NORMAL: 正常終了
+ < 0: エラーコード
# int onig_get_callout_data_dont_clear_old(OnigRegex reg, OnigMatchParam* mp, int callout_num, int slot, OnigType* type, OnigValue* val)
@@ -356,6 +357,16 @@ Callouts API Version 6.8.2 2018/06/08
廃止予定。
+# int onig_get_callout_data_by_tag_dont_clear_old(regex_t* reg, OnigMatchParam* mp, const UChar* tag, const UChar* tag_end, int slot, OnigType* type, OnigValue* val)
+
+ tag/slotによって示された呼び出しスロットに対するデータの値/型を返す。
+ この関数は、現在の位置より以前の照合位置の中でセットされた値をクリアしない。
+ (dont_clear_old)
+
+ ONIG_NORMAL: 正常終了
+ ONIG_VALUE_IS_NOT_SET: 値が未セット / 型がVOID
+ < 0: エラーコード
+
(9) その他の関数