Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Merge branch 'master' of git://github.com/wca/pkgng
Will Andrews committed 14 years ago
commit 37345a231c95ae0e5086bd9d79849c41a8a51e3d
parent 1447b56
1 file changed +29 -0
added libpkg/pkg_handle.c
@@ -0,0 +1,29 @@
+
#include "pkg.h"
+

+
struct pkg_handle __pkg_handle_singleton;
+

+
struct pkg_handle *
+
pkg_get_handle(void)
+
{
+
	return &__pkg_handle_singleton;
+
}
+

+
void
+
pkg_handle_set_event_callback(struct pkg_handle *hdl, pkg_event_cb event_cb)
+
{
+
	hdl->event_cb = event_cb;
+
}
+

+
pkg_event_cb
+
pkg_handle_get_event_callback(struct pkg_handle *hdl)
+
{
+
	return hdl->event_cb;
+
}
+

+
void
+
__pkg_emit_event(struct pkg_handle *hdl, pkg_event_t ev, void *arg0, void *arg1)
+
{
+
	if (hdl == NULL || hdl->event_cb == NULL)
+
		return;
+
	hdl->event_cb(ev, arg0, arg1);
+
}