]> granicus.if.org Git - onig/commitdiff
add onig_new_match_param()
authorK.Kosako <kosako@sofnec.co.jp>
Tue, 13 Feb 2018 06:32:09 +0000 (15:32 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Tue, 13 Feb 2018 06:32:09 +0000 (15:32 +0900)
src/oniguruma.h
src/regexec.c

index 868ae4248f3533373bf809ae17f9753ee481a7eb..d3d8f8710c3d66a6fcf9bd2aed74d704e7a0ccf9 100644 (file)
@@ -903,6 +903,8 @@ const char* onig_copyright P_((void));
 
 /* for OnigMatchParam */
 ONIG_EXTERN
+OnigMatchParam* onig_new_match_param P_((void));
+ONIG_EXTERN
 void onig_initialize_match_param P_((OnigMatchParam* mp));
 ONIG_EXTERN
 int onig_set_match_stack_limit_size_of_match_param P_((OnigMatchParam* param, unsigned int limit));
index 0556bb39a05c632b69115ebbb361bdeab73e1650..e974e5fd0d7d00a0fa58191cc5f565950e42a457 100644 (file)
@@ -1156,6 +1156,19 @@ onig_set_retry_limit_in_match(unsigned long size)
 static OnigCalloutFunc DefaultCallout;
 static OnigCalloutFunc DefaultRetractionCallout;
 
+extern OnigMatchParam*
+onig_new_match_param(void)
+{
+  OnigMatchParam* p;
+
+  p = (OnigMatchParam* )xmalloc(sizeof(*p));
+  if (IS_NOT_NULL(p)) {
+    onig_initialize_match_param(p);
+  }
+
+  return p;
+}
+
 extern void
 onig_initialize_match_param(OnigMatchParam* mp)
 {