From: K.Kosako Date: Fri, 2 Mar 2018 01:59:19 +0000 (+0900) Subject: add BC0_B() macro X-Git-Tag: v6.8.0~96 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f622f85e45d1b5a1b242d390e0f5e01c528eacc;p=onig add BC0_B() macro --- diff --git a/src/regint.h b/src/regint.h index cee3513..c018d5c 100644 --- a/src/regint.h +++ b/src/regint.h @@ -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,\