Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/archival/lzop.c


Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (10 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/archival/lzop.c

    r2725 r3232  
    1515   This program is distributed in the hope that it will be useful,
    1616   but WITHOUT ANY WARRANTY; without even the implied warranty of
    17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     17   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1818   GNU General Public License for more details.
    1919
     
    2626*/
    2727
     28//usage:#define lzop_trivial_usage
     29//usage:       "[-cfvd123456789CF] [FILE]..."
     30//usage:#define lzop_full_usage "\n\n"
     31//usage:       "    -1..9   Compression level"
     32//usage:     "\n    -d  Decompress"
     33//usage:     "\n    -c  Write to stdout"
     34//usage:     "\n    -f  Force"
     35//usage:     "\n    -v  Verbose"
     36//usage:     "\n    -F  Don't store or verify checksum"
     37//usage:     "\n    -C  Also write checksum of compressed block"
     38//usage:
     39//usage:#define lzopcat_trivial_usage
     40//usage:       "[-vCF] [FILE]..."
     41//usage:#define lzopcat_full_usage "\n\n"
     42//usage:       "    -v  Verbose"
     43//usage:     "\n    -F  Don't store or verify checksum"
     44//usage:
     45//usage:#define unlzop_trivial_usage
     46//usage:       "[-cfvCF] [FILE]..."
     47//usage:#define unlzop_full_usage "\n\n"
     48//usage:       "    -c  Write to stdout"
     49//usage:     "\n    -f  Force"
     50//usage:     "\n    -v  Verbose"
     51//usage:     "\n    -F  Don't store or verify checksum"
     52
    2853#include "libbb.h"
    29 #include "archive.h"
     54#include "bb_archive.h"
    3055#include "liblzo_interface.h"
    3156
     
    92117    unsigned long o_m1_a = 0, o_m1_b = 0, o_m2 = 0, o_m3_a = 0, o_m3_b = 0;
    93118
    94 //    LZO_UNUSED(wrkmem);
     119//  LZO_UNUSED(wrkmem);
    95120
    96121    *out_len = 0;
     
    177202                    *litp &= ~3;
    178203                    /* copy over the 2 literals that replace the match */
    179                     copy2(ip-3+1,m_pos,pd(op,m_pos));
     204                    copy2(ip-3+1, m_pos, pd(op, m_pos));
    180205                    /* move literals 1 byte ahead */
    181206                    litp += 2;
     
    187212
    188213                    o_m1_b++;
    189                     *op++ = *m_pos++; *op++ = *m_pos++;
     214                    *op++ = *m_pos++;
     215                    *op++ = *m_pos++;
    190216                    goto copy_literal_run;
    191217                }
     
    216242                        t = *ip++;
    217243                        /* copy over the 3 literals that replace the match */
    218                         copy3(ip-1-2,m_pos,pd(op,m_pos));
     244                        copy3(ip-1-2, m_pos, pd(op, m_pos));
    219245                        /* set new length of previous literal run */
    220246                        lit += 3 + t + 3;
     
    265291                        *litp = (unsigned char)((*litp & ~3) | lit);
    266292                        /* copy over the 3 literals that replace the match */
    267                         copy3(ip-3,m_pos,pd(op,m_pos));
     293                        copy3(ip-3, m_pos, pd(op, m_pos));
    268294                        o_m3_a++;
    269295                    }
     
    276302                        *litp &= ~3;
    277303                        /* copy over the 3 literals that replace the match */
    278                         copy3(ip-4+1,m_pos,pd(op,m_pos));
     304                        copy3(ip-4+1, m_pos, pd(op, m_pos));
    279305                        /* move literals 1 byte ahead */
    280306                        litp += 2;
     
    321347
    322348 eof_found:
    323 //    LZO_UNUSED(o_m1_a); LZO_UNUSED(o_m1_b); LZO_UNUSED(o_m2);
    324 //    LZO_UNUSED(o_m3_a); LZO_UNUSED(o_m3_b);
     349//  LZO_UNUSED(o_m1_a); LZO_UNUSED(o_m1_b); LZO_UNUSED(o_m2);
     350//  LZO_UNUSED(o_m3_a); LZO_UNUSED(o_m3_b);
    325351    *out_len = pd(op, out);
    326352    return (ip == ip_end ? LZO_E_OK :
    327            (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN));
     353        (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN));
    328354}
    329355
     
    402428//#define G (*ptr_to_globals)
    403429//#define INIT_G() do {
    404 //        SET_PTR_TO_GLOBALS(xzalloc(sizeof(G)));
     430//  SET_PTR_TO_GLOBALS(xzalloc(sizeof(G)));
    405431//} while (0)
    406432
     
    10521078}
    10531079
    1054 static IF_DESKTOP(long long) int FAST_FUNC pack_lzop(unpack_info_t *info UNUSED_PARAM)
     1080static IF_DESKTOP(long long) int FAST_FUNC pack_lzop(transformer_aux_data_t *aux UNUSED_PARAM)
    10551081{
    10561082    if (option_mask32 & OPT_DECOMPRESS)
Note: See TracChangeset for help on using the changeset viewer.