]> granicus.if.org Git - onig/commitdiff
add BC0_B() macro
authorK.Kosako <kosako@sofnec.co.jp>
Fri, 2 Mar 2018 01:59:19 +0000 (10:59 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Fri, 2 Mar 2018 01:59:19 +0000 (10:59 +0900)
src/regint.h

index cee3513daff86b58e9b724849c692a4fdf0e96ee..c018d5c5639fe29955cc81fe42f56424a10cd7da 100644 (file)
@@ -849,6 +849,15 @@ extern OnigCalloutFunc onig_get_callout_start_func_by_callout_num(regex_t* reg,
   if (id < 0) return id;\
 } while(0)
 
+#define BC0_B(name, func)  do {\
+  int len = onigenc_str_bytelen_null(enc, (UChar* )name);\
+  id = onig_set_callout_of_name(enc, ONIG_CALLOUT_TYPE_SINGLE,\
+                              (UChar* )(name), (UChar* )((name) + len),\
+                              ONIG_CALLOUT_IN_BOTH,\
+                              onig_builtin_ ## func, 0, 0, 0, 0, 0);\
+  if (id < 0) return id;\
+} while(0)
+
 #define BC1_P(name, func, ts)  do {\
   int len = onigenc_str_bytelen_null(enc, (UChar* )name);\
   id = onig_set_callout_of_name(enc, ONIG_CALLOUT_TYPE_SINGLE,\