From 00693f2324318f196cab57823526d3133fa7a146 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Tue, 25 Apr 2023 15:11:24 -0400 Subject: gzip: Add write direction --- (limited to 'src/gzip.h') diff --git a/src/gzip.h b/src/gzip.h index e4c3f52..1fd5d5e 100644 --- a/src/gzip.h +++ b/src/gzip.h @@ -23,6 +23,7 @@ struct opkg_opk_gzip; typedef int (opkg_opk_gzip_read_func)(void *, char **, size_t *); +typedef int (opkg_opk_gzip_write_func)(void *, size_t); /* * Allocates and initializes a decompression structure. @@ -41,7 +42,11 @@ typedef int (opkg_opk_gzip_read_func)(void *, char **, size_t *); * - NULL on memory exhaustion. */ struct opkg_opk_gzip * -opkg_opk_gzip_init(opkg_opk_gzip_read_func *read, void *user_data); +opkg_opk_gzip_init_read(opkg_opk_gzip_read_func *read, void *user_data); + +struct opkg_opk_gzip * +opkg_opk_gzip_init_write(char *buffer, size_t size, + opkg_opk_gzip_write_func *write, void *user_data); /* * Reads and decompresses data to output the next record (512 octets). @@ -57,12 +62,16 @@ opkg_opk_gzip_init(opkg_opk_gzip_read_func *read, void *user_data); int opkg_opk_gzip_read(struct opkg_opk_gzip *gzip, void *record); +int +opkg_opk_gzip_write(struct opkg_opk_gzip *gzip, void *record, size_t size, + int last); + /* * Frees a decompression structure. * Parameters: * - gzip: Decompression structure. */ -void +int opkg_opk_gzip_free(struct opkg_opk_gzip *gzip); #endif /* OPKG_OPK_GZIP_H_ */ -- cgit v0.9.1