diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-01 19:55:11 +0400 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-01 19:55:11 +0400 |
commit | 97a8dd3857aea9730382e2975a2ee2000fd23ebb (patch) | |
tree | 608f73898f3ed5f466dff68189625fa9328a15be /archival/libunarchive/decompress_unlzma.c | |
parent | f8aa109a9f7c67b291f240fb3ed91da90f26359b (diff) |
g[un]zip: add support for -v (verbose).
Add CONFIG_DESKTOP, almost all bloat from this change
is hidden under that.
Diffstat (limited to 'archival/libunarchive/decompress_unlzma.c')
-rw-r--r-- | archival/libunarchive/decompress_unlzma.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/archival/libunarchive/decompress_unlzma.c b/archival/libunarchive/decompress_unlzma.c index 0fb1249cb..a6902807b 100644 --- a/archival/libunarchive/decompress_unlzma.c +++ b/archival/libunarchive/decompress_unlzma.c @@ -211,9 +211,10 @@ typedef struct { #define LZMA_REP_LEN_CODER (LZMA_LEN_CODER + LZMA_NUM_LEN_PROBS) #define LZMA_LITERAL (LZMA_REP_LEN_CODER + LZMA_NUM_LEN_PROBS) - -int unlzma(int src_fd, int dst_fd) +USE_DESKTOP(long long) int +unlzma(int src_fd, int dst_fd) { + USE_DESKTOP(long long total_written = 0;) lzma_header_t header; int lc, pb, lp; uint32_t pos_state_mask; @@ -305,7 +306,9 @@ int unlzma(int src_fd, int dst_fd) if (buffer_pos == header.dict_size) { buffer_pos = 0; global_pos += header.dict_size; + // FIXME: error check write(dst_fd, buffer, header.dict_size); + USE_DESKTOP(total_written += header.dict_size;) } if (state < 4) state = 0; @@ -345,7 +348,9 @@ int unlzma(int src_fd, int dst_fd) if (buffer_pos == header.dict_size) { buffer_pos = 0; global_pos += header.dict_size; + // FIXME: error check write(dst_fd, buffer, header.dict_size); + USE_DESKTOP(total_written += header.dict_size;) } continue; } else { @@ -456,15 +461,18 @@ int unlzma(int src_fd, int dst_fd) if (buffer_pos == header.dict_size) { buffer_pos = 0; global_pos += header.dict_size; + // FIXME: error check write(dst_fd, buffer, header.dict_size); + USE_DESKTOP(total_written += header.dict_size;) } len--; } while (len != 0 && buffer_pos < header.dst_size); } } + // FIXME: error check write(dst_fd, buffer, buffer_pos); + USE_DESKTOP(total_written += buffer_pos;) rc_free(&rc); - return 0; + return USE_DESKTOP(total_written) + 0; } - |