4 * A match-finder for Lempel-Ziv compression based on bottom-up construction and
5 * traversal of the Longest Common Prefix (LCP) interval tree.
10 * The author dedicates this file to the public domain.
11 * You can do whatever you want with this file.
14 #ifndef _LCPIT_MATCHFINDER_H
15 #define _LCPIT_MATCHFINDER_H
17 #include "wimlib/types.h"
19 struct lcpit_matchfinder {
25 /* Mapping: suffix index ("window position") => lcp-interval index */
28 /* Mapping: lcp-interval index => lcp-interval data
30 * Initially, the lcp-interval data for an lcp-interval contains that
31 * interval's lcp and superinterval index.
33 * After a lcp-interval is visited during match-finding, its
34 * lcp-interval data contains that interval's lcp and the position of
35 * the next suffix to consider as a match when matching against that
42 /* The suffix array */
55 lcpit_matchfinder_get_needed_memory(size_t max_bufsize);
58 lcpit_matchfinder_init(struct lcpit_matchfinder *mf, size_t max_bufsize,
59 u32 min_match_len, u32 nice_match_len);
62 lcpit_matchfinder_destroy(struct lcpit_matchfinder *mf);
65 lcpit_matchfinder_load_buffer(struct lcpit_matchfinder *mf, const u8 *T, u32 n);
68 lcpit_matchfinder_get_matches(struct lcpit_matchfinder *mf,
69 struct lz_match *matches);
72 lcpit_matchfinder_skip_bytes(struct lcpit_matchfinder *mf, u32 count);
74 #endif /* _LCPIT_MATCHFINDER_H */