aboutsummaryrefslogtreecommitdiff
path: root/archival/libunarchive
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2009-04-21 11:09:40 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2009-04-21 11:09:40 +0000
commit5e34ff29bcc870936ab18172f438a34d042d4e03 (patch)
treea5e7a528f2f916eb883f1161eadceacdf2dca4be /archival/libunarchive
parent8b814b4a349e2262c0ad25793b05206a14651ebb (diff)
downloadbusybox-w32-5e34ff29bcc870936ab18172f438a34d042d4e03.tar.gz
busybox-w32-5e34ff29bcc870936ab18172f438a34d042d4e03.tar.bz2
busybox-w32-5e34ff29bcc870936ab18172f438a34d042d4e03.zip
*: mass renaming of USE_XXXX to IF_XXXX
and SKIP_XXXX to IF_NOT_XXXX - the second one was especially badly named. It was not skipping anything!
Diffstat (limited to 'archival/libunarchive')
-rw-r--r--archival/libunarchive/decompress_bunzip2.c10
-rw-r--r--archival/libunarchive/decompress_uncompress.c12
-rw-r--r--archival/libunarchive/decompress_unlzma.c16
-rw-r--r--archival/libunarchive/decompress_unzip.c16
-rw-r--r--archival/libunarchive/get_header_tar.c12
-rw-r--r--archival/libunarchive/open_transformer.c2
6 files changed, 34 insertions, 34 deletions
diff --git a/archival/libunarchive/decompress_bunzip2.c b/archival/libunarchive/decompress_bunzip2.c
index b53720f23..cd8df086e 100644
--- a/archival/libunarchive/decompress_bunzip2.c
+++ b/archival/libunarchive/decompress_bunzip2.c
@@ -648,10 +648,10 @@ void FAST_FUNC dealloc_bunzip(bunzip_data *bd)
648 648
649 649
650/* Decompress src_fd to dst_fd. Stops at end of bzip data, not end of file. */ 650/* Decompress src_fd to dst_fd. Stops at end of bzip data, not end of file. */
651USE_DESKTOP(long long) int FAST_FUNC 651IF_DESKTOP(long long) int FAST_FUNC
652unpack_bz2_stream(int src_fd, int dst_fd) 652unpack_bz2_stream(int src_fd, int dst_fd)
653{ 653{
654 USE_DESKTOP(long long total_written = 0;) 654 IF_DESKTOP(long long total_written = 0;)
655 char *outbuf; 655 char *outbuf;
656 bunzip_data *bd; 656 bunzip_data *bd;
657 int i; 657 int i;
@@ -666,7 +666,7 @@ unpack_bz2_stream(int src_fd, int dst_fd)
666 i = RETVAL_SHORT_WRITE; 666 i = RETVAL_SHORT_WRITE;
667 break; 667 break;
668 } 668 }
669 USE_DESKTOP(total_written += i;) 669 IF_DESKTOP(total_written += i;)
670 } 670 }
671 } 671 }
672 672
@@ -686,10 +686,10 @@ unpack_bz2_stream(int src_fd, int dst_fd)
686 dealloc_bunzip(bd); 686 dealloc_bunzip(bd);
687 free(outbuf); 687 free(outbuf);
688 688
689 return i ? i : USE_DESKTOP(total_written) + 0; 689 return i ? i : IF_DESKTOP(total_written) + 0;
690} 690}
691 691
692USE_DESKTOP(long long) int FAST_FUNC 692IF_DESKTOP(long long) int FAST_FUNC
693unpack_bz2_stream_prime(int src_fd, int dst_fd) 693unpack_bz2_stream_prime(int src_fd, int dst_fd)
694{ 694{
695 unsigned char magic[2]; 695 unsigned char magic[2];
diff --git a/archival/libunarchive/decompress_uncompress.c b/archival/libunarchive/decompress_uncompress.c
index fe1491e71..2877c8981 100644
--- a/archival/libunarchive/decompress_uncompress.c
+++ b/archival/libunarchive/decompress_uncompress.c
@@ -72,11 +72,11 @@
72 * be stored in the compressed file. 72 * be stored in the compressed file.
73 */ 73 */
74 74
75USE_DESKTOP(long long) int FAST_FUNC 75IF_DESKTOP(long long) int FAST_FUNC
76unpack_Z_stream(int fd_in, int fd_out) 76unpack_Z_stream(int fd_in, int fd_out)
77{ 77{
78 USE_DESKTOP(long long total_written = 0;) 78 IF_DESKTOP(long long total_written = 0;)
79 USE_DESKTOP(long long) int retval = -1; 79 IF_DESKTOP(long long) int retval = -1;
80 unsigned char *stackp; 80 unsigned char *stackp;
81 long code; 81 long code;
82 int finchar; 82 int finchar;
@@ -265,7 +265,7 @@ unpack_Z_stream(int fd_in, int fd_out)
265 if (outpos >= OBUFSIZ) { 265 if (outpos >= OBUFSIZ) {
266 full_write(fd_out, outbuf, outpos); 266 full_write(fd_out, outbuf, outpos);
267//error check?? 267//error check??
268 USE_DESKTOP(total_written += outpos;) 268 IF_DESKTOP(total_written += outpos;)
269 outpos = 0; 269 outpos = 0;
270 } 270 }
271 stackp += i; 271 stackp += i;
@@ -294,10 +294,10 @@ unpack_Z_stream(int fd_in, int fd_out)
294 if (outpos > 0) { 294 if (outpos > 0) {
295 full_write(fd_out, outbuf, outpos); 295 full_write(fd_out, outbuf, outpos);
296//error check?? 296//error check??
297 USE_DESKTOP(total_written += outpos;) 297 IF_DESKTOP(total_written += outpos;)
298 } 298 }
299 299
300 retval = USE_DESKTOP(total_written) + 0; 300 retval = IF_DESKTOP(total_written) + 0;
301 err: 301 err:
302 free(inbuf); 302 free(inbuf);
303 free(outbuf); 303 free(outbuf);
diff --git a/archival/libunarchive/decompress_unlzma.c b/archival/libunarchive/decompress_unlzma.c
index 2cfcd9b7d..33e5cd65d 100644
--- a/archival/libunarchive/decompress_unlzma.c
+++ b/archival/libunarchive/decompress_unlzma.c
@@ -228,10 +228,10 @@ enum {
228}; 228};
229 229
230 230
231USE_DESKTOP(long long) int FAST_FUNC 231IF_DESKTOP(long long) int FAST_FUNC
232unpack_lzma_stream(int src_fd, int dst_fd) 232unpack_lzma_stream(int src_fd, int dst_fd)
233{ 233{
234 USE_DESKTOP(long long total_written = 0;) 234 IF_DESKTOP(long long total_written = 0;)
235 lzma_header_t header; 235 lzma_header_t header;
236 int lc, pb, lp; 236 int lc, pb, lp;
237 uint32_t pos_state_mask; 237 uint32_t pos_state_mask;
@@ -330,7 +330,7 @@ unpack_lzma_stream(int src_fd, int dst_fd)
330 global_pos += header.dict_size; 330 global_pos += header.dict_size;
331 if (full_write(dst_fd, buffer, header.dict_size) != (ssize_t)header.dict_size) 331 if (full_write(dst_fd, buffer, header.dict_size) != (ssize_t)header.dict_size)
332 goto bad; 332 goto bad;
333 USE_DESKTOP(total_written += header.dict_size;) 333 IF_DESKTOP(total_written += header.dict_size;)
334 } 334 }
335#else 335#else
336 len = 1; 336 len = 1;
@@ -468,20 +468,20 @@ unpack_lzma_stream(int src_fd, int dst_fd)
468 } 468 }
469 469
470 len += LZMA_MATCH_MIN_LEN; 470 len += LZMA_MATCH_MIN_LEN;
471 SKIP_FEATURE_LZMA_FAST(string:) 471 IF_NOT_FEATURE_LZMA_FAST(string:)
472 do { 472 do {
473 pos = buffer_pos - rep0; 473 pos = buffer_pos - rep0;
474 while (pos >= header.dict_size) 474 while (pos >= header.dict_size)
475 pos += header.dict_size; 475 pos += header.dict_size;
476 previous_byte = buffer[pos]; 476 previous_byte = buffer[pos];
477 SKIP_FEATURE_LZMA_FAST(one_byte2:) 477 IF_NOT_FEATURE_LZMA_FAST(one_byte2:)
478 buffer[buffer_pos++] = previous_byte; 478 buffer[buffer_pos++] = previous_byte;
479 if (buffer_pos == header.dict_size) { 479 if (buffer_pos == header.dict_size) {
480 buffer_pos = 0; 480 buffer_pos = 0;
481 global_pos += header.dict_size; 481 global_pos += header.dict_size;
482 if (full_write(dst_fd, buffer, header.dict_size) != (ssize_t)header.dict_size) 482 if (full_write(dst_fd, buffer, header.dict_size) != (ssize_t)header.dict_size)
483 goto bad; 483 goto bad;
484 USE_DESKTOP(total_written += header.dict_size;) 484 IF_DESKTOP(total_written += header.dict_size;)
485 } 485 }
486 len--; 486 len--;
487 } while (len != 0 && buffer_pos < header.dst_size); 487 } while (len != 0 && buffer_pos < header.dst_size);
@@ -489,8 +489,8 @@ unpack_lzma_stream(int src_fd, int dst_fd)
489 } 489 }
490 490
491 { 491 {
492 SKIP_DESKTOP(int total_written = 0; /* success */) 492 IF_NOT_DESKTOP(int total_written = 0; /* success */)
493 USE_DESKTOP(total_written += buffer_pos;) 493 IF_DESKTOP(total_written += buffer_pos;)
494 if (full_write(dst_fd, buffer, buffer_pos) != (ssize_t)buffer_pos) { 494 if (full_write(dst_fd, buffer, buffer_pos) != (ssize_t)buffer_pos) {
495 bad: 495 bad:
496 total_written = -1; /* failure */ 496 total_written = -1; /* failure */
diff --git a/archival/libunarchive/decompress_unzip.c b/archival/libunarchive/decompress_unzip.c
index 86969251e..b090f26eb 100644
--- a/archival/libunarchive/decompress_unzip.c
+++ b/archival/libunarchive/decompress_unzip.c
@@ -970,10 +970,10 @@ static int inflate_get_next_window(STATE_PARAM_ONLY)
970 970
971 971
972/* Called from unpack_gz_stream() and inflate_unzip() */ 972/* Called from unpack_gz_stream() and inflate_unzip() */
973static USE_DESKTOP(long long) int 973static IF_DESKTOP(long long) int
974inflate_unzip_internal(STATE_PARAM int in, int out) 974inflate_unzip_internal(STATE_PARAM int in, int out)
975{ 975{
976 USE_DESKTOP(long long) int n = 0; 976 IF_DESKTOP(long long) int n = 0;
977 ssize_t nwrote; 977 ssize_t nwrote;
978 978
979 /* Allocate all global buffers (for DYN_ALLOC option) */ 979 /* Allocate all global buffers (for DYN_ALLOC option) */
@@ -1008,7 +1008,7 @@ inflate_unzip_internal(STATE_PARAM int in, int out)
1008 n = -1; 1008 n = -1;
1009 goto ret; 1009 goto ret;
1010 } 1010 }
1011 USE_DESKTOP(n += nwrote;) 1011 IF_DESKTOP(n += nwrote;)
1012 if (r == 0) break; 1012 if (r == 0) break;
1013 } 1013 }
1014 1014
@@ -1033,10 +1033,10 @@ inflate_unzip_internal(STATE_PARAM int in, int out)
1033 1033
1034/* For unzip */ 1034/* For unzip */
1035 1035
1036USE_DESKTOP(long long) int FAST_FUNC 1036IF_DESKTOP(long long) int FAST_FUNC
1037inflate_unzip(inflate_unzip_result *res, off_t compr_size, int in, int out) 1037inflate_unzip(inflate_unzip_result *res, off_t compr_size, int in, int out)
1038{ 1038{
1039 USE_DESKTOP(long long) int n; 1039 IF_DESKTOP(long long) int n;
1040 DECLARE_STATE; 1040 DECLARE_STATE;
1041 1041
1042 ALLOC_STATE; 1042 ALLOC_STATE;
@@ -1181,11 +1181,11 @@ static int check_header_gzip(STATE_PARAM unpack_info_t *info)
1181 return 1; 1181 return 1;
1182} 1182}
1183 1183
1184USE_DESKTOP(long long) int FAST_FUNC 1184IF_DESKTOP(long long) int FAST_FUNC
1185unpack_gz_stream_with_info(int in, int out, unpack_info_t *info) 1185unpack_gz_stream_with_info(int in, int out, unpack_info_t *info)
1186{ 1186{
1187 uint32_t v32; 1187 uint32_t v32;
1188 USE_DESKTOP(long long) int n; 1188 IF_DESKTOP(long long) int n;
1189 DECLARE_STATE; 1189 DECLARE_STATE;
1190 1190
1191 n = 0; 1191 n = 0;
@@ -1245,7 +1245,7 @@ unpack_gz_stream_with_info(int in, int out, unpack_info_t *info)
1245 return n; 1245 return n;
1246} 1246}
1247 1247
1248USE_DESKTOP(long long) int FAST_FUNC 1248IF_DESKTOP(long long) int FAST_FUNC
1249unpack_gz_stream(int in, int out) 1249unpack_gz_stream(int in, int out)
1250{ 1250{
1251 return unpack_gz_stream_with_info(in, out, NULL); 1251 return unpack_gz_stream_with_info(in, out, NULL);
diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c
index 443052f7e..16e2de440 100644
--- a/archival/libunarchive/get_header_tar.c
+++ b/archival/libunarchive/get_header_tar.c
@@ -144,8 +144,8 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
144// if (!archive_handle->ah_priv_inited) { 144// if (!archive_handle->ah_priv_inited) {
145// archive_handle->ah_priv_inited = 1; 145// archive_handle->ah_priv_inited = 1;
146// p_end = 0; 146// p_end = 0;
147// USE_FEATURE_TAR_GNU_EXTENSIONS(p_longname = NULL;) 147// IF_FEATURE_TAR_GNU_EXTENSIONS(p_longname = NULL;)
148// USE_FEATURE_TAR_GNU_EXTENSIONS(p_linkname = NULL;) 148// IF_FEATURE_TAR_GNU_EXTENSIONS(p_linkname = NULL;)
149// } 149// }
150 150
151 if (sizeof(tar) != 512) 151 if (sizeof(tar) != 512)
@@ -176,7 +176,7 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
176 bb_error_msg_and_die("short read"); 176 bb_error_msg_and_die("short read");
177 } 177 }
178 if (i != 512) { 178 if (i != 512) {
179 USE_FEATURE_TAR_AUTODETECT(goto autodetect;) 179 IF_FEATURE_TAR_AUTODETECT(goto autodetect;)
180 goto short_read; 180 goto short_read;
181 } 181 }
182 182
@@ -265,14 +265,14 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
265#if ENABLE_FEATURE_TAR_OLDGNU_COMPATIBILITY 265#if ENABLE_FEATURE_TAR_OLDGNU_COMPATIBILITY
266 sum = strtoul(tar.chksum, &cp, 8); 266 sum = strtoul(tar.chksum, &cp, 8);
267 if ((*cp && *cp != ' ') 267 if ((*cp && *cp != ' ')
268 || (sum_u != sum USE_FEATURE_TAR_OLDSUN_COMPATIBILITY(&& sum_s != sum)) 268 || (sum_u != sum IF_FEATURE_TAR_OLDSUN_COMPATIBILITY(&& sum_s != sum))
269 ) { 269 ) {
270 bb_error_msg_and_die("invalid tar header checksum"); 270 bb_error_msg_and_die("invalid tar header checksum");
271 } 271 }
272#else 272#else
273 /* This field does not need special treatment (getOctal) */ 273 /* This field does not need special treatment (getOctal) */
274 sum = xstrtoul(tar.chksum, 8); 274 sum = xstrtoul(tar.chksum, 8);
275 if (sum_u != sum USE_FEATURE_TAR_OLDSUN_COMPATIBILITY(&& sum_s != sum)) { 275 if (sum_u != sum IF_FEATURE_TAR_OLDSUN_COMPATIBILITY(&& sum_s != sum)) {
276 bb_error_msg_and_die("invalid tar header checksum"); 276 bb_error_msg_and_die("invalid tar header checksum");
277 } 277 }
278#endif 278#endif
@@ -356,7 +356,7 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
356 file_header->mode |= S_IFBLK; 356 file_header->mode |= S_IFBLK;
357 goto size0; 357 goto size0;
358 case '5': 358 case '5':
359 USE_FEATURE_TAR_OLDGNU_COMPATIBILITY(set_dir:) 359 IF_FEATURE_TAR_OLDGNU_COMPATIBILITY(set_dir:)
360 file_header->mode |= S_IFDIR; 360 file_header->mode |= S_IFDIR;
361 goto size0; 361 goto size0;
362 case '6': 362 case '6':
diff --git a/archival/libunarchive/open_transformer.c b/archival/libunarchive/open_transformer.c
index 42fdd96a6..fae589ee0 100644
--- a/archival/libunarchive/open_transformer.c
+++ b/archival/libunarchive/open_transformer.c
@@ -12,7 +12,7 @@
12 * in include/unarchive.h. On NOMMU, transformer is removed. 12 * in include/unarchive.h. On NOMMU, transformer is removed.
13 */ 13 */
14void FAST_FUNC open_transformer(int fd, 14void FAST_FUNC open_transformer(int fd,
15 USE_DESKTOP(long long) int FAST_FUNC (*transformer)(int src_fd, int dst_fd), 15 IF_DESKTOP(long long) int FAST_FUNC (*transformer)(int src_fd, int dst_fd),
16 const char *transform_prog) 16 const char *transform_prog)
17{ 17{
18 struct fd_pair fd_pipe; 18 struct fd_pair fd_pipe;