summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/handle.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-09-02 00:16:56 +0200
committerDan McGee <dan@archlinux.org>2011-09-03 04:45:03 +0200
commit37da18aee8d925ee5cd9f526f2c61d07e9db5b66 (patch)
tree3ed740826f4463c8779080b07b57adbde1fe5c3b /lib/libalpm/handle.c
parentd88e524e7c6e902dcf1c0afed52def0d8b430b25 (diff)
downloadpacman-37da18aee8d925ee5cd9f526f2c61d07e9db5b66.tar.gz
pacman-37da18aee8d925ee5cd9f526f2c61d07e9db5b66.tar.xz
Move all callbacks up to the handle level
This was just disgusting before, unnecessary to limit these to only usage in a transaction. Still a lot of more room for cleanup but we'll start by attaching them to the handle rather than the transaction we may or may not even want to use these callbacks. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/handle.c')
-rw-r--r--lib/libalpm/handle.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index b9d71db8..bc968c72 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -166,6 +166,24 @@ alpm_cb_totaldl SYMEXPORT alpm_option_get_totaldlcb(alpm_handle_t *handle)
return handle->totaldlcb;
}
+alpm_cb_event SYMEXPORT alpm_option_get_eventcb(alpm_handle_t *handle)
+{
+ CHECK_HANDLE(handle, return NULL);
+ return handle->eventcb;
+}
+
+alpm_cb_conv SYMEXPORT alpm_option_get_convcb(alpm_handle_t *handle)
+{
+ CHECK_HANDLE(handle, return NULL);
+ return handle->convcb;
+}
+
+alpm_cb_progress SYMEXPORT alpm_option_get_progresscb(alpm_handle_t *handle)
+{
+ CHECK_HANDLE(handle, return NULL);
+ return handle->progresscb;
+}
+
const char SYMEXPORT *alpm_option_get_root(alpm_handle_t *handle)
{
CHECK_HANDLE(handle, return NULL);
@@ -290,6 +308,27 @@ int SYMEXPORT alpm_option_set_totaldlcb(alpm_handle_t *handle, alpm_cb_totaldl c
return 0;
}
+int SYMEXPORT alpm_option_set_eventcb(alpm_handle_t *handle, alpm_cb_event cb)
+{
+ CHECK_HANDLE(handle, return -1);
+ handle->eventcb = cb;
+ return 0;
+}
+
+int SYMEXPORT alpm_option_set_convcb(alpm_handle_t *handle, alpm_cb_conv cb)
+{
+ CHECK_HANDLE(handle, return -1);
+ handle->convcb = cb;
+ return 0;
+}
+
+int SYMEXPORT alpm_option_set_progresscb(alpm_handle_t *handle, alpm_cb_progress cb)
+{
+ CHECK_HANDLE(handle, return -1);
+ handle->progresscb = cb;
+ return 0;
+}
+
static char *canonicalize_path(const char *path) {
char *new_path;
size_t len;