int onig_match P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* at, OnigRegion* region, OnigOptionType option));
ONIG_EXTERN
int onig_match_with_params P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* at, OnigRegion* region, OnigOptionType option, OnigMatchParam* mp));
-ONIG_EXTERN
-void onig_initialize_match_params P_((OnigMatchParam* mp));
-
ONIG_EXTERN
OnigRegion* onig_region_new P_((void));
ONIG_EXTERN
ONIG_EXTERN
const char* onig_copyright P_((void));
+/* for OnigMatchParam */
+ONIG_EXTERN
+void onig_initialize_match_params P_((OnigMatchParam* mp));
+ONIG_EXTERN
+int onig_set_match_stack_limit_size_of_match_param P_((OnigMatchParam* param, unsigned int limit));
+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_code_of_match_param P_((OnigMatchParam* param, OnigCalloutFunc f));
+ONIG_EXTERN
+int onig_set_retraction_callout_of_code_of_match_param P_((OnigMatchParam* param, OnigCalloutFunc f));
+
/* for callout functions */
ONIG_EXTERN
int onig_initialize_builtin_callouts P_((void));
#define CHECK_INTERRUPT_IN_MATCH
+
struct OnigMatchParamStruct {
unsigned int match_stack_limit;
unsigned long retry_limit_in_match;
void* callout_user_data;
};
+extern int
+onig_set_match_stack_limit_size_of_match_param(OnigMatchParam* param,
+ unsigned int limit)
+{
+ param->match_stack_limit = limit;
+ return ONIG_NORMAL;
+}
+
+extern int
+onig_set_retry_limit_in_match_of_match_param(OnigMatchParam* param,
+ unsigned long limit)
+{
+ param->retry_limit_in_match = limit;
+ return ONIG_NORMAL;
+}
+
+extern int
+onig_set_callout_of_code_of_match_param(OnigMatchParam* param, OnigCalloutFunc f)
+{
+ param->callout_of_code = f;
+ return ONIG_NORMAL;
+}
+
+extern int
+onig_set_retraction_callout_of_code_of_match_param(OnigMatchParam* param,
+ OnigCalloutFunc f)
+{
+ param->retraction_callout_of_code = f;
+ return ONIG_NORMAL;
+}
+
+
+
typedef struct {
void* stack_p;
int stack_n;