plugin: Add private method plugin_exists() to check for HOOKs

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2017-07-07 23:33:43 +02:00
parent 46c5e41b68
commit 709e4230c8
2 changed files with 12 additions and 0 deletions
+11
View File
@@ -163,6 +163,17 @@ plugin_t *plugin_find(char *name)
}
/* Private daemon API *******************************************************/
int plugin_exists(hook_point_t no)
{
plugin_t *p, *tmp;
PLUGIN_ITERATOR(p, tmp) {
if (p->hook[no].cb)
return 1;
}
return 0;
}
/* Some hooks are called with a fixed argument, like HOOK_SVC_LOST */
void plugin_run_hook(hook_point_t no, void *arg)
+1
View File
@@ -40,6 +40,7 @@ int client (int argc, char *argv[]);
void service_monitor (pid_t lost);
int plugin_exists (hook_point_t no);
void plugin_run_hook (hook_point_t no, void *arg);
void plugin_run_hooks (hook_point_t no);