From 9e217ad4f45431cee16bba93623ff466aed86d49 Mon Sep 17 00:00:00 2001 From: "K.Kosako" Date: Tue, 13 Mar 2018 09:47:42 +0900 Subject: [PATCH] rename some callouts API --- src/oniguruma.h | 12 ++++++------ src/regexec.c | 27 +++++++++++++-------------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/oniguruma.h b/src/oniguruma.h index 8048915..d329b33 100644 --- a/src/oniguruma.h +++ b/src/oniguruma.h @@ -927,19 +927,19 @@ int onig_set_match_stack_limit_size_of_match_param P_((OnigMatchParam* param, un ONIG_EXTERN int onig_set_retry_limit_in_match_of_match_param P_((OnigMatchParam* param, unsigned long limit)); ONIG_EXTERN -int onig_set_callout_of_contents_of_match_param P_((OnigMatchParam* param, OnigCalloutFunc f)); +int onig_set_progress_callout_of_match_param P_((OnigMatchParam* param, OnigCalloutFunc f)); ONIG_EXTERN -int onig_set_retraction_callout_of_contents_of_match_param P_((OnigMatchParam* param, OnigCalloutFunc f)); +int onig_set_retraction_callout_of_match_param P_((OnigMatchParam* param, OnigCalloutFunc f)); /* for callout functions */ ONIG_EXTERN -OnigCalloutFunc onig_get_callout_of_contents P_((void)); +OnigCalloutFunc onig_get_progress_callout P_((void)); ONIG_EXTERN -int onig_set_callout_of_contents P_((OnigCalloutFunc f)); +int onig_set_progress_callout P_((OnigCalloutFunc f)); ONIG_EXTERN -OnigCalloutFunc onig_get_retraction_callout_of_contents P_((void)); +OnigCalloutFunc onig_get_retraction_callout P_((void)); ONIG_EXTERN -int onig_set_retraction_callout_of_contents P_((OnigCalloutFunc f)); +int onig_set_retraction_callout P_((OnigCalloutFunc f)); ONIG_EXTERN int onig_set_callout_of_name P_((OnigEncoding enc, OnigCalloutType type, OnigUChar* name, OnigUChar* name_end, int callout_in, OnigCalloutFunc callout, OnigCalloutFunc end_callout, int arg_num, unsigned int arg_types[], int optional_arg_num, OnigValue opt_defaults[])); /* name: single-byte string */ ONIG_EXTERN diff --git a/src/regexec.c b/src/regexec.c index f9645dc..f0524c2 100644 --- a/src/regexec.c +++ b/src/regexec.c @@ -52,7 +52,7 @@ typedef struct { struct OnigMatchParamStruct { unsigned int match_stack_limit; unsigned long retry_limit_in_match; - OnigCalloutFunc callout_of_contents; + OnigCalloutFunc progress_callout_of_contents; OnigCalloutFunc retraction_callout_of_contents; #ifdef USE_CALLOUT int match_at_call_counter; @@ -79,15 +79,14 @@ onig_set_retry_limit_in_match_of_match_param(OnigMatchParam* param, } extern int -onig_set_callout_of_contents_of_match_param(OnigMatchParam* param, OnigCalloutFunc f) +onig_set_progress_callout_of_match_param(OnigMatchParam* param, OnigCalloutFunc f) { - param->callout_of_contents = f; + param->progress_callout_of_contents = f; return ONIG_NORMAL; } extern int -onig_set_retraction_callout_of_contents_of_match_param(OnigMatchParam* param, - OnigCalloutFunc f) +onig_set_retraction_callout_of_match_param(OnigMatchParam* param, OnigCalloutFunc f) { param->retraction_callout_of_contents = f; return ONIG_NORMAL; @@ -1145,7 +1144,7 @@ onig_set_retry_limit_in_match(unsigned long size) #endif } -static OnigCalloutFunc DefaultCallout; +static OnigCalloutFunc DefaultProgressCallout; static OnigCalloutFunc DefaultRetractionCallout; extern OnigMatchParam* @@ -1188,7 +1187,7 @@ onig_initialize_match_param(OnigMatchParam* mp) #ifdef USE_RETRY_LIMIT_IN_MATCH mp->retry_limit_in_match = RetryLimitInMatch; #endif - mp->callout_of_contents = DefaultCallout; + mp->progress_callout_of_contents = DefaultProgressCallout; mp->retraction_callout_of_contents = DefaultRetractionCallout; #ifdef USE_CALLOUT @@ -3886,7 +3885,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end, } else { name_id = ONIG_NON_NAME_ID; - func = msa->mp->callout_of_contents; + func = msa->mp->progress_callout_of_contents; } if (IS_NOT_NULL(func) && (in & ONIG_CALLOUT_IN_PROGRESS) != 0) { @@ -5058,26 +5057,26 @@ onig_copy_encoding(OnigEncoding to, OnigEncoding from) #ifdef USE_CALLOUT extern OnigCalloutFunc -onig_get_callout_of_contents(void) +onig_get_progress_callout(void) { - return DefaultCallout; + return DefaultProgressCallout; } extern int -onig_set_callout_of_contents(OnigCalloutFunc f) +onig_set_progress_callout(OnigCalloutFunc f) { - DefaultCallout = f; + DefaultProgressCallout = f; return ONIG_NORMAL; } extern OnigCalloutFunc -onig_get_retraction_callout_of_contents(void) +onig_get_retraction_callout(void) { return DefaultRetractionCallout; } extern int -onig_set_retraction_callout_of_contents(OnigCalloutFunc f) +onig_set_retraction_callout(OnigCalloutFunc f) { DefaultRetractionCallout = f; return ONIG_NORMAL; -- 2.40.0