]> granicus.if.org Git - onig/commitdiff
move builtin callout definition macros from regenc.h to regint.h
authorK.Kosako <kkosako0@gmail.com>
Mon, 26 Feb 2018 13:05:49 +0000 (22:05 +0900)
committerK.Kosako <kkosako0@gmail.com>
Mon, 26 Feb 2018 13:05:49 +0000 (22:05 +0900)
src/regenc.h
src/regint.h

index 69e33c8dd67d312d3aea2f1b34206cd5602dd0c7..9212b47f05884576d2f3e2580150523c6600e5d2 100644 (file)
@@ -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 */
index 07e80f277a57a39f93b87f2dad206db9af7ff086..caa8311da3caf84d68ecbb909df47c04f8f3c656 100644 (file)
@@ -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;