[Groonga-commit] groonga/groonga at 9f43c68 [master] Support tagged plugin entry point functions

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Feb 1 18:40:38 JST 2015


Kouhei Sutou	2015-02-01 18:40:38 +0900 (Sun, 01 Feb 2015)

  New Revision: 9f43c68716511d18d2a74b164a129746b7d2105d
  https://github.com/groonga/groonga/commit/9f43c68716511d18d2a74b164a129746b7d2105d

  Message:
    Support tagged plugin entry point functions
    
    It's for implementing builtin plugins by users.

  Modified files:
    include/groonga/plugin.h

  Modified: include/groonga/plugin.h (+18 -3)
===================================================================
--- include/groonga/plugin.h    2015-01-30 23:08:32 +0900 (d0f5fba)
+++ include/groonga/plugin.h    2015-02-01 18:40:38 +0900 (a89b674)
@@ -26,9 +26,24 @@
 extern "C" {
 #endif
 
-#define GRN_PLUGIN_INIT grn_plugin_impl_init
-#define GRN_PLUGIN_REGISTER grn_plugin_impl_register
-#define GRN_PLUGIN_FIN grn_plugin_impl_fin
+# define GRN_PLUGIN_IMPL_NAME_RAW(type)         \
+  grn_plugin_impl_ ## type
+# define GRN_PLUGIN_IMPL_NAME_TAGGED(type, tag) \
+  GRN_PLUGIN_IMPL_NAME_RAW(type ## _ ## tag)
+# define GRN_PLUGIN_IMPL_NAME_TAGGED_EXPANDABLE(type, tag)      \
+  GRN_PLUGIN_IMPL_NAME_TAGGED(type, tag)
+
+#if defined(GRN_PLUGIN_BUILTIN) && defined(GRN_PLUGIN_BUILTIN_TAG)
+# define GRN_PLUGIN_IMPL_NAME(type)                             \
+  GRN_PLUGIN_IMPL_NAME_TAGGED_EXPANDABLE(type, GRN_PLUGIN_BUILTIN_TAG)
+#else /* GRN_PLUGIN_BUILTIN */
+# define GRN_PLUGIN_IMPL_NAME(type)             \
+  GRN_PLUGIN_IMPL_NAME_RAW(type)
+#endif /* GRN_PLUGIN_BUILTIN */
+
+#define GRN_PLUGIN_INIT     GRN_PLUGIN_IMPL_NAME(init)
+#define GRN_PLUGIN_REGISTER GRN_PLUGIN_IMPL_NAME(register)
+#define GRN_PLUGIN_FIN      GRN_PLUGIN_IMPL_NAME(fin)
 
 #if defined(_WIN32) || defined(_WIN64)
 #  define GRN_PLUGIN_EXPORT __declspec(dllexport)
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index