diff options
author | Timo Teras <timo.teras@iki.fi> | 2009-01-07 21:45:11 +0200 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2009-01-07 21:45:11 +0200 |
commit | 052fbe3f86eaab1940f25824705d809cd9af59e5 (patch) | |
tree | 248d8da56e8660db2aa09a17bd52d25e0256cf29 /src/io.c | |
parent | c7ffc96a16c6963fe0a07be7ee75e8f1f7426882 (diff) | |
download | apk-tools-052fbe3f86eaab1940f25824705d809cd9af59e5.tar.bz2 apk-tools-052fbe3f86eaab1940f25824705d809cd9af59e5.tar.xz |
various: make fancy progress bar and update todo
Diffstat (limited to 'src/io.c')
-rw-r--r-- | src/io.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -108,7 +108,8 @@ size_t apk_istream_skip(struct apk_istream *is, size_t size) return done; } -size_t apk_istream_splice(void *stream, int fd, size_t size) +size_t apk_istream_splice(void *stream, int fd, size_t size, + apk_progress_cb cb, void *cb_ctx) { struct apk_istream *is = (struct apk_istream *) stream; unsigned char *buf; @@ -123,6 +124,9 @@ size_t apk_istream_splice(void *stream, int fd, size_t size) return -1; while (done < size) { + if (done != 0 && cb != NULL) + cb(cb_ctx, muldiv(APK_PROGRESS_SCALE, done, size)); + togo = size - done; if (togo > bufsz) togo = bufsz; |