libarchive: add a function to unpack embedded data
authorRon Yorston <rmy@pobox.com>
Fri, 2 Nov 2018 13:14:31 +0000 (14:14 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Fri, 2 Nov 2018 13:14:51 +0000 (14:14 +0100)
commitc339c7f7b393fbcd51b0f96df837baa1edad7fd8
tree3fa49732a3426e0666ba732da7e4182db7dc66ca
parent0df289f427da6279e3ca198d14e90015c079af44
libarchive: add a function to unpack embedded data

Similar code to unpack embedded data is used to decompress usage
messages, embedded scripts and the config file (in the non-default
bbconfig applet).

Moving this code to a common function reduces the size of the default
build and hides more of the internals of libarchive.

function                                             old     new   delta
unpack_bz2_data                                        -     135    +135
bb_show_usage                                        137     157     +20
get_script_content                                    32      47     +15
unpack_scripts                                       119       -    -119
unpack_usage_messages                                124       -    -124
------------------------------------------------------------------------------
(add/remove: 1/2 grow/shrink: 2/0 up/down: 170/-243)          Total: -73 bytes

Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
archival/libarchive/decompress_bunzip2.c
include/bb_archive.h
libbb/appletlib.c
miscutils/bbconfig.c