| 1 | /* mz_strm.h -- Stream interface |
| 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_H |
| 12 | #define MZ_STREAM_Hcxx . . $ `mz_strm.h:12:9`! |
| 13 | |
| 14 | #ifdef __cplusplus |
| 15 | extern "C" { |
| 16 | #endif |
| 17 | |
| 18 | /***************************************************************************/ |
| 19 | |
| 20 | #define MZ_STREAM_PROP_TOTAL_INcxx . . $ `mz_strm.h:20:9`! (1) |
| 21 | #define MZ_STREAM_PROP_TOTAL_IN_MAXcxx . . $ `mz_strm.h:21:9`! (2) |
| 22 | #define MZ_STREAM_PROP_TOTAL_OUTcxx . . $ `mz_strm.h:22:9`! (3) |
| 23 | #define MZ_STREAM_PROP_TOTAL_OUT_MAXcxx . . $ `mz_strm.h:23:9`! (4) |
| 24 | #define MZ_STREAM_PROP_HEADER_SIZEcxx . . $ `mz_strm.h:24:9`! (5) |
| 25 | #define MZ_STREAM_PROP_FOOTER_SIZEcxx . . $ `mz_strm.h:25:9`! (6) |
| 26 | #define MZ_STREAM_PROP_DISK_SIZEcxx . . $ `mz_strm.h:26:9`! (7) |
| 27 | #define MZ_STREAM_PROP_DISK_NUMBERcxx . . $ `mz_strm.h:27:9`! (8) |
| 28 | #define MZ_STREAM_PROP_COMPRESS_LEVELcxx . . $ `mz_strm.h:28:9`! (9) |
| 29 | #define MZ_STREAM_PROP_COMPRESS_METHODcxx . . $ `mz_strm.h:29:9`! (10) |
| 30 | #define MZ_STREAM_PROP_COMPRESS_WINDOWcxx . . $ `mz_strm.h:30:9`! (11) |
| 31 | |
| 32 | /***************************************************************************/ |
| 33 | |
| 34 | typedef int32_tcxx . . $ int32_t# (*mz_stream_open_cbcxx . . $ mz_stream_open_cb#)(void *stream, const char *path, int32_tcxx . . $ int32_t# mode); |
| 35 | typedef int32_tcxx . . $ int32_t# (*mz_stream_is_open_cbcxx . . $ mz_stream_is_open_cb#)(void *stream); |
| 36 | typedef int32_tcxx . . $ int32_t# (*mz_stream_read_cbcxx . . $ mz_stream_read_cb#)(void *stream, void *buf, int32_tcxx . . $ int32_t# size); |
| 37 | typedef int32_tcxx . . $ int32_t# (*mz_stream_write_cbcxx . . $ mz_stream_write_cb#)(void *stream, const void *buf, int32_tcxx . . $ int32_t# size); |
| 38 | typedef int64_tcxx . . $ int64_t# (*mz_stream_tell_cbcxx . . $ mz_stream_tell_cb#)(void *stream); |
| 39 | typedef int32_tcxx . . $ int32_t# (*mz_stream_seek_cbcxx . . $ mz_stream_seek_cb#)(void *stream, int64_tcxx . . $ int64_t# offset, int32_tcxx . . $ int32_t# origin); |
| 40 | typedef int32_tcxx . . $ int32_t# (*mz_stream_close_cbcxx . . $ mz_stream_close_cb#)(void *stream); |
| 41 | typedef int32_tcxx . . $ int32_t# (*mz_stream_error_cbcxx . . $ mz_stream_error_cb#)(void *stream); |
| 42 | typedef void *(*mz_stream_create_cbcxx . . $ mz_stream_create_cb#)(void); |
| 43 | typedef void (*mz_stream_destroy_cbcxx . . $ mz_stream_destroy_cb#)(void **stream); |
| 44 | |
| 45 | typedef int32_tcxx . . $ int32_t# (*mz_stream_get_prop_int64_cbcxx . . $ mz_stream_get_prop_int64_cb#)(void *stream, int32_tcxx . . $ int32_t# prop, int64_tcxx . . $ int64_t# *value); |
| 46 | typedef int32_tcxx . . $ int32_t# (*mz_stream_set_prop_int64_cbcxx . . $ mz_stream_set_prop_int64_cb#)(void *stream, int32_tcxx . . $ int32_t# prop, int64_tcxx . . $ int64_t# value); |
| 47 | |
| 48 | typedef int32_tcxx . . $ int32_t# (*mz_stream_find_cbcxx . . $ mz_stream_find_cb#)(void *stream, const void *find, int32_tcxx . . $ int32_t# find_size, int64_tcxx . . $ int64_t# max_seek, |
| 49 | int64_tcxx . . $ int64_t# *position); |
| 50 | |
| 51 | /***************************************************************************/ |
| 52 | |
| 53 | typedef struct mz_stream_vtbl_scxx . . $ mz_stream_vtbl_s# { |
| 54 | mz_stream_open_cbcxx . . $ mz_stream_open_cb# opencxx . . $ mz_stream_vtbl_s#open.; |
| 55 | mz_stream_is_open_cbcxx . . $ mz_stream_is_open_cb# is_opencxx . . $ mz_stream_vtbl_s#is_open.; |
| 56 | mz_stream_read_cbcxx . . $ mz_stream_read_cb# readcxx . . $ mz_stream_vtbl_s#read.; |
| 57 | mz_stream_write_cbcxx . . $ mz_stream_write_cb# writecxx . . $ mz_stream_vtbl_s#write.; |
| 58 | mz_stream_tell_cbcxx . . $ mz_stream_tell_cb# tellcxx . . $ mz_stream_vtbl_s#tell.; |
| 59 | mz_stream_seek_cbcxx . . $ mz_stream_seek_cb# seekcxx . . $ mz_stream_vtbl_s#seek.; |
| 60 | mz_stream_close_cbcxx . . $ mz_stream_close_cb# closecxx . . $ mz_stream_vtbl_s#close.; |
| 61 | mz_stream_error_cbcxx . . $ mz_stream_error_cb# errorcxx . . $ mz_stream_vtbl_s#error.; |
| 62 | mz_stream_create_cbcxx . . $ mz_stream_create_cb# createcxx . . $ mz_stream_vtbl_s#create.; |
| 63 | mz_stream_destroy_cbcxx . . $ mz_stream_destroy_cb# destroycxx . . $ mz_stream_vtbl_s#destroy.; |
| 64 | |
| 65 | mz_stream_get_prop_int64_cbcxx . . $ mz_stream_get_prop_int64_cb# get_prop_int64cxx . . $ mz_stream_vtbl_s#get_prop_int64.; |
| 66 | mz_stream_set_prop_int64_cbcxx . . $ mz_stream_set_prop_int64_cb# set_prop_int64cxx . . $ mz_stream_vtbl_s#set_prop_int64.; |
| 67 | } mz_stream_vtblcxx . . $ mz_stream_vtbl#; |
| 68 | |
| 69 | typedef struct mz_stream_scxx . . $ mz_stream_s# { |
| 70 | mz_stream_vtblcxx . . $ mz_stream_vtbl# *vtblcxx . . $ mz_stream_s#vtbl.; |
| 71 | struct mz_stream_scxx . . $ mz_stream_s# *basecxx . . $ mz_stream_s#base.; |
| 72 | } mz_streamcxx . . $ mz_stream#; |
| 73 | |
| 74 | /***************************************************************************/ |
| 75 | |
| 76 | int32_tcxx . . $ int32_t# mz_stream_opencxx . . $ mz_stream_open(7083a8984c0735e8).(void *stream, const char *path, int32_tcxx . . $ int32_t# mode); |
| 77 | int32_tcxx . . $ int32_t# mz_stream_is_opencxx . . $ mz_stream_is_open(dedf1e9b1c614a07).(void *stream); |
| 78 | int32_tcxx . . $ int32_t# mz_stream_readcxx . . $ mz_stream_read(8bc41909eac9e5d8).(void *stream, void *buf, int32_tcxx . . $ int32_t# size); |
| 79 | int32_tcxx . . $ int32_t# mz_stream_read_uint8cxx . . $ mz_stream_read_uint8(1d53cd22b884299b).(void *stream, uint8_tcxx . . $ uint8_t# *value); |
| 80 | int32_tcxx . . $ int32_t# mz_stream_read_uint16cxx . . $ mz_stream_read_uint16(900c00eb402c9863).(void *stream, uint16_tcxx . . $ uint16_t# *value); |
| 81 | int32_tcxx . . $ int32_t# mz_stream_read_uint32cxx . . $ mz_stream_read_uint32(3569d74970a1d1f9).(void *stream, uint32_tcxx . . $ uint32_t# *value); |
| 82 | int32_tcxx . . $ int32_t# mz_stream_read_int64cxx . . $ mz_stream_read_int64(3c3380c49b0234ac).(void *stream, int64_tcxx . . $ int64_t# *value); |
| 83 | int32_tcxx . . $ int32_t# mz_stream_read_uint64cxx . . $ mz_stream_read_uint64(17c9a57913c314f0).(void *stream, uint64_tcxx . . $ uint64_t# *value); |
| 84 | int32_tcxx . . $ int32_t# mz_stream_writecxx . . $ mz_stream_write(91e54fd90adbb21).(void *stream, const void *buf, int32_tcxx . . $ int32_t# size); |
| 85 | int32_tcxx . . $ int32_t# mz_stream_write_uint8cxx . . $ mz_stream_write_uint8(5276b51c10b71c09).(void *stream, uint8_tcxx . . $ uint8_t# value); |
| 86 | int32_tcxx . . $ int32_t# mz_stream_write_uint16cxx . . $ mz_stream_write_uint16(f805ef7ae580f896).(void *stream, uint16_tcxx . . $ uint16_t# value); |
| 87 | int32_tcxx . . $ int32_t# mz_stream_write_uint32cxx . . $ mz_stream_write_uint32(6fe7d876f9648735).(void *stream, uint32_tcxx . . $ uint32_t# value); |
| 88 | int32_tcxx . . $ int32_t# mz_stream_write_int64cxx . . $ mz_stream_write_int64(6b20ed9d0f5b4b14).(void *stream, int64_tcxx . . $ int64_t# value); |
| 89 | int32_tcxx . . $ int32_t# mz_stream_write_uint64cxx . . $ mz_stream_write_uint64(c0a5f96701d3f89).(void *stream, uint64_tcxx . . $ uint64_t# value); |
| 90 | int32_tcxx . . $ int32_t# mz_stream_copycxx . . $ mz_stream_copy(8bc41909eac9e5d8).(void *target, void *source, int32_tcxx . . $ int32_t# len); |
| 91 | int32_tcxx . . $ int32_t# mz_stream_copy_to_endcxx . . $ mz_stream_copy_to_end(361d5d7064a2a85d).(void *target, void *source); |
| 92 | int32_tcxx . . $ int32_t# mz_stream_copy_streamcxx . . $ mz_stream_copy_stream(956b84005340d103).(void *target, mz_stream_write_cbcxx . . $ mz_stream_write_cb# write_cb, void *source, mz_stream_read_cbcxx . . $ mz_stream_read_cb# read_cb, |
| 93 | int32_tcxx . . $ int32_t# len); |
| 94 | int32_tcxx . . $ int32_t# mz_stream_copy_stream_to_endcxx . . $ mz_stream_copy_stream_to_end(1b098803addc636d).(void *target, mz_stream_write_cbcxx . . $ mz_stream_write_cb# write_cb, void *source, |
| 95 | mz_stream_read_cbcxx . . $ mz_stream_read_cb# read_cb); |
| 96 | int64_tcxx . . $ int64_t# mz_stream_tellcxx . . $ mz_stream_tell(72c1818a5177f981).(void *stream); |
| 97 | int32_tcxx . . $ int32_t# mz_stream_seekcxx . . $ mz_stream_seek(8bc0ff128761c75d).(void *stream, int64_tcxx . . $ int64_t# offset, int32_tcxx . . $ int32_t# origin); |
| 98 | int32_tcxx . . $ int32_t# mz_stream_findcxx . . $ mz_stream_find(8aa461340cfae934).(void *stream, const void *find, int32_tcxx . . $ int32_t# find_size, int64_tcxx . . $ int64_t# max_seek, int64_tcxx . . $ int64_t# *position); |
| 99 | int32_tcxx . . $ int32_t# mz_stream_find_reversecxx . . $ mz_stream_find_reverse(8aa461340cfae934).(void *stream, const void *find, int32_tcxx . . $ int32_t# find_size, int64_tcxx . . $ int64_t# max_seek, int64_tcxx . . $ int64_t# *position); |
| 100 | int32_tcxx . . $ int32_t# mz_stream_closecxx . . $ mz_stream_close(dedf1e9b1c614a07).(void *stream); |
| 101 | int32_tcxx . . $ int32_t# mz_stream_errorcxx . . $ mz_stream_error(dedf1e9b1c614a07).(void *stream); |
| 102 | |
| 103 | int32_tcxx . . $ int32_t# mz_stream_set_basecxx . . $ mz_stream_set_base(361d5d7064a2a85d).(void *stream, void *base); |
| 104 | void *mz_stream_get_interfacecxx . . $ mz_stream_get_interface(9f162e79bfc6c74).(void *stream); |
| 105 | int32_tcxx . . $ int32_t# mz_stream_get_prop_int64cxx . . $ mz_stream_get_prop_int64(280df70541557ec8).(void *stream, int32_tcxx . . $ int32_t# prop, int64_tcxx . . $ int64_t# *value); |
| 106 | int32_tcxx . . $ int32_t# mz_stream_set_prop_int64cxx . . $ mz_stream_set_prop_int64(5f4b2ff0df22ef2b).(void *stream, int32_tcxx . . $ int32_t# prop, int64_tcxx . . $ int64_t# value); |
| 107 | |
| 108 | void *mz_stream_createcxx . . $ mz_stream_create(f660b63577525b91).(mz_stream_vtblcxx . . $ mz_stream_vtbl# *vtbl); |
| 109 | void mz_stream_deletecxx . . $ mz_stream_delete(539e082cf00e1f43).(void **stream); |
| 110 | |
| 111 | /***************************************************************************/ |
| 112 | |
| 113 | int32_tcxx . . $ int32_t# mz_stream_raw_opencxx . . $ mz_stream_raw_open(7083a8984c0735e8).(void *stream, const char *filename, int32_tcxx . . $ int32_t# mode); |
| 114 | int32_tcxx . . $ int32_t# mz_stream_raw_is_opencxx . . $ mz_stream_raw_is_open(dedf1e9b1c614a07).(void *stream); |
| 115 | int32_tcxx . . $ int32_t# mz_stream_raw_readcxx . . $ mz_stream_raw_read(8bc41909eac9e5d8).(void *stream, void *buf, int32_tcxx . . $ int32_t# size); |
| 116 | int32_tcxx . . $ int32_t# mz_stream_raw_writecxx . . $ mz_stream_raw_write(91e54fd90adbb21).(void *stream, const void *buf, int32_tcxx . . $ int32_t# size); |
| 117 | int64_tcxx . . $ int64_t# mz_stream_raw_tellcxx . . $ mz_stream_raw_tell(72c1818a5177f981).(void *stream); |
| 118 | int32_tcxx . . $ int32_t# mz_stream_raw_seekcxx . . $ mz_stream_raw_seek(8bc0ff128761c75d).(void *stream, int64_tcxx . . $ int64_t# offset, int32_tcxx . . $ int32_t# origin); |
| 119 | int32_tcxx . . $ int32_t# mz_stream_raw_closecxx . . $ mz_stream_raw_close(dedf1e9b1c614a07).(void *stream); |
| 120 | int32_tcxx . . $ int32_t# mz_stream_raw_errorcxx . . $ mz_stream_raw_error(dedf1e9b1c614a07).(void *stream); |
| 121 | |
| 122 | int32_tcxx . . $ int32_t# mz_stream_raw_get_prop_int64cxx . . $ mz_stream_raw_get_prop_int64(280df70541557ec8).(void *stream, int32_tcxx . . $ int32_t# prop, int64_tcxx . . $ int64_t# *value); |
| 123 | int32_tcxx . . $ int32_t# mz_stream_raw_set_prop_int64cxx . . $ mz_stream_raw_set_prop_int64(5f4b2ff0df22ef2b).(void *stream, int32_tcxx . . $ int32_t# prop, int64_tcxx . . $ int64_t# value); |
| 124 | |
| 125 | void *mz_stream_raw_createcxx . . $ mz_stream_raw_create(50c7df7de5344ebb).(void); |
| 126 | void mz_stream_raw_deletecxx . . $ mz_stream_raw_delete(539e082cf00e1f43).(void **stream); |
| 127 | |
| 128 | /***************************************************************************/ |
| 129 | |
| 130 | #ifdef __cplusplus |
| 131 | } |
| 132 | #endif |
| 133 | |
| 134 | #endif |