]> icculus.org git repositories - icculus/xz.git/blob - src/liblzma/lzma/lzma_decoder.h
Added initial support for preset dictionary for raw LZMA1
[icculus/xz.git] / src / liblzma / lzma / lzma_decoder.h
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 /// \file       lzma_decoder.h
4 /// \brief      LZMA decoder API
5 //
6 //  Copyright (C) 1999-2006 Igor Pavlov
7 //  Copyright (C) 2007 Lasse Collin
8 //
9 //  This library is free software; you can redistribute it and/or
10 //  modify it under the terms of the GNU Lesser General Public
11 //  License as published by the Free Software Foundation; either
12 //  version 2.1 of the License, or (at your option) any later version.
13 //
14 //  This library is distributed in the hope that it will be useful,
15 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
16 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 //  Lesser General Public License for more details.
18 //
19 ///////////////////////////////////////////////////////////////////////////////
20
21 #ifndef LZMA_LZMA_DECODER_H
22 #define LZMA_LZMA_DECODER_H
23
24 #include "common.h"
25
26
27 /// Allocates and initializes LZMA decoder
28 extern lzma_ret lzma_lzma_decoder_init(lzma_next_coder *next,
29                 lzma_allocator *allocator, const lzma_filter_info *filters);
30
31 extern uint64_t lzma_lzma_decoder_memusage(const void *options);
32
33 extern lzma_ret lzma_lzma_props_decode(
34                 void **options, lzma_allocator *allocator,
35                 const uint8_t *props, size_t props_size);
36
37
38 /// \brief      Decodes the LZMA Properties byte (lc/lp/pb)
39 ///
40 /// \return     true if error occorred, false on success
41 ///
42 extern bool lzma_lzma_lclppb_decode(
43                 lzma_options_lzma *options, uint8_t byte);
44
45
46 #ifdef LZMA_LZ_DECODER_H
47 /// Allocate and setup function pointers only. This is used by LZMA1 and
48 /// LZMA2 decoders.
49 extern lzma_ret lzma_lzma_decoder_create(
50                 lzma_lz_decoder *lz, lzma_allocator *allocator,
51                 const void *opt, lzma_lz_options *lz_options);
52
53 /// Gets memory usage without validating lc/lp/pb. This is used by LZMA2
54 /// decoder, because raw LZMA2 decoding doesn't need lc/lp/pb.
55 extern uint64_t lzma_lzma_decoder_memusage_nocheck(const void *options);
56
57 #endif
58
59 #endif