From ab424eba3e5dbf93309c97d43a055f3ed0997bf8 Mon Sep 17 00:00:00 2001 From: "K.Kosako" Date: Mon, 26 Feb 2018 22:05:49 +0900 Subject: [PATCH] move builtin callout definition macros from regenc.h to regint.h --- src/regenc.h | 29 ----------------------------- src/regint.h | 31 ++++++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/regenc.h b/src/regenc.h index 69e33c8..9212b47 100644 --- a/src/regenc.h +++ b/src/regenc.h @@ -255,33 +255,4 @@ extern const unsigned short OnigEncAsciiCtypeTable[]; #define ONIGENC_IS_ASCII_COMPATIBLE_ENCODING(enc) ((enc)->min_enc_len == 1) - -/* for definition of builtin callout */ -#define BC0_P(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_PROGRESS,\ - onig_builtin_ ## func, 0, 0, 0, 0, 0);\ - if (id < 0) return id;\ -} while(0) - -#define BC0_R(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_RETRACTION,\ - 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,\ - (UChar* )(name), (UChar* )((name) + len),\ - ONIG_CALLOUT_IN_PROGRESS,\ - onig_builtin_ ## func, 0, 1, (ts), 0, 0);\ - if (id < 0) return id;\ -} while(0) - #endif /* REGENC_H */ diff --git a/src/regint.h b/src/regint.h index 07e80f2..caa8311 100644 --- a/src/regint.h +++ b/src/regint.h @@ -827,7 +827,36 @@ extern int onig_callout_tag_table_free(void* table); extern void onig_free_reg_callout_list(int n, CalloutListEntry* list); extern CalloutListEntry* onig_reg_callout_list_at(regex_t* reg, int num); -#endif +/* for definition of builtin callout */ +#define BC0_P(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_PROGRESS,\ + onig_builtin_ ## func, 0, 0, 0, 0, 0);\ + if (id < 0) return id;\ +} while(0) + +#define BC0_R(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_RETRACTION,\ + 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,\ + (UChar* )(name), (UChar* )((name) + len),\ + ONIG_CALLOUT_IN_PROGRESS,\ + onig_builtin_ ## func, 0, 1, (ts), 0, 0);\ + if (id < 0) return id;\ +} while(0) + +#endif /* USE_CALLOUT */ + /* strend hash */ typedef void hash_table_type; -- 2.40.0