1207753Smm///////////////////////////////////////////////////////////////////////////////
2207753Smm//
3207753Smm/// \file       lzma_decoder.h
4207753Smm/// \brief      LZMA decoder API
5207753Smm///
6207753Smm//  Authors:    Igor Pavlov
7207753Smm//              Lasse Collin
8207753Smm//
9207753Smm//  This file has been put into the public domain.
10207753Smm//  You can do whatever you want with this file.
11207753Smm//
12207753Smm///////////////////////////////////////////////////////////////////////////////
13207753Smm
14207753Smm#ifndef LZMA_LZMA_DECODER_H
15207753Smm#define LZMA_LZMA_DECODER_H
16207753Smm
17207753Smm#include "common.h"
18207753Smm
19207753Smm
20207753Smm/// Allocates and initializes LZMA decoder
21207753Smmextern lzma_ret lzma_lzma_decoder_init(lzma_next_coder *next,
22207753Smm		lzma_allocator *allocator, const lzma_filter_info *filters);
23207753Smm
24207753Smmextern uint64_t lzma_lzma_decoder_memusage(const void *options);
25207753Smm
26207753Smmextern lzma_ret lzma_lzma_props_decode(
27207753Smm		void **options, lzma_allocator *allocator,
28207753Smm		const uint8_t *props, size_t props_size);
29207753Smm
30207753Smm
31207753Smm/// \brief      Decodes the LZMA Properties byte (lc/lp/pb)
32207753Smm///
33207753Smm/// \return     true if error occurred, false on success
34207753Smm///
35207753Smmextern bool lzma_lzma_lclppb_decode(
36207753Smm		lzma_options_lzma *options, uint8_t byte);
37207753Smm
38207753Smm
39207753Smm#ifdef LZMA_LZ_DECODER_H
40207753Smm/// Allocate and setup function pointers only. This is used by LZMA1 and
41207753Smm/// LZMA2 decoders.
42207753Smmextern lzma_ret lzma_lzma_decoder_create(
43207753Smm		lzma_lz_decoder *lz, lzma_allocator *allocator,
44207753Smm		const void *opt, lzma_lz_options *lz_options);
45207753Smm
46207753Smm/// Gets memory usage without validating lc/lp/pb. This is used by LZMA2
47207753Smm/// decoder, because raw LZMA2 decoding doesn't need lc/lp/pb.
48207753Smmextern uint64_t lzma_lzma_decoder_memusage_nocheck(const void *options);
49207753Smm
50207753Smm#endif
51207753Smm
52207753Smm#endif
53