mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 14:02:52 +07:00
plugin: Add private method plugin_exists() to check for HOOKs
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user