1 /* 2 File lzx_compress.h, part of lzxcomp library 3 Copyright (C) 2002 Matthew T. Russotto 4 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 8 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. 13 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 17 */ 18 typedef struct lzx_data lzx_data; 19 typedef int (*lzx_get_bytes_t)(void *arg, int n, void *buf); 20 typedef int (*lzx_put_bytes_t)(void *arg, int n, void *buf); 21 typedef void (*lzx_mark_frame_t)(void *arg, uint32_t uncomp, uint32_t comp); 22 typedef int (*lzx_at_eof_t)(void *arg); 23 24 typedef struct lzx_results 25 { 26 /* add more here? Error codes, # blocks, # frames, etc? */ 27 long len_compressed_output; 28 long len_uncompressed_input; 29 } lzx_results; 30 31 int lzx_init(struct lzx_data **lzxdp, int wsize_code, 32 lzx_get_bytes_t get_bytes, void *get_bytes_arg, 33 lzx_at_eof_t at_eof, 34 lzx_put_bytes_t put_bytes, void *put_bytes_arg, 35 lzx_mark_frame_t mark_frame, void *mark_frame_arg); 36 37 void lzx_reset(lzx_data *lzxd); 38 39 int lzx_compress_block(lzx_data *lzxd, int block_size, int subdivide); 40 41 int lzx_finish(struct lzx_data *lzxd, struct lzx_results *lzxr); 42 43