diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-05-06 14:19:19 +0000 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-05-06 14:19:19 +0000 |
commit | 27653adc8b7ebe44bd357511de53d0c14eef0894 (patch) | |
tree | d1c9b0facbcca408a18d75f93aa507e96927ef31 /include | |
parent | b8ba6b66f5d730efcf13dbbb3f9362dd6840d93b (diff) | |
download | busybox-w32-27653adc8b7ebe44bd357511de53d0c14eef0894.tar.gz busybox-w32-27653adc8b7ebe44bd357511de53d0c14eef0894.tar.bz2 busybox-w32-27653adc8b7ebe44bd357511de53d0c14eef0894.zip |
rpm: code shrink. Now uses open_zipped's logic (factored out into setup_unzip_on_fd())
function old new delta
setup_unzip_on_fd - 80 +80
open_zipped 176 113 -63
rpm_main 1672 1355 -317
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/2 up/down: 80/-380) Total: -300 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h index 976120e72..2f67c7f72 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -651,6 +651,15 @@ extern char *xmalloc_reads(int fd, char *pfx, size_t *maxsz_p) FAST_FUNC; | |||
651 | extern void *xmalloc_read(int fd, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC; | 651 | extern void *xmalloc_read(int fd, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC; |
652 | /* Returns NULL if file can't be opened (default max size: INT_MAX - 4095) */ | 652 | /* Returns NULL if file can't be opened (default max size: INT_MAX - 4095) */ |
653 | extern void *xmalloc_open_read_close(const char *filename, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC; | 653 | extern void *xmalloc_open_read_close(const char *filename, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC; |
654 | /* Autodetects gzip/bzip2 formats. fd may be in the middle of the file! */ | ||
655 | #if ENABLE_FEATURE_SEAMLESS_LZMA \ | ||
656 | || ENABLE_FEATURE_SEAMLESS_BZ2 \ | ||
657 | || ENABLE_FEATURE_SEAMLESS_GZ \ | ||
658 | /* || ENABLE_FEATURE_SEAMLESS_Z */ | ||
659 | extern int setup_unzip_on_fd(int fd /*, int fail_if_not_detected*/) FAST_FUNC; | ||
660 | #else | ||
661 | # define setup_unzip_on_fd(...) ((void)0) | ||
662 | #endif | ||
654 | /* Autodetects .gz etc */ | 663 | /* Autodetects .gz etc */ |
655 | extern int open_zipped(const char *fname) FAST_FUNC; | 664 | extern int open_zipped(const char *fname) FAST_FUNC; |
656 | extern void *xmalloc_open_zipped_read_close(const char *fname, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC; | 665 | extern void *xmalloc_open_zipped_read_close(const char *fname, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC; |