From edab8ace2f292ee4cf33e0d49f493252342e2aaf Mon Sep 17 00:00:00 2001 From: "K.Kosako" Date: Wed, 4 Apr 2018 16:23:27 +0900 Subject: [PATCH] add onig_set_callout_user_data_of_match_param() --- src/oniguruma.h | 2 ++ src/regexec.c | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/oniguruma.h b/src/oniguruma.h index 2128783..8ef3d78 100644 --- a/src/oniguruma.h +++ b/src/oniguruma.h @@ -894,6 +894,8 @@ ONIG_EXTERN int onig_set_progress_callout_of_match_param P_((OnigMatchParam* param, OnigCalloutFunc f)); ONIG_EXTERN int onig_set_retraction_callout_of_match_param P_((OnigMatchParam* param, OnigCalloutFunc f)); +ONIG_EXTERN +int onig_set_callout_user_data_of_match_param P_((OnigMatchParam* param, void* user_data)); /* for callout functions */ ONIG_EXTERN diff --git a/src/regexec.c b/src/regexec.c index d73e742..d16c47b 100644 --- a/src/regexec.c +++ b/src/regexec.c @@ -100,6 +100,17 @@ onig_set_retraction_callout_of_match_param(OnigMatchParam* param, OnigCalloutFun #endif } +extern int +onig_set_callout_user_data_of_match_param(OnigMatchParam* param, void* user_data) +{ +#ifdef USE_CALLOUT + param->callout_user_data = user_data; + return ONIG_NORMAL; +#else + return ONIG_NO_SUPPORT_CONFIG; +#endif +} + typedef struct { -- 2.40.0