]> wimlib.net Git - wimlib/blob - include/wimlib/lz.h
Separate suffix array match-finder from LZX compressor
[wimlib] / include / wimlib / lz.h
1 #ifndef _WIMLIB_LZ_H
2 #define _WIMLIB_LZ_H
3
4 #include "wimlib/compress_common.h"
5
6 //#define ENABLE_LZ_DEBUG
7 #ifdef ENABLE_LZ_DEBUG
8 #  define LZ_DEBUG DEBUG
9 #  define LZ_ASSERT wimlib_assert
10 #  include "wimlib/assert.h"
11 #  include "wimlib/error.h"
12 #else
13 #  define LZ_DEBUG(...)
14 #  define LZ_ASSERT(...)
15 #endif
16
17
18 /* Raw LZ match/literal format: just a length and offset.
19  *
20  * The length is the number of bytes of the match, and the offset is the number
21  * of bytes back in the input the match is from the current position.
22  *
23  * This can alternatively be used to represent a literal byte if @len is less
24  * than the minimum match length.  */
25 struct raw_match {
26         input_idx_t len;
27         input_idx_t offset;
28 };
29
30 #endif /* _WIMLIB_LZ_H */