libmobi
C library for handling MOBI format ebook documents
|
Go to the source code of this file.
Data Structures | |
struct | MOBIHuffCdic |
Parsed data from HUFF and CDIC records needed to unpack huffman compressed text. More... | |
Macros | |
#define | MOBI_INLINE |
#define | MOBI_HUFFMAN_MAXDEPTH 20 |
#define | HUFF_CODETABLE_SIZE 33 |
Functions | |
MOBI_RET | mobi_decompress_lz77 (unsigned char *out, const unsigned char *in, size_t *len_out, const size_t len_in) |
Decompressor fo PalmDOC version of LZ77 compression. More... | |
MOBI_RET | mobi_decompress_huffman (unsigned char *out, const unsigned char *in, size_t *len_out, size_t len_in, const MOBIHuffCdic *huffcdic) |
Decompressor for huff/cdic compressed text records. More... | |
Copyright (c) 2014 Bartek Fabiszewski http://www.fabiszewski.net
This file is part of libmobi. Licensed under LGPL, either version 3, or any later. See http://www.gnu.org/licenses/
#define HUFF_CODETABLE_SIZE 33 |
Size of min- and maxcode tables
#define MOBI_HUFFMAN_MAXDEPTH 20 |
Maximal recursion level for huffman decompression routine
#define MOBI_INLINE |
Syntax for compiler inline keyword from config.h
MOBI_RET mobi_decompress_huffman | ( | unsigned char * | out, |
const unsigned char * | in, | ||
size_t * | len_out, | ||
size_t | len_in, | ||
const MOBIHuffCdic * | huffcdic | ||
) |
Decompressor for huff/cdic compressed text records.
Decompressor and HUFF/CDIC records parsing based on: perl EBook::Tools::Mobipocket python mobiunpack.py, calibre
[out] | out | Decompressed destination data |
[in] | in | Compressed source data |
[in,out] | len_out | Size of the memory reserved for decompressed data. On return it is set to actual size of decompressed data |
[in] | len_in | Size of compressed data |
[in] | huffcdic | MOBIHuffCdic structure with parsed data from huff/cdic records |
MOBI_RET mobi_decompress_lz77 | ( | unsigned char * | out, |
const unsigned char * | in, | ||
size_t * | len_out, | ||
const size_t | len_in | ||
) |
Decompressor fo PalmDOC version of LZ77 compression.
Decompressor based on this algorithm: http://en.wikibooks.org/wiki/Data_Compression/Dictionary_compression#PalmDoc
[out] | out | Decompressed destination data |
[in] | in | Compressed source data |
[in,out] | len_out | Size of the memory reserved for decompressed data. On return it is set to actual size of decompressed data |
[in] | len_in | Size of compressed data |