added iOS source code
[wl-app.git] / iOS / Pods / SSZipArchive / SSZipArchive / minizip / ioapi_mem.h
1 /* ioapi_mem.h -- IO base function header for compress/uncompress .zip
2    files using zlib + zip or unzip API
3
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.
6
7    Copyright (C) 2012-2017 Nathan Moinvaziri (https://github.com/nmoinvaz/minizip)
8              (C) 2003 Justin Fletcher
9              (C) 1998-2003 Gilles Vollant
10
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.
13 */
14
15 #ifndef _IOAPI_MEM_H
16 #define _IOAPI_MEM_H
17
18 #include <stdio.h>
19 #include <stdlib.h>
20 #include <string.h>
21
22 #include "zlib.h"
23 #include "ioapi.h"
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
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);
37
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 */
44 } ourmemory_t;
45
46 void fill_memory_filefunc(zlib_filefunc_def* pzlib_filefunc_def, ourmemory_t *ourmem);
47
48 #ifdef __cplusplus
49 }
50 #endif
51
52 #endif