]> icculus.org git repositories - icculus/xz.git/blob - src/liblzma/common/filter_common.h
Remove bogus #includes.
[icculus/xz.git] / src / liblzma / common / filter_common.h
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 /// \file       filter_common.c
4 /// \brief      Filter-specific stuff common for both encoder and decoder
5 //
6 //  Copyright (C) 2008 Lasse Collin
7 //
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.
12 //
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.
17 //
18 ///////////////////////////////////////////////////////////////////////////////
19
20 #ifndef LZMA_FILTER_COMMON_H
21 #define LZMA_FILTER_COMMON_H
22
23 #include "common.h"
24
25
26 /// Both lzma_filter_encoder and lzma_filter_decoder begin with these members.
27 typedef struct {
28         /// Filter ID
29         lzma_vli id;
30
31         /// Initializes the filter encoder and calls lzma_next_filter_init()
32         /// for filters + 1.
33         lzma_init_function init;
34
35         /// Calculates memory usage of the encoder. If the options are
36         /// invalid, UINT64_MAX is returned.
37         uint64_t (*memusage)(const void *options);
38
39 } lzma_filter_coder;
40
41
42 typedef const lzma_filter_coder *(*lzma_filter_find)(lzma_vli id);
43
44
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);
49
50
51 extern uint64_t lzma_memusage_coder(lzma_filter_find coder_find,
52                 const lzma_filter *filters);
53
54
55 #endif