2 File lz_nonslide.h, part of lzxcomp library
3 Copyright (C) 2002 Matthew T. Russotto
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; version 2.1 only
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 typedef unsigned char u_char
;
23 typedef struct lz_info lz_info
;
24 typedef int (*get_chars_t
)(lz_info
*lzi
, int n
, u_char
*buf
);
25 typedef int (*output_match_t
)(lz_info
*lzi
, int match_pos
, int match_len
);
26 typedef void (*output_literal_t
)(lz_info
*lzi
, u_char ch
);
30 int wsize
; /* window size in bytes */
31 int max_match
; /* size of longest match in bytes */
37 int cur_loc
; /* location within stream */
47 get_chars_t get_chars
;
48 output_match_t output_match
;
49 output_literal_t output_literal
;
53 void lz_init(lz_info
*lzi
, int wsize
, int max_dist
,
54 int max_match
, int min_match
,
56 get_chars_t get_chars
,
57 output_match_t output_match
,
58 output_literal_t output_literal
, void *user_data
);
60 void lz_release(lz_info
*lzi
);
62 void lz_reset(lz_info
*lzi
);
63 void lz_stop_compressing(lz_info
*lzi
);
64 int lz_left_to_process(lz_info
*lzi
); /* returns # chars read in but unprocessed */
65 int lz_compress(lz_info
*lzi
, int nchars
);