diff options
author | Dan McGee <dan@archlinux.org> | 2008-06-02 06:10:30 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2008-06-04 22:38:53 +0200 |
commit | fe781e4ce4ace4410bbc8bec441140cfc323d262 (patch) | |
tree | cdb570aeb1e475bf3c5543d6548fd4ea26e871db /lib/libalpm/alpm.h | |
parent | 0669c9bfac7aead01f1400444e691d542f7645c2 (diff) | |
download | pacman-fe781e4ce4ace4410bbc8bec441140cfc323d262.tar.gz pacman-fe781e4ce4ace4410bbc8bec441140cfc323d262.tar.xz |
Reimplement TotalDownload functionality
Add a new totaldlcb callback function to libalpm and make pacman utilize it
when the TotalDownload option is enabled. This callback function is pretty
simple- it is meant to be called once at the beginning of a "list download"
action, and once at the end (with value 0 to indicate the list has been
finished). The frontend is responsible for keeping track of adding
individual file download amounts to the total xfered amount in order to
display some sort of overall progress.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/alpm.h')
-rw-r--r-- | lib/libalpm/alpm.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index fd3be0d3..9ed2c676 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -82,19 +82,21 @@ int alpm_logaction(char *fmt, ...); typedef void (*alpm_cb_download)(const char *filename, off_t xfered, off_t total); +typedef void (*alpm_cb_totaldl)(off_t total); /* * Options */ -#define PM_DLFNM_LEN 22 - alpm_cb_log alpm_option_get_logcb(); void alpm_option_set_logcb(alpm_cb_log cb); alpm_cb_download alpm_option_get_dlcb(); void alpm_option_set_dlcb(alpm_cb_download cb); +alpm_cb_totaldl alpm_option_get_totaldlcb(); +void alpm_option_set_totaldlcb(alpm_cb_totaldl cb); + const char *alpm_option_get_root(); int alpm_option_set_root(const char *root); |