1 ///////////////////////////////////////////////////////////////////////////////
3 /// \file filter_common.c
4 /// \brief Filter-specific stuff common for both encoder and decoder
6 // Copyright (C) 2008 Lasse Collin
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Lesser General Public
10 // License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
18 ///////////////////////////////////////////////////////////////////////////////
20 #ifndef LZMA_FILTER_COMMON_H
21 #define LZMA_FILTER_COMMON_H
26 /// Both lzma_filter_encoder and lzma_filter_decoder begin with these members.
31 /// Initializes the filter encoder and calls lzma_next_filter_init()
33 lzma_init_function init;
35 /// Calculates memory usage of the encoder. If the options are
36 /// invalid, UINT64_MAX is returned.
37 uint64_t (*memusage)(const void *options);
42 typedef const lzma_filter_coder *(*lzma_filter_find)(lzma_vli id);
45 extern lzma_ret lzma_raw_coder_init(
46 lzma_next_coder *next, lzma_allocator *allocator,
47 const lzma_filter *filters,
48 lzma_filter_find coder_find, bool is_encoder);
51 extern uint64_t lzma_raw_coder_memusage(lzma_filter_find coder_find,
52 const lzma_filter *filters);