Skip to content

Commit

Permalink
Add a PKG_PLUGIN_HOOK_EVENT to receive all the event through a plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
bapt committed Oct 30, 2012
1 parent fa5dd5d commit 950aec8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions libpkg/pkg.h
Expand Up @@ -312,6 +312,7 @@ typedef enum _pkg_plugin_hook_t {
PKG_PLUGIN_HOOK_POST_DEINSTALL,
PKG_PLUGIN_HOOK_PRE_FETCH,
PKG_PLUGIN_HOOK_POST_FETCH,
PKG_PLUGIN_HOOK_EVENT,
} pkg_plugin_hook_t;

/**
Expand Down
1 change: 1 addition & 0 deletions libpkg/pkg_event.c
Expand Up @@ -43,6 +43,7 @@ pkg_event_register(pkg_event_cb cb, void *data)
static void
pkg_emit_event(struct pkg_event *ev)
{
pkg_plugins_hook_run(PKG_PLUGIN_HOOK_EVENT, ev, NULL);
if (_cb != NULL)
_cb(_data, ev);
}
Expand Down

0 comments on commit 950aec8

Please sign in to comment.