aboutsummaryrefslogtreecommitdiff
path: root/archival/libarchive
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2014-12-07 00:42:49 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2014-12-07 00:42:49 +0100
commite7800f351ad9eca012fe27a1c9234692a04419e7 (patch)
tree4b40f6fb63492c8325bb7b58c5812f0258adbb7b /archival/libarchive
parent476654cdbeb2923fc5d2485701587b42579e1635 (diff)
downloadbusybox-w32-e7800f351ad9eca012fe27a1c9234692a04419e7.tar.gz
busybox-w32-e7800f351ad9eca012fe27a1c9234692a04419e7.tar.bz2
busybox-w32-e7800f351ad9eca012fe27a1c9234692a04419e7.zip
Rename transformer_aux_data_t -> transformer_state_t
No code changes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/libarchive')
-rw-r--r--archival/libarchive/decompress_bunzip2.c4
-rw-r--r--archival/libarchive/decompress_gunzip.c26
-rw-r--r--archival/libarchive/decompress_uncompress.c4
-rw-r--r--archival/libarchive/decompress_unlzma.c2
-rw-r--r--archival/libarchive/decompress_unxz.c4
-rw-r--r--archival/libarchive/open_transformer.c22
6 files changed, 31 insertions, 31 deletions
diff --git a/archival/libarchive/decompress_bunzip2.c b/archival/libarchive/decompress_bunzip2.c
index 6396fe40d..36237e221 100644
--- a/archival/libarchive/decompress_bunzip2.c
+++ b/archival/libarchive/decompress_bunzip2.c
@@ -731,7 +731,7 @@ void FAST_FUNC dealloc_bunzip(bunzip_data *bd)
731 731
732/* Decompress src_fd to dst_fd. Stops at end of bzip data, not end of file. */ 732/* Decompress src_fd to dst_fd. Stops at end of bzip data, not end of file. */
733IF_DESKTOP(long long) int FAST_FUNC 733IF_DESKTOP(long long) int FAST_FUNC
734unpack_bz2_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd) 734unpack_bz2_stream(transformer_state_t *xstate, int src_fd, int dst_fd)
735{ 735{
736 IF_DESKTOP(long long total_written = 0;) 736 IF_DESKTOP(long long total_written = 0;)
737 bunzip_data *bd; 737 bunzip_data *bd;
@@ -739,7 +739,7 @@ unpack_bz2_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd)
739 int i; 739 int i;
740 unsigned len; 740 unsigned len;
741 741
742 if (check_signature16(aux, src_fd, BZIP2_MAGIC)) 742 if (check_signature16(xstate, src_fd, BZIP2_MAGIC))
743 return -1; 743 return -1;
744 744
745 outbuf = xmalloc(IOBUF_SIZE); 745 outbuf = xmalloc(IOBUF_SIZE);
diff --git a/archival/libarchive/decompress_gunzip.c b/archival/libarchive/decompress_gunzip.c
index 7c6f38ec3..62a3d78b6 100644
--- a/archival/libarchive/decompress_gunzip.c
+++ b/archival/libarchive/decompress_gunzip.c
@@ -1034,22 +1034,22 @@ inflate_unzip_internal(STATE_PARAM int in, int out)
1034/* For unzip */ 1034/* For unzip */
1035 1035
1036IF_DESKTOP(long long) int FAST_FUNC 1036IF_DESKTOP(long long) int FAST_FUNC
1037inflate_unzip(transformer_aux_data_t *aux, int in, int out) 1037inflate_unzip(transformer_state_t *xstate, int in, int out)
1038{ 1038{
1039 IF_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;
1043 1043
1044 to_read = aux->bytes_in; 1044 to_read = xstate->bytes_in;
1045// bytebuffer_max = 0x8000; 1045// bytebuffer_max = 0x8000;
1046 bytebuffer_offset = 4; 1046 bytebuffer_offset = 4;
1047 bytebuffer = xmalloc(bytebuffer_max); 1047 bytebuffer = xmalloc(bytebuffer_max);
1048 n = inflate_unzip_internal(PASS_STATE in, out); 1048 n = inflate_unzip_internal(PASS_STATE in, out);
1049 free(bytebuffer); 1049 free(bytebuffer);
1050 1050
1051 aux->crc32 = gunzip_crc; 1051 xstate->crc32 = gunzip_crc;
1052 aux->bytes_out = gunzip_bytes_out; 1052 xstate->bytes_out = gunzip_bytes_out;
1053 DEALLOC_STATE; 1053 DEALLOC_STATE;
1054 return n; 1054 return n;
1055} 1055}
@@ -1107,7 +1107,7 @@ static uint32_t buffer_read_le_u32(STATE_PARAM_ONLY)
1107 return res; 1107 return res;
1108} 1108}
1109 1109
1110static int check_header_gzip(STATE_PARAM transformer_aux_data_t *aux) 1110static int check_header_gzip(STATE_PARAM transformer_state_t *xstate)
1111{ 1111{
1112 union { 1112 union {
1113 unsigned char raw[8]; 1113 unsigned char raw[8];
@@ -1169,8 +1169,8 @@ static int check_header_gzip(STATE_PARAM transformer_aux_data_t *aux)
1169 } 1169 }
1170 } 1170 }
1171 1171
1172 if (aux) 1172 if (xstate)
1173 aux->mtime = SWAP_LE32(header.formatted.mtime); 1173 xstate->mtime = SWAP_LE32(header.formatted.mtime);
1174 1174
1175 /* Read the header checksum */ 1175 /* Read the header checksum */
1176 if (header.formatted.flags & 0x02) { 1176 if (header.formatted.flags & 0x02) {
@@ -1182,17 +1182,17 @@ static int check_header_gzip(STATE_PARAM transformer_aux_data_t *aux)
1182} 1182}
1183 1183
1184IF_DESKTOP(long long) int FAST_FUNC 1184IF_DESKTOP(long long) int FAST_FUNC
1185unpack_gz_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd) 1185unpack_gz_stream(transformer_state_t *xstate, int src_fd, int dst_fd)
1186{ 1186{
1187 uint32_t v32; 1187 uint32_t v32;
1188 IF_DESKTOP(long long) int total, n; 1188 IF_DESKTOP(long long) int total, n;
1189 DECLARE_STATE; 1189 DECLARE_STATE;
1190 1190
1191#if !ENABLE_FEATURE_SEAMLESS_Z 1191#if !ENABLE_FEATURE_SEAMLESS_Z
1192 if (check_signature16(aux, src_fd, GZIP_MAGIC)) 1192 if (check_signature16(xstate, src_fd, GZIP_MAGIC))
1193 return -1; 1193 return -1;
1194#else 1194#else
1195 if (aux && aux->check_signature) { 1195 if (xstate && xstate->check_signature) {
1196 uint16_t magic2; 1196 uint16_t magic2;
1197 1197
1198 if (full_read(src_fd, &magic2, 2) != 2) { 1198 if (full_read(src_fd, &magic2, 2) != 2) {
@@ -1201,8 +1201,8 @@ unpack_gz_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd)
1201 return -1; 1201 return -1;
1202 } 1202 }
1203 if (magic2 == COMPRESS_MAGIC) { 1203 if (magic2 == COMPRESS_MAGIC) {
1204 aux->check_signature = 0; 1204 xstate->check_signature = 0;
1205 return unpack_Z_stream(aux, src_fd, dst_fd); 1205 return unpack_Z_stream(xstate, src_fd, dst_fd);
1206 } 1206 }
1207 if (magic2 != GZIP_MAGIC) 1207 if (magic2 != GZIP_MAGIC)
1208 goto bad_magic; 1208 goto bad_magic;
@@ -1218,7 +1218,7 @@ unpack_gz_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd)
1218 gunzip_src_fd = src_fd; 1218 gunzip_src_fd = src_fd;
1219 1219
1220 again: 1220 again:
1221 if (!check_header_gzip(PASS_STATE aux)) { 1221 if (!check_header_gzip(PASS_STATE xstate)) {
1222 bb_error_msg("corrupted data"); 1222 bb_error_msg("corrupted data");
1223 total = -1; 1223 total = -1;
1224 goto ret; 1224 goto ret;
diff --git a/archival/libarchive/decompress_uncompress.c b/archival/libarchive/decompress_uncompress.c
index 53c27080f..cb3d55a88 100644
--- a/archival/libarchive/decompress_uncompress.c
+++ b/archival/libarchive/decompress_uncompress.c
@@ -73,7 +73,7 @@
73 */ 73 */
74 74
75IF_DESKTOP(long long) int FAST_FUNC 75IF_DESKTOP(long long) int FAST_FUNC
76unpack_Z_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd) 76unpack_Z_stream(transformer_state_t *xstate, int src_fd, int dst_fd)
77{ 77{
78 IF_DESKTOP(long long total_written = 0;) 78 IF_DESKTOP(long long total_written = 0;)
79 IF_DESKTOP(long long) int retval = -1; 79 IF_DESKTOP(long long) int retval = -1;
@@ -102,7 +102,7 @@ unpack_Z_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd)
102 /* block compress mode -C compatible with 2.0 */ 102 /* block compress mode -C compatible with 2.0 */
103 int block_mode; /* = BLOCK_MODE; */ 103 int block_mode; /* = BLOCK_MODE; */
104 104
105 if (check_signature16(aux, src_fd, COMPRESS_MAGIC)) 105 if (check_signature16(xstate, src_fd, COMPRESS_MAGIC))
106 return -1; 106 return -1;
107 107
108 inbuf = xzalloc(IBUFSIZ + 64); 108 inbuf = xzalloc(IBUFSIZ + 64);
diff --git a/archival/libarchive/decompress_unlzma.c b/archival/libarchive/decompress_unlzma.c
index 3d99e1388..ccedac49d 100644
--- a/archival/libarchive/decompress_unlzma.c
+++ b/archival/libarchive/decompress_unlzma.c
@@ -206,7 +206,7 @@ enum {
206 206
207 207
208IF_DESKTOP(long long) int FAST_FUNC 208IF_DESKTOP(long long) int FAST_FUNC
209unpack_lzma_stream(transformer_aux_data_t *aux UNUSED_PARAM, int src_fd, int dst_fd) 209unpack_lzma_stream(transformer_state_t *xstate UNUSED_PARAM, int src_fd, int dst_fd)
210{ 210{
211 IF_DESKTOP(long long total_written = 0;) 211 IF_DESKTOP(long long total_written = 0;)
212 lzma_header_t header; 212 lzma_header_t header;
diff --git a/archival/libarchive/decompress_unxz.c b/archival/libarchive/decompress_unxz.c
index 986b7b191..6df54e131 100644
--- a/archival/libarchive/decompress_unxz.c
+++ b/archival/libarchive/decompress_unxz.c
@@ -38,7 +38,7 @@ static uint32_t xz_crc32(const uint8_t *buf, size_t size, uint32_t crc)
38#include "unxz/xz_dec_stream.c" 38#include "unxz/xz_dec_stream.c"
39 39
40IF_DESKTOP(long long) int FAST_FUNC 40IF_DESKTOP(long long) int FAST_FUNC
41unpack_xz_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd) 41unpack_xz_stream(transformer_state_t *xstate, int src_fd, int dst_fd)
42{ 42{
43 enum xz_ret xz_result; 43 enum xz_ret xz_result;
44 struct xz_buf iobuf; 44 struct xz_buf iobuf;
@@ -55,7 +55,7 @@ unpack_xz_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd)
55 iobuf.out = membuf + BUFSIZ; 55 iobuf.out = membuf + BUFSIZ;
56 iobuf.out_size = BUFSIZ; 56 iobuf.out_size = BUFSIZ;
57 57
58 if (!aux || aux->check_signature == 0) { 58 if (!xstate || xstate->check_signature == 0) {
59 /* Preload XZ file signature */ 59 /* Preload XZ file signature */
60 strcpy((char*)membuf, HEADER_MAGIC); 60 strcpy((char*)membuf, HEADER_MAGIC);
61 iobuf.in_size = HEADER_MAGIC_SIZE; 61 iobuf.in_size = HEADER_MAGIC_SIZE;
diff --git a/archival/libarchive/open_transformer.c b/archival/libarchive/open_transformer.c
index 198663041..584b15de4 100644
--- a/archival/libarchive/open_transformer.c
+++ b/archival/libarchive/open_transformer.c
@@ -6,19 +6,19 @@
6#include "libbb.h" 6#include "libbb.h"
7#include "bb_archive.h" 7#include "bb_archive.h"
8 8
9void FAST_FUNC init_transformer_aux_data(transformer_aux_data_t *aux) 9void FAST_FUNC init_transformer_state(transformer_state_t *xstate)
10{ 10{
11 memset(aux, 0, sizeof(*aux)); 11 memset(xstate, 0, sizeof(*xstate));
12} 12}
13 13
14int FAST_FUNC check_signature16(transformer_aux_data_t *aux, int src_fd, unsigned magic16) 14int FAST_FUNC check_signature16(transformer_state_t *xstate, int src_fd, unsigned magic16)
15{ 15{
16 if (aux && aux->check_signature) { 16 if (xstate && xstate->check_signature) {
17 uint16_t magic2; 17 uint16_t magic2;
18 if (full_read(src_fd, &magic2, 2) != 2 || magic2 != magic16) { 18 if (full_read(src_fd, &magic2, 2) != 2 || magic2 != magic16) {
19 bb_error_msg("invalid magic"); 19 bb_error_msg("invalid magic");
20#if 0 /* possible future extension */ 20#if 0 /* possible future extension */
21 if (aux->check_signature > 1) 21 if (xstate->check_signature > 1)
22 xfunc_die(); 22 xfunc_die();
23#endif 23#endif
24 return -1; 24 return -1;
@@ -62,7 +62,7 @@ void check_errors_in_children(int signo)
62#if BB_MMU 62#if BB_MMU
63void FAST_FUNC open_transformer(int fd, 63void FAST_FUNC open_transformer(int fd,
64 int check_signature, 64 int check_signature,
65 IF_DESKTOP(long long) int FAST_FUNC (*transformer)(transformer_aux_data_t *aux, int src_fd, int dst_fd) 65 IF_DESKTOP(long long) int FAST_FUNC (*transformer)(transformer_state_t *xstate, int src_fd, int dst_fd)
66) 66)
67#else 67#else
68void FAST_FUNC open_transformer(int fd, const char *transform_prog) 68void FAST_FUNC open_transformer(int fd, const char *transform_prog)
@@ -80,10 +80,10 @@ void FAST_FUNC open_transformer(int fd, const char *transform_prog)
80#if BB_MMU 80#if BB_MMU
81 { 81 {
82 IF_DESKTOP(long long) int r; 82 IF_DESKTOP(long long) int r;
83 transformer_aux_data_t aux; 83 transformer_state_t xstate;
84 init_transformer_aux_data(&aux); 84 init_transformer_state(&xstate);
85 aux.check_signature = check_signature; 85 xstate.check_signature = check_signature;
86 r = transformer(&aux, fd, fd_pipe.wr); 86 r = transformer(&xstate, fd, fd_pipe.wr);
87 if (ENABLE_FEATURE_CLEAN_UP) { 87 if (ENABLE_FEATURE_CLEAN_UP) {
88 close(fd_pipe.wr); /* send EOF */ 88 close(fd_pipe.wr); /* send EOF */
89 close(fd); 89 close(fd);
@@ -126,7 +126,7 @@ int FAST_FUNC setup_unzip_on_fd(int fd, int fail_if_not_compressed)
126 uint32_t b32[1]; 126 uint32_t b32[1];
127 } magic; 127 } magic;
128 int offset = -2; 128 int offset = -2;
129 USE_FOR_MMU(IF_DESKTOP(long long) int FAST_FUNC (*xformer)(transformer_aux_data_t *aux, int src_fd, int dst_fd);) 129 USE_FOR_MMU(IF_DESKTOP(long long) int FAST_FUNC (*xformer)(transformer_state_t *xstate, int src_fd, int dst_fd);)
130 USE_FOR_NOMMU(const char *xformer_prog;) 130 USE_FOR_NOMMU(const char *xformer_prog;)
131 131
132 /* .gz and .bz2 both have 2-byte signature, and their 132 /* .gz and .bz2 both have 2-byte signature, and their