From 8ff8f191845a76aca15ce1f1bdbf1d28087d2bc5 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Thu, 13 Apr 2023 10:48:12 -0400 Subject: gzip: Rewrite --- (limited to 'src/gzip.h') diff --git a/src/gzip.h b/src/gzip.h index bdab8f2..409de51 100644 --- a/src/gzip.h +++ b/src/gzip.h @@ -20,26 +20,12 @@ #ifndef OPKG_OPK_GZIP_H_ #define OPKG_OPK_GZIP_H_ -#include -#include +struct opkg_opk_gzip; -#define OPKG_OPK_GZIP_BUFFER_SIZE 8192 - -struct opkg_opk_gzip_state { - FILE *input_file; - unsigned char input_buffer[OPKG_OPK_GZIP_BUFFER_SIZE]; - z_stream stream; -}; - -int -opkg_opk_gzip_init_from_file(struct opkg_opk_gzip_state *state, - const char *file_name); - -int -opkg_opk_gzip_init_from_memory(struct opkg_opk_gzip_state *state, - unsigned char *input, size_t input_size); +struct opkg_opk_gzip * +opkg_opk_gzip_init(int (*read)(void *, char **, size_t *), void *user_data); int -opkg_opk_gzip_next_record(struct opkg_opk_gzip_state *state, void *record); +opkg_opk_gzip_read(struct opkg_opk_gzip *gzip, void *record); #endif /* OPKG_OPK_GZIP_H_ */ -- cgit v0.9.1