diff --git a/src/core/plugin.c b/src/core/plugin.c
index e2fce04dcc75b1c7180ca23b0b43f68384df222a..bf0bdb34a20af428c73ab63250c7b0f4d3f4c00b 100644 (file)
--- a/src/core/plugin.c
+++ b/src/core/plugin.c
/* else: other callbacks still reference it */
} /* plugin_unregister_by_name */
/* else: other callbacks still reference it */
} /* plugin_unregister_by_name */
-static void
-plugin_unregister_all(void)
-{
- size_t i;
-
- for (i = 0; i < SDB_STATIC_ARRAY_LEN(all_lists); ++i) {
- const char *type = all_lists[i].type;
- sdb_llist_t *list = *all_lists[i].list;
-
- size_t len = sdb_llist_len(list);
-
- if (! len)
- continue;
-
- sdb_llist_clear(list);
- sdb_log(SDB_LOG_INFO, "core: Unregistered %zu %s callback%s",
- len, type, len == 1 ? "" : "s");
- }
-} /* plugin_unregister_all */
-
/*
* private types
*/
/*
* private types
*/
"config callback from outside a plugin");
return -1;
}
"config callback from outside a plugin");
return -1;
}
- return plugin_add_callback(&config_list, "init", ctx->info.plugin_name,
+ return plugin_add_callback(&config_list, "config", ctx->info.plugin_name,
(void *)callback, NULL);
} /* sdb_plugin_register_config */
(void *)callback, NULL);
} /* sdb_plugin_register_config */
return 0;
} /* sdb_store_register_writer */
return 0;
} /* sdb_store_register_writer */
+void
+sdb_plugin_unregister_all(void)
+{
+ size_t i;
+
+ for (i = 0; i < SDB_STATIC_ARRAY_LEN(all_lists); ++i) {
+ const char *type = all_lists[i].type;
+ sdb_llist_t *list = *all_lists[i].list;
+
+ size_t len = sdb_llist_len(list);
+
+ if (! len)
+ continue;
+
+ sdb_llist_clear(list);
+ sdb_log(SDB_LOG_INFO, "core: Unregistered %zu %s callback%s",
+ len, type, len == 1 ? "" : "s");
+ }
+} /* sdb_plugin_unregister_all */
+
sdb_plugin_ctx_t
sdb_plugin_get_ctx(void)
{
sdb_plugin_ctx_t
sdb_plugin_get_ctx(void)
{
CTX(sdb_llist_iter_get_next(iter))->use_cnt = 0;
sdb_llist_iter_destroy(iter);
CTX(sdb_llist_iter_get_next(iter))->use_cnt = 0;
sdb_llist_iter_destroy(iter);
- plugin_unregister_all();
+ sdb_plugin_unregister_all();
return 0;
} /* sdb_plugin_reconfigure_init */
return 0;
} /* sdb_plugin_reconfigure_init */