#include <string.h>
/* Huffman decoding tables and maps from symbols to code lengths. */
struct lzx_tables {
u16 maintree_decode_table[(1 << LZX_MAINTREE_TABLEBITS) +
#include <string.h>
/* Huffman decoding tables and maps from symbols to code lengths. */
struct lzx_tables {
u16 maintree_decode_table[(1 << LZX_MAINTREE_TABLEBITS) +
u8 lentree_lens[LZX_LENTREE_NUM_SYMBOLS];
u16 alignedtree_decode_table[(1 << LZX_ALIGNEDTREE_TABLEBITS) +
u8 lentree_lens[LZX_LENTREE_NUM_SYMBOLS];
u16 alignedtree_decode_table[(1 << LZX_ALIGNEDTREE_TABLEBITS) +
ret = bitstream_read_bits(istream,
LZX_ALIGNEDTREE_ELEMENT_SIZE,
&len);
ret = bitstream_read_bits(istream,
LZX_ALIGNEDTREE_ELEMENT_SIZE,
&len);
LZX_ALIGNEDTREE_TABLEBITS,
tables->alignedtree_lens,
8);
LZX_ALIGNEDTREE_TABLEBITS,
tables->alignedtree_lens,
8);
ret = lzx_read_code_lens(istream,
tables->maintree_lens + LZX_NUM_CHARS,
LZX_MAINTREE_NUM_SYMBOLS - LZX_NUM_CHARS);
ret = lzx_read_code_lens(istream,
tables->maintree_lens + LZX_NUM_CHARS,
LZX_MAINTREE_NUM_SYMBOLS - LZX_NUM_CHARS);
LZX_DEBUG("Reading path lengths for the length tree.");
ret = lzx_read_code_lens(istream, tables->lentree_lens,
LZX_LENTREE_NUM_SYMBOLS);
LZX_DEBUG("Reading path lengths for the length tree.");
ret = lzx_read_code_lens(istream, tables->lentree_lens,
LZX_LENTREE_NUM_SYMBOLS);
* *already* aligned, the correct thing to do is to throw away
* the next 16 bits. */
if (istream->bitsleft == 0) {
* *already* aligned, the correct thing to do is to throw away
* the next 16 bits. */
if (istream->bitsleft == 0) {
abs_offset = le32_to_cpu(*call_insn_target);
if (abs_offset >= -input_pos && abs_offset < file_size) {
abs_offset = le32_to_cpu(*call_insn_target);
if (abs_offset >= -input_pos && abs_offset < file_size) {
while (window_pos < end) {
ret = read_huffsym_using_maintree(istream, tables,
&main_element);
while (window_pos < end) {
ret = read_huffsym_using_maintree(istream, tables,
&main_element);
LZX_DEBUG("Reading block header.");
ret = lzx_read_block_header(&istream, &block_size,
&block_type, &tables, &queue);
LZX_DEBUG("Reading block header.");
ret = lzx_read_block_header(&istream, &block_size,
&block_type, &tables, &queue);