Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/archival/lzop.c
- Timestamp:
- Dec 20, 2016, 4:07:32 PM (7 years ago)
- Location:
- branches/3.3
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mindi-busybox/archival/lzop.c
r3232 r3621 25 25 "Minimalized" for busybox by Alain Knaff 26 26 */ 27 28 //config:config LZOP 29 //config: bool "lzop" 30 //config: default y 31 //config: help 32 //config: Lzop compression/decompresion. 33 //config: 34 //config:config LZOP_COMPR_HIGH 35 //config: bool "lzop compression levels 7,8,9 (not very useful)" 36 //config: default n 37 //config: depends on LZOP 38 //config: help 39 //config: High levels (7,8,9) of lzop compression. These levels 40 //config: are actually slower than gzip at equivalent compression ratios 41 //config: and take up 3.2K of code. 42 43 //applet:IF_LZOP(APPLET(lzop, BB_DIR_BIN, BB_SUID_DROP)) 44 //applet:IF_LZOP(APPLET_ODDNAME(lzopcat, lzop, BB_DIR_USR_BIN, BB_SUID_DROP, lzopcat)) 45 //applet:IF_LZOP(APPLET_ODDNAME(unlzop, lzop, BB_DIR_USR_BIN, BB_SUID_DROP, unlzop)) 46 //kbuild:lib-$(CONFIG_LZOP) += lzop.o 27 47 28 48 //usage:#define lzop_trivial_usage … … 52 72 53 73 #include "libbb.h" 74 #include "common_bufsiz.h" 54 75 #include "bb_archive.h" 55 76 #include "liblzo_interface.h" … … 424 445 chksum_t chksum_out; 425 446 } FIX_ALIASING; 426 #define G (*(struct globals*) &bb_common_bufsiz1)427 #define INIT_G() do { } while (0)447 #define G (*(struct globals*)bb_common_bufsiz1) 448 #define INIT_G() do { setup_common_bufsiz(); } while (0) 428 449 //#define G (*ptr_to_globals) 429 450 //#define INIT_G() do { … … 437 458 //#define LZOP_VERSION_DATE "Apr 27th 2003" 438 459 439 #define OPTION_STRING "cfvdt123456789CF" 440 460 #define OPTION_STRING "cfvqdt123456789CF" 461 462 /* Note: must be kept in sync with archival/bbunzip.c */ 441 463 enum { 442 464 OPT_STDOUT = (1 << 0), 443 465 OPT_FORCE = (1 << 1), 444 466 OPT_VERBOSE = (1 << 2), 445 OPT_DECOMPRESS = (1 << 3), 446 OPT_TEST = (1 << 4), 447 OPT_1 = (1 << 5), 448 OPT_2 = (1 << 6), 449 OPT_3 = (1 << 7), 450 OPT_4 = (1 << 8), 451 OPT_5 = (1 << 9), 452 OPT_6 = (1 << 10), 453 OPT_789 = (7 << 11), 454 OPT_7 = (1 << 11), 455 OPT_8 = (1 << 12), 456 OPT_C = (1 << 14), 457 OPT_F = (1 << 15), 467 OPT_QUIET = (1 << 3), 468 OPT_DECOMPRESS = (1 << 4), 469 OPT_TEST = (1 << 5), 470 OPT_1 = (1 << 6), 471 OPT_2 = (1 << 7), 472 OPT_3 = (1 << 8), 473 OPT_4 = (1 << 9), 474 OPT_5 = (1 << 10), 475 OPT_6 = (1 << 11), 476 OPT_789 = (7 << 12), 477 OPT_7 = (1 << 13), 478 OPT_8 = (1 << 14), 479 OPT_C = (1 << 15), 480 OPT_F = (1 << 16), 458 481 }; 459 482 … … 619 642 // compress a file 620 643 /**********************************************************************/ 621 static NOINLINE smallint lzo_compress(const header_t *h)644 static NOINLINE int lzo_compress(const header_t *h) 622 645 { 623 646 unsigned block_size = LZO_BLOCK_SIZE; … … 629 652 uint32_t d_crc32 = CRC32_INIT_VALUE; 630 653 int l; 631 smallint ok = 1;632 654 uint8_t *wrk_mem = NULL; 633 655 … … 711 733 free(b1); 712 734 free(b2); 713 return ok;735 return 1; 714 736 } 715 737 … … 732 754 // decompress a file 733 755 /**********************************************************************/ 734 static NOINLINE smallint lzo_decompress(const header_t *h)756 static NOINLINE int lzo_decompress(const header_t *h) 735 757 { 736 758 unsigned block_size = LZO_BLOCK_SIZE; … … 740 762 uint32_t d_adler32 = ADLER32_INIT_VALUE; 741 763 uint32_t c_crc32 = CRC32_INIT_VALUE, d_crc32 = CRC32_INIT_VALUE; 742 smallint ok = 1;743 764 uint8_t *b1; 744 765 uint32_t mcs_block_size = MAX_COMPRESSED_SIZE(block_size); … … 844 865 845 866 free(b2); 846 return ok;867 return 1; 847 868 } 848 869 … … 876 897 * The rest is identical. 877 898 */ 878 static const unsigned char lzop_magic[9] = {899 static const unsigned char lzop_magic[9] ALIGN1 = { 879 900 0x89, 0x4c, 0x5a, 0x4f, 0x00, 0x0d, 0x0a, 0x1a, 0x0a 880 901 }; … … 1029 1050 } 1030 1051 1031 static smallint do_lzo_compress(void)1052 static int do_lzo_compress(void) 1032 1053 { 1033 1054 header_t header; … … 1057 1078 // decompress 1058 1079 /**********************************************************************/ 1059 static smallint do_lzo_decompress(void)1080 static int do_lzo_decompress(void) 1060 1081 { 1061 1082 header_t header; … … 1078 1099 } 1079 1100 1080 static IF_DESKTOP(long long) int FAST_FUNC pack_lzop(transformer_ aux_data_t *auxUNUSED_PARAM)1101 static IF_DESKTOP(long long) int FAST_FUNC pack_lzop(transformer_state_t *xstate UNUSED_PARAM) 1081 1102 { 1082 1103 if (option_mask32 & OPT_DECOMPRESS) … … 1094 1115 option_mask32 |= (OPT_STDOUT | OPT_DECOMPRESS); 1095 1116 /* unlzop? */ 1096 if (applet_name[ 0] == 'u')1117 if (applet_name[4] == 'o') 1097 1118 option_mask32 |= OPT_DECOMPRESS; 1098 1119
Note:
See TracChangeset
for help on using the changeset viewer.