1 /* ioapi_mem.h -- IO base function header for compress/uncompress .zip
2 files using zlib + zip or unzip API
4 This version of ioapi is designed to access memory rather than files.
5 We do use a region of memory to put data in to and take it out of.
7 Copyright (C) 2012-2017 Nathan Moinvaziri (https://github.com/nmoinvaz/minizip)
8 (C) 2003 Justin Fletcher
9 (C) 1998-2003 Gilles Vollant
11 This program is distributed under the terms of the same license as zlib.
12 See the accompanying LICENSE file for the full text of the license.
29 voidpf ZCALLBACK fopen_mem_func(voidpf opaque, const char* filename, int mode);
30 voidpf ZCALLBACK fopendisk_mem_func(voidpf opaque, voidpf stream, uint32_t number_disk, int mode);
31 uint32_t ZCALLBACK fread_mem_func(voidpf opaque, voidpf stream, void* buf, uint32_t size);
32 uint32_t ZCALLBACK fwrite_mem_func(voidpf opaque, voidpf stream, const void* buf, uint32_t size);
33 long ZCALLBACK ftell_mem_func(voidpf opaque, voidpf stream);
34 long ZCALLBACK fseek_mem_func(voidpf opaque, voidpf stream, uint32_t offset, int origin);
35 int ZCALLBACK fclose_mem_func(voidpf opaque, voidpf stream);
36 int ZCALLBACK ferror_mem_func(voidpf opaque, voidpf stream);
38 typedef struct ourmemory_s {
39 char *base; /* Base of the region of memory we're using */
40 uint32_t size; /* Size of the region of memory we're using */
41 uint32_t limit; /* Furthest we've written */
42 uint32_t cur_offset; /* Current offset in the area */
43 int grow; /* Growable memory buffer */
46 void fill_memory_filefunc(zlib_filefunc_def* pzlib_filefunc_def, ourmemory_t *ourmem);