| 1 | /* mz_strm_mem.h -- Stream for memory access |
| 2 | part of the minizip-ng project |
| 3 | |
| 4 | Copyright (C) Nathan Moinvaziri |
| 5 | https://github.com/zlib-ng/minizip-ng |
| 6 | |
| 7 | This program is distributed under the terms of the same license as zlib. |
| 8 | See the accompanying LICENSE file for the full text of the license. |
| 9 | */ |
| 10 | |
| 11 | #ifndef MZ_STREAM_MEM_H |
| 12 | #define MZ_STREAM_MEM_H |
| 13 | |
| 14 | #ifdef __cplusplus |
| 15 | extern "C" { |
| 16 | #endif |
| 17 | |
| 18 | /***************************************************************************/ |
| 19 | |
| 20 | int32_t mz_stream_mem_open(void *stream, const char *filename, int32_t mode); |
| 21 | int32_t mz_stream_mem_is_open(void *stream); |
| 22 | int32_t mz_stream_mem_read(void *stream, void *buf, int32_t size); |
| 23 | int32_t mz_stream_mem_write(void *stream, const void *buf, int32_t size); |
| 24 | int64_t mz_stream_mem_tell(void *stream); |
| 25 | int32_t mz_stream_mem_seek(void *stream, int64_t offset, int32_t origin); |
| 26 | int32_t mz_stream_mem_close(void *stream); |
| 27 | int32_t mz_stream_mem_error(void *stream); |
| 28 | |
| 29 | void mz_stream_mem_set_buffer(void *stream, void *buf, int32_t size); |
| 30 | int32_t mz_stream_mem_get_buffer(void *stream, const void **buf); |
| 31 | int32_t mz_stream_mem_get_buffer_at(void *stream, int64_t position, const void **buf); |
| 32 | int32_t mz_stream_mem_get_buffer_at_current(void *stream, const void **buf); |
| 33 | void mz_stream_mem_get_buffer_length(void *stream, int32_t *length); |
| 34 | void mz_stream_mem_set_buffer_limit(void *stream, int32_t limit); |
| 35 | void mz_stream_mem_set_grow_size(void *stream, int32_t grow_size); |
| 36 | |
| 37 | void *mz_stream_mem_create(void); |
| 38 | void mz_stream_mem_delete(void **stream); |
| 39 | |
| 40 | void *mz_stream_mem_get_interface(void); |
| 41 | |
| 42 | /***************************************************************************/ |
| 43 | |
| 44 | #ifdef __cplusplus |
| 45 | } |
| 46 | #endif |
| 47 | |
| 48 | #endif |