]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/xz/src/liblzma/common/easy_decoder_memusage.c
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / xz / src / liblzma / common / easy_decoder_memusage.c
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 /// \file       easy_decoder_memusage.c
4 /// \brief      Decoder memory usage calculation to match easy encoder presets
5 //
6 //  Author:     Lasse Collin
7 //
8 //  This file has been put into the public domain.
9 //  You can do whatever you want with this file.
10 //
11 ///////////////////////////////////////////////////////////////////////////////
12
13 #include "easy_preset.h"
14
15
16 extern LZMA_API(uint64_t)
17 lzma_easy_decoder_memusage(uint32_t preset)
18 {
19         lzma_options_easy opt_easy;
20         if (lzma_easy_preset(&opt_easy, preset))
21                 return UINT32_MAX;
22
23         return lzma_raw_decoder_memusage(opt_easy.filters);
24 }