]> icculus.org git repositories - icculus/xz.git/blob - src/liblzma/lz/match_h.h
Imported to git.
[icculus/xz.git] / src / liblzma / lz / match_h.h
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 /// \file       match_h.h
4 /// \brief      Header template for different match finders
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 #include "lz_encoder_private.h"
22
23
24 //////////////////////
25 // Global constants //
26 //////////////////////
27
28 #undef LZMA_HASH_SIZE
29 #undef LZMA_FIX_HASH_SIZE
30 #undef LZMA_HASH_SIZE_C
31 #undef LZMA_FIX_HASH_SIZE_C
32
33 #define LZMA_HASH_SIZE(mf_name) LZMA_HASH_SIZE_C(mf_name)
34 #define LZMA_FIX_HASH_SIZE(mf_name) LZMA_FIX_HASH_SIZE_C(mf_name)
35
36 #define LZMA_HASH_SIZE_C(mf_name) \
37         const uint32_t LZMA_ ## mf_name ## _HASH_SIZE
38
39 #define LZMA_FIX_HASH_SIZE_C(mf_name) \
40         const uint32_t LZMA_ ## mf_name ## _FIX_HASH_SIZE
41
42 extern LZMA_HASH_SIZE(LZMA_MATCH_FINDER_NAME_UPPER);
43 extern LZMA_FIX_HASH_SIZE(LZMA_MATCH_FINDER_NAME_UPPER);
44
45
46 ///////////////
47 // Functions //
48 ///////////////
49
50 #undef LZMA_GET_MATCHES
51 #undef LZMA_SKIP
52 #undef LZMA_GET_MATCHES_C
53 #undef LZMA_SKIP_C
54
55 #define LZMA_GET_MATCHES(mf_name) LZMA_GET_MATCHES_C(mf_name)
56 #define LZMA_SKIP(mf_name) LZMA_SKIP_C(mf_name)
57
58 #define LZMA_GET_MATCHES_C(mf_name) \
59         extern void lzma_ ## mf_name ## _get_matches( \
60                         lzma_lz_encoder *restrict lz, \
61                         uint32_t *restrict distances)
62
63 #define LZMA_SKIP_C(mf_name) \
64         extern void lzma_ ## mf_name ## _skip( \
65                         lzma_lz_encoder *lz, uint32_t num)
66
67 LZMA_GET_MATCHES(LZMA_MATCH_FINDER_NAME_LOWER);
68
69 LZMA_SKIP(LZMA_MATCH_FINDER_NAME_LOWER);