1 #ifndef CLIB_Z_PROTOS_H 2 #define CLIB_Z_PROTOS_H 3 4 /* 5 z.library C prototypes 6 7 Copyright © 2003-2023 The MorphOS Development Team, All Rights Reserved. 8 */ 9 10 #ifndef LIBRARIES_Z_H 11 # include <libraries/z.h> 12 #endif 13 14 15 #ifdef __cplusplus 16 extern "C" { 17 #endif 18 19 const char *zlibVersion(void); 20 21 int deflate(z_streamp strm, int flush); 22 int deflateEnd(z_streamp strm); 23 24 int inflate(z_streamp strm, int flush); 25 int inflateEnd(z_streamp strm); 26 27 int deflateSetDictionary(z_streamp strm, const Bytef *dictionary, uInt dictLength); 28 int deflateCopy(z_streamp dest, z_streamp source); 29 int deflateReset(z_streamp strm); 30 int deflateParams(z_streamp strm,int level,int strategy); 31 int deflateTune(z_streamp strm, int good_length, int max_lazy, int nice_length, int max_chain); 32 int deflateSetHeader(z_streamp strm, gz_headerp head); 33 34 int inflateSetDictionary(z_streamp strm, const Bytef *dictionary, uInt dictLength); 35 int inflateGetDictionary(z_streamp strm, Bytef *dictionary, uInt *dictLength); 36 int inflateSync(z_streamp strm); 37 int inflateReset(z_streamp strm); 38 int inflateReset2(z_streamp strm, int windowBits); 39 int inflatePrime(z_streamp strm, int bits, int value); 40 long inflateMark (z_streamp strm); 41 int inflateGetHeader(z_streamp strm, gz_headerp head); 42 43 int compress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen); 44 int compress2(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen, int level); 45 int uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen); 46 47 int deflateInit_(z_streamp strm, int level, const char *version, int stream_size); 48 int inflateInit_(z_streamp strm, const char *version, int stream_size); 49 int deflateInit2_(z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy, const char *version, int stream_size); 50 int inflateInit2_(z_streamp strm, int windowBits, const char *version, int stream_size); 51 52 #define deflateInit(strm, level) deflateInit_((strm),(level),ZLIB_VERSION,sizeof(z_stream)) 53 #define inflateInit(strm) inflateInit_((strm),ZLIB_VERSION,sizeof(z_stream)) 54 #define deflateInit2(strm,level,method,windowBits,memLevel,strategy) deflateInit2_((strm),(level),(method),(windowBits),(memLevel),(strategy),ZLIB_VERSION,sizeof(z_stream)) 55 #define inflateInit2(strm,windowBits) inflateInit2_((strm),(windowBits),ZLIB_VERSION,sizeof(z_stream)) 56 57 uLong adler32(uLong adler, const Bytef *buf, uInt len); 58 uLong adler32_combine(uLong adler1, uLong adler2, z_off_t len2); 59 uLong crc32(uLong crc, const Bytef *buf, uInt len); 60 uLong crc32_combine(uLong crc1, uLong crc2, z_off_t len2); 61 gzFile gzopen64(const char *path, const char *mode); 62 z_off64_t gzseek64(gzFile file, z_off64_t offset, int whence); 63 z_off64_t gztell64(gzFile file); 64 z_off64_t gzoffset64(gzFile file); 65 uLong adler32_combine64(uLong adler1, uLong adler2, z_off64_t len2); 66 uLong crc32_combine64(uLong crc1, uLong crc2, z_off64_t len2); 67 68 const char *zError(int err); 69 int inflateSyncPoint(z_streamp strm); 70 const z_crc_t *get_crc_table(void); 71 int inflateUndermine(z_streamp strm, int subvert); 72 int inflateResetKeep(z_streamp strm); 73 int deflateResetKeep(z_streamp strm); 74 unsigned long gzflags(void); 75 uLong zlibCompileFlags(void); 76 77 int inflateCopy(z_streamp dest, z_streamp source); 78 79 int inflateBackInit_(z_streamp strm, int windowBits, unsigned char *window, const char *version, int stream_size); 80 int inflateBack(z_streamp strm, in_func in, void *in_desc, out_func out, void *out_desc); 81 int inflateBackEnd(z_streamp strm); 82 83 #define inflateBackInit(strm,windowBits,window) inflateBackInit_((strm),(windowBits),(window),ZLIB_VERSION,sizeof(z_stream)) 84 85 uLong compressBound(uLong sourceLen); 86 uLong deflateBound(z_streamp strm, uLong sourceLen); 87 int deflatePrime(z_streamp strm,int bits,int value); 88 int deflatePending(z_streamp strm, unsigned *pending, int *bits); 89 90 gzFile gzopen(const char *path, const char *mode); 91 gzFile gzdopen(int fd, const char *mode); 92 int gzbuffer(gzFile file, unsigned size); 93 int gzsetparams(gzFile file, int level, int strategy); 94 int gzread(gzFile file, voidp buf, unsigned len); 95 z_size_t gzfread(voidp buf, z_size_t size, z_size_t nitems, gzFile file); 96 int gzwrite(gzFile file, voidpc buf, unsigned len); 97 z_size_t gzfwrite(voidpc buf, z_size_t size, z_size_t nitems, gzFile file); 98 int gzprintf(gzFile file, const char *format, ...); 99 int gzputs(gzFile file, const char *s); 100 char * gzgets(gzFile file, char *buf, int len); 101 int gzputc(gzFile file, int c); 102 int gzgetc(gzFile file); 103 int gzungetc(int c, gzFile file); 104 int gzflush(gzFile file, int flush); 105 z_off_t gzseek(gzFile file, z_off_t offset, int whence); 106 int gzrewind(gzFile file); 107 z_off_t gztell(gzFile file); 108 z_off_t gzoffset(gzFile file); 109 int gzeof(gzFile file); 110 int gzclose(gzFile file); 111 int gzclose_r(gzFile file); 112 int gzclose_w(gzFile file); 113 const char * gzerror(gzFile file, int *errnum); 114 void gzclearerr(gzFile file); 115 int gzdirect(gzFile file); 116 int gzvprintf(gzFile file, const char *format, va_list va); 117 118 119 int blast(blast_in infun, void *inhow, blast_out outfun, void *outhow); 120 121 int inflateBack9(z_streamp strm,in_func in, void *in_desc, out_func out, void *out_desc); 122 int inflateBack9End(z_streamp strm); 123 int inflateBack9Init_(z_streamp strm, unsigned char *window, const char *version, int stream_size); 124 125 #define inflateBack9Init(strm, window) inflateBack9Init_((strm), (window), ZLIB_VERSION, sizeof(z_stream)) 126 127 128 int deflateGetDictionary(z_streamp strm, Bytef *dictionary, uInt *dictLength); 129 int uncompress2(Bytef *dest, uLongf *destLen, const Bytef *source, uLong *sourceLen); 130 #define adler32_z(a,b,l) adler32(a,b,(uInt)(l)) 131 #define crc32_z(a,b,l) crc32(a,b,(uInt)(l)) 132 int inflateValidate(z_streamp strm, int check); 133 unsigned long inflateCodesUsed(z_streamp strm); 134 135 uLong crc32_combine_gen64(z_off64_t len2); 136 uLong crc32_combine_gen(z_off_t len2); 137 uLong crc32_combine_op(uLong crc1, uLong crc2, uLong op); 138 139 #ifdef __cplusplus 140 } 141 #endif 142 143 #endif /* CLIB_Z_PROTOS_H */