aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-02-11 18:56:13 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2011-02-11 18:56:13 +0100
commitd55e13964916af6a083be881bffdb493af287c1d (patch)
tree399af6f19989d3efedb0a66f0e7b99184b245bb9 /include
parente52e67cb512e775fd83ca399cc807c363ba59dcc (diff)
downloadbusybox-w32-d55e13964916af6a083be881bffdb493af287c1d.tar.gz
busybox-w32-d55e13964916af6a083be881bffdb493af287c1d.tar.bz2
busybox-w32-d55e13964916af6a083be881bffdb493af287c1d.zip
progress meter: move file name to bb_progress_t. +20 bytes
We were doing expensive unicode conversion on every update Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/libbb.h b/include/libbb.h
index c0178801f..7581cd4c4 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -1587,15 +1587,21 @@ typedef struct bb_progress_t {
1587 off_t lastsize; 1587 off_t lastsize;
1588 unsigned lastupdate_sec; 1588 unsigned lastupdate_sec;
1589 unsigned start_sec; 1589 unsigned start_sec;
1590 smallint inited; 1590 const char *curfile;
1591} bb_progress_t; 1591} bb_progress_t;
1592 1592
1593void bb_progress_init(bb_progress_t *p) FAST_FUNC; 1593#define is_bb_progress_inited(p) ((p)->curfile != NULL)
1594void bb_progress_update(bb_progress_t *p, const char *curfile, 1594#define bb_progress_free(p) do { \
1595 if (ENABLE_UNICODE_SUPPORT) free((char*)((p)->curfile)); \
1596 (p)->curfile = NULL; \
1597} while (0)
1598void bb_progress_init(bb_progress_t *p, const char *curfile) FAST_FUNC;
1599void bb_progress_update(bb_progress_t *p,
1595 uoff_t beg_range, 1600 uoff_t beg_range,
1596 uoff_t transferred, 1601 uoff_t transferred,
1597 uoff_t totalsize) FAST_FUNC; 1602 uoff_t totalsize) FAST_FUNC;
1598 1603
1604
1599extern const char *applet_name; 1605extern const char *applet_name;
1600 1606
1601/* Some older linkers don't perform string merging, we used to have common strings 1607/* Some older linkers don't perform string merging, we used to have common strings