-typedef unsigned (*lz_record_match_t)(unsigned, unsigned, void *, void *);
-typedef unsigned (*lz_record_literal_t)(u8, void *);
-
-extern unsigned lz_analyze_block(const u8 uncompressed_data[],
- unsigned uncompressed_len,
- u32 match_tab[],
- lz_record_match_t record_match,
- lz_record_literal_t record_literal,
- void *record_match_arg1,
- void *record_match_arg2,
- void *record_literal_arg,
- const struct lz_params *params);
-
-extern int bitstream_put_bits(struct output_bitstream *ostream,
- output_bitbuf_t bits, unsigned num_bits);
-
-extern void init_output_bitstream(struct output_bitstream *ostream,
- void *data, unsigned num_bytes);
-
-extern int flush_output_bitstream(struct output_bitstream *ostream);
-
-extern void make_canonical_huffman_code(unsigned num_syms,
- unsigned max_codeword_len,
- const freq_t freq_tab[],
- u8 lens[],
- u16 codewords[]);
+typedef void (*lz_record_match_t)(unsigned len, unsigned offset, void *ctx);
+typedef void (*lz_record_literal_t)(u8 lit, void *ctx);
+
+extern void
+lz_analyze_block(const u8 window[],
+ input_idx_t window_size,
+ lz_record_match_t record_match,
+ lz_record_literal_t record_literal,
+ void *record_ctx,
+ const struct lz_params *params,
+ input_idx_t prev_tab[]);
+
+extern void
+make_canonical_huffman_code(unsigned num_syms,
+ unsigned max_codeword_len,
+ const freq_t freq_tab[restrict],
+ u8 lens[restrict],
+ u16 codewords[restrict]);