summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 56b97a1)
raw | patch | inline | side by side (parent: 56b97a1)
author | Sebastian Harl <sh@tokkee.org> | |
Tue, 1 Jul 2014 19:56:02 +0000 (21:56 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Tue, 1 Jul 2014 19:56:02 +0000 (21:56 +0200) |
This function returns the plugin information for the plugin from which the
current call into the core originated.
current call into the core originated.
src/core/plugin.c | patch | blob | history | |
src/include/core/plugin.h | patch | blob | history |
diff --git a/src/core/plugin.c b/src/core/plugin.c
index f10a904169f5d3993dc89894535e6a7b4ca01513..806e13c2f717f27b339ffd42b4cf43f4e2c3575b 100644 (file)
--- a/src/core/plugin.c
+++ b/src/core/plugin.c
return 0;
} /* sdb_plugin_set_ctx */
+const sdb_plugin_info_t *
+sdb_plugin_current(void)
+{
+ ctx_t *ctx = ctx_get();
+
+ if (! ctx)
+ return NULL;
+ return &ctx->info;
+} /* sdb_plugin_current */
+
int
sdb_plugin_configure(const char *name, oconfig_item_t *ci)
{
index e6ea7573cf15a0514c939c754eed48ae16c10964..f75788ad2359a479c5be92d276366d41bf2fa21b 100644 (file)
int
sdb_plugin_set_ctx(sdb_plugin_ctx_t ctx, sdb_plugin_ctx_t *old);
+/*
+ * sdb_plugin_current:
+ * Retrieve information about the plugin (if any) from which the current call
+ * into the core originated. The return value may not be modified.
+ *
+ * Returns:
+ * - information about the current plugin if we were called from some
+ * plugin's callback function
+ * - NULL else
+ */
+const sdb_plugin_info_t *
+sdb_plugin_current(void);
+
/*
* sdb_plugin_configure:
* Configure the plugin called 'name' using the config tree 'ci'. The plugin