1 /* 2 3 Copyright (c) 2011, 2012, 2013, Simon Howard 4 5 Permission to use, copy, modify, and/or distribute this software 6 for any purpose with or without fee is hereby granted, provided 7 that the above copyright notice and this permission notice appear 8 in all copies. 9 10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 11 WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 12 WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 13 AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR 14 CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 15 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 16 NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 17 CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 19 */ 20 21 // 22 // Decoder for the -lhx- algorithm. Provided by Multi. 23 // 24 // -lhx- is Unlha32.dll's original extension. Some unique archivers 25 // support it. 26 // 27 28 // 128 KiB history ring buffer: 29 // -lhx-'s maximum dictionary size is 2^19. 2x ring buffer is required. 30 31 #define HISTORY_BITS 20 /* 2^20 = 1048576. */ 32 33 // Number of bits to encode HISTORY_BITS: 34 35 #define OFFSET_BITS 5 36 37 // Name of the variable for the encoder: 38 39 #define DECODER_NAME lha_lhx_decoder 40 41 // The actual algorithm code is contained in lh_new_decoder.c, which 42 // acts as a template for -lh4-, -lh5-, -lh6-, -lh7- and -lhx-. 43 44 #include "lh_new_decoder.c" 45 46