// Borland C++ Builder
// Copyright (c) 1995, 2005 by Borland Software Corporation
// All rights reserved

// (DO NOT EDIT: machine generated header) 'Idzlib.pas' rev: 10.00

#ifndef IdzlibHPP
#define IdzlibHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member functions
#pragma pack(push,8)
#include <System.hpp>	// Pascal unit
#include <Sysinit.hpp>	// Pascal unit
#include <Sysutils.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Idzlib
{
//-- type declarations -------------------------------------------------------
typedef int *PLongInt;

typedef void * __cdecl (*TAlloc)(void * AppData, int Items, int Size);

typedef void __cdecl (*TFree)(void * AppData, void * Block);

typedef int __cdecl (*TInFunc)(void * AppData, void * &Buf);

typedef int __cdecl (*TOutFunc)(void * AppData, void * Buf, int Size);

struct TgzHeaderRec;
typedef TgzHeaderRec *PgzHeaderRec;

#pragma pack(push,1)
struct TgzHeaderRec
{
	
public:
	int text;
	unsigned time;
	int xflags;
	int os;
	char *extra;
	unsigned extra_len;
	unsigned extra_max;
	char *name;
	unsigned name_max;
	unsigned comment;
	unsigned comm_max;
	int hcrc;
	int done;
} ;
#pragma pack(pop)

#pragma pack(push,1)
struct TZStreamRec
{
	
public:
	char *next_in;
	int avail_in;
	int total_in;
	char *next_out;
	int avail_out;
	int total_out;
	char *msg;
	void *internal;
	TAlloc zalloc;
	TFree zfree;
	void *AppData;
	int data_type;
	int adler;
	int reserved;
} ;
#pragma pack(pop)

class DELPHICLASS TCustomZlibStream;
class PASCALIMPLEMENTATION TCustomZlibStream : public Classes::TStream 
{
	typedef Classes::TStream inherited;
	
private:
	Classes::TStream* FStrm;
	int FStrmPos;
	Classes::TNotifyEvent FOnProgress;
	#pragma pack(push,1)
	TZStreamRec FZRec;
	#pragma pack(pop)
	char FBuffer[65536];
	
protected:
	DYNAMIC void __fastcall Progress(System::TObject* Sender);
	__property Classes::TNotifyEvent OnProgress = {read=FOnProgress, write=FOnProgress};
	__fastcall TCustomZlibStream(Classes::TStream* Strm);
public:
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~TCustomZlibStream(void) { }
	#pragma option pop
	
};


#pragma option push -b-
enum TCompressionLevel { clNone, clFastest, clDefault, clMax };
#pragma option pop

class DELPHICLASS TCompressionStream;
class PASCALIMPLEMENTATION TCompressionStream : public TCustomZlibStream 
{
	typedef TCustomZlibStream inherited;
	
private:
	float __fastcall GetCompressionRate(void);
	
public:
	__fastcall TCompressionStream(TCompressionLevel CompressionLevel, Classes::TStream* Dest);
	__fastcall virtual ~TCompressionStream(void);
	virtual int __fastcall Read(void *Buffer, int Count);
	virtual int __fastcall Write(const void *Buffer, int Count);
	virtual int __fastcall Seek(int Offset, Word Origin)/* overload */;
	__property float CompressionRate = {read=GetCompressionRate};
	__property OnProgress ;
	
/* Hoisted overloads: */
	
public:
	inline __int64 __fastcall  Seek(const __int64 Offset, Classes::TSeekOrigin Origin){ return TStream::Seek(Offset, Origin); }
	
};


class DELPHICLASS TDecompressionStream;
class PASCALIMPLEMENTATION TDecompressionStream : public TCustomZlibStream 
{
	typedef TCustomZlibStream inherited;
	
public:
	__fastcall TDecompressionStream(Classes::TStream* Source);
	__fastcall virtual ~TDecompressionStream(void);
	virtual int __fastcall Read(void *Buffer, int Count);
	virtual int __fastcall Write(const void *Buffer, int Count);
	virtual int __fastcall Seek(int Offset, Word Origin)/* overload */;
	__property OnProgress ;
	
/* Hoisted overloads: */
	
public:
	inline __int64 __fastcall  Seek(const __int64 Offset, Classes::TSeekOrigin Origin){ return TStream::Seek(Offset, Origin); }
	
};


class DELPHICLASS EZlibError;
class PASCALIMPLEMENTATION EZlibError : public Sysutils::Exception 
{
	typedef Sysutils::Exception inherited;
	
protected:
	int FErrorCode;
	
public:
	__fastcall EZlibError(const int AError);
	__property int ErrorCode = {read=FErrorCode, nodefault};
public:
	#pragma option push -w-inl
	/* Exception.Create */ inline __fastcall EZlibError(const AnsiString Msg) : Sysutils::Exception(Msg) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmt */ inline __fastcall EZlibError(const AnsiString Msg, System::TVarRec const * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateRes */ inline __fastcall EZlibError(int Ident)/* overload */ : Sysutils::Exception(Ident) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmt */ inline __fastcall EZlibError(int Ident, System::TVarRec const * Args, const int Args_Size)/* overload */ : Sysutils::Exception(Ident, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateHelp */ inline __fastcall EZlibError(const AnsiString Msg, int AHelpContext) : Sysutils::Exception(Msg, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmtHelp */ inline __fastcall EZlibError(const AnsiString Msg, System::TVarRec const * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResHelp */ inline __fastcall EZlibError(int Ident, int AHelpContext)/* overload */ : Sysutils::Exception(Ident, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmtHelp */ inline __fastcall EZlibError(System::PResStringRec ResStringRec, System::TVarRec const * Args, const int Args_Size, int AHelpContext)/* overload */ : Sysutils::Exception(ResStringRec, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~EZlibError(void) { }
	#pragma option pop
	
};


class DELPHICLASS ECompressionError;
class PASCALIMPLEMENTATION ECompressionError : public EZlibError 
{
	typedef EZlibError inherited;
	
public:
	#pragma option push -w-inl
	/* EZlibError.CreateError */ inline __fastcall ECompressionError(const int AError) : EZlibError(AError) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* Exception.Create */ inline __fastcall ECompressionError(const AnsiString Msg) : EZlibError(Msg) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmt */ inline __fastcall ECompressionError(const AnsiString Msg, System::TVarRec const * Args, const int Args_Size) : EZlibError(Msg, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateRes */ inline __fastcall ECompressionError(int Ident)/* overload */ : EZlibError(Ident) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmt */ inline __fastcall ECompressionError(int Ident, System::TVarRec const * Args, const int Args_Size)/* overload */ : EZlibError(Ident, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateHelp */ inline __fastcall ECompressionError(const AnsiString Msg, int AHelpContext) : EZlibError(Msg, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmtHelp */ inline __fastcall ECompressionError(const AnsiString Msg, System::TVarRec const * Args, const int Args_Size, int AHelpContext) : EZlibError(Msg, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResHelp */ inline __fastcall ECompressionError(int Ident, int AHelpContext)/* overload */ : EZlibError(Ident, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmtHelp */ inline __fastcall ECompressionError(System::PResStringRec ResStringRec, System::TVarRec const * Args, const int Args_Size, int AHelpContext)/* overload */ : EZlibError(ResStringRec, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~ECompressionError(void) { }
	#pragma option pop
	
};


class DELPHICLASS EDecompressionError;
class PASCALIMPLEMENTATION EDecompressionError : public EZlibError 
{
	typedef EZlibError inherited;
	
public:
	#pragma option push -w-inl
	/* EZlibError.CreateError */ inline __fastcall EDecompressionError(const int AError) : EZlibError(AError) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* Exception.Create */ inline __fastcall EDecompressionError(const AnsiString Msg) : EZlibError(Msg) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmt */ inline __fastcall EDecompressionError(const AnsiString Msg, System::TVarRec const * Args, const int Args_Size) : EZlibError(Msg, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateRes */ inline __fastcall EDecompressionError(int Ident)/* overload */ : EZlibError(Ident) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmt */ inline __fastcall EDecompressionError(int Ident, System::TVarRec const * Args, const int Args_Size)/* overload */ : EZlibError(Ident, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateHelp */ inline __fastcall EDecompressionError(const AnsiString Msg, int AHelpContext) : EZlibError(Msg, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmtHelp */ inline __fastcall EDecompressionError(const AnsiString Msg, System::TVarRec const * Args, const int Args_Size, int AHelpContext) : EZlibError(Msg, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResHelp */ inline __fastcall EDecompressionError(int Ident, int AHelpContext)/* overload */ : EZlibError(Ident, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmtHelp */ inline __fastcall EDecompressionError(System::PResStringRec ResStringRec, System::TVarRec const * Args, const int Args_Size, int AHelpContext)/* overload */ : EZlibError(ResStringRec, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~EDecompressionError(void) { }
	#pragma option pop
	
};


//-- var, const, procedure ---------------------------------------------------
#define zlib_version "1.2.3"
static const Word ZLIB_VERNUM = 0x1230;
static const Shortint Z_NO_FLUSH = 0x0;
static const Shortint Z_PARTIAL_FLUSH = 0x1;
static const Shortint Z_SYNC_FLUSH = 0x2;
static const Shortint Z_FULL_FLUSH = 0x3;
static const Shortint Z_FINISH = 0x4;
static const Shortint Z_BLOCK = 0x5;
static const Shortint Z_OK = 0x0;
static const Shortint Z_STREAM_END = 0x1;
static const Shortint Z_NEED_DICT = 0x2;
static const Shortint Z_ERRNO = -1;
static const Shortint Z_STREAM_ERROR = -2;
static const Shortint Z_DATA_ERROR = -3;
static const Shortint Z_MEM_ERROR = -4;
static const Shortint Z_BUF_ERROR = -5;
static const Shortint Z_VERSION_ERROR = -6;
static const Shortint Z_NO_COMPRESSION = 0x0;
static const Shortint Z_BEST_SPEED = 0x1;
static const Shortint Z_BEST_COMPRESSION = 0x9;
static const Shortint Z_DEFAULT_COMPRESSION = -1;
static const Shortint Z_FILTERED = 0x1;
static const Shortint Z_HUFFMAN_ONLY = 0x2;
static const Shortint Z_RLE = 0x3;
static const Shortint Z_DEFAULT_STRATEGY = 0x0;
static const Shortint Z_BINARY = 0x0;
static const Shortint Z_ASCII = 0x1;
static const Shortint Z_UNKNOWN = 0x2;
static const Shortint Z_DEFLATED = 0x8;
static const Shortint Z_NULL = 0x0;
static const Shortint MAX_WBITS = 0xf;
static const Shortint GZIP_WINBITS = 0x1f;
static const Shortint RAW_WBITS = -15;
static const Shortint MAX_MEM_LEVEL = 0x9;
static const Shortint DEF_MEM_LEVEL = 0x8;
extern PACKAGE void * __cdecl zlibAllocMem(void * AppData, int Items, int Size);
extern PACKAGE void __cdecl zlibFreeMem(void * AppData, void * Block);
extern PACKAGE int __fastcall CCheck(int code);
extern PACKAGE int __fastcall DCheck(int code);
extern PACKAGE void __fastcall CompressBuf(const void * InBuf, int InBytes, /* out */ void * &OutBuf, /* out */ int &OutBytes);
extern PACKAGE void __fastcall DecompressBuf(const void * InBuf, int InBytes, int OutEstimate, /* out */ void * &OutBuf, /* out */ int &OutBytes);
extern PACKAGE void __fastcall DecompressToUserBuf(const void * InBuf, int InBytes, const void * OutBuf, int BufSize);
extern PACKAGE void __fastcall DecompressStream(Classes::TStream* InStream, Classes::TStream* OutStream)/* overload */;
extern PACKAGE void __fastcall DecompressStream(Classes::TStream* InStream, Classes::TStream* OutStream, const int AWindowBits)/* overload */;
extern PACKAGE void __fastcall CompressStream(Classes::TStream* InStream, Classes::TStream* OutStream, const int level = 0xffffffff, const int WinBits = 0xf, const int MemLevel = 0x9, const int Stratagy = 0x0);
extern PACKAGE unsigned __fastcall adler32(unsigned adler, const char * buf, unsigned len);
extern PACKAGE unsigned __fastcall adler32_combine(unsigned adler1, unsigned adler2, int len2);
extern PACKAGE int __fastcall compress2(char * dest, unsigned &destLen, const char * source, unsigned sourceLen, int level);
extern PACKAGE int __fastcall compress(char * dest, unsigned &destLen, const char * source, unsigned sourceLen);
extern PACKAGE unsigned __fastcall compressBound(unsigned sourceLen);
extern PACKAGE PLongInt __fastcall get_crc_table(void);
extern PACKAGE unsigned __fastcall crc32(unsigned crc, const char * buf, unsigned len);
extern PACKAGE int __fastcall deflateInit_(TZStreamRec &strm, int level, char * version, int recsize);
extern PACKAGE int __fastcall deflateInit2_(TZStreamRec &strm, int level, int method, int windowBits, int memLevel, int strategy, char * version, int recsize);
extern PACKAGE int __fastcall deflateSetDictionary(TZStreamRec &strm, const char * dictionary, unsigned dictLength);
extern PACKAGE int __fastcall deflateReset(TZStreamRec &strm);
extern PACKAGE int __fastcall deflateSetHeader(TZStreamRec &strm, TgzHeaderRec &head);
extern PACKAGE int __fastcall deflatePrime(TZStreamRec &strm, int bits, int value);
extern PACKAGE int __fastcall deflateParams(TZStreamRec &strm, int level, int strategy);
extern PACKAGE int __fastcall deflateTune(TZStreamRec &strm, int good_length, int max_lazy, int nice_length, int max_chain);
extern PACKAGE unsigned __fastcall deflateBound(TZStreamRec &strm, unsigned sourceLen);
extern PACKAGE int __fastcall deflate(TZStreamRec &strm, int flush);
extern PACKAGE int __fastcall deflateEnd(TZStreamRec &strm);
extern PACKAGE int __fastcall deflateCopy(TZStreamRec &dest, TZStreamRec &source);
extern PACKAGE int __fastcall inflateBackInit_(TZStreamRec &strm, int windowBits, char * window, char * version, int recsize);
extern PACKAGE int __fastcall inflateBack(TZStreamRec &strm, TInFunc in_fn, void * in_desc, TOutFunc fn_out, void * out_desc);
extern PACKAGE int __fastcall inflateBackEnd(TZStreamRec &strm);
extern PACKAGE int __fastcall inflateReset(TZStreamRec &strm);
extern PACKAGE int __fastcall inflatePrime(TZStreamRec &strm, int bits, int value);
extern PACKAGE int __fastcall inflateInit2_(TZStreamRec &strm, int windowBits, char * version, int recsize);
extern PACKAGE int __fastcall inflateInit_(TZStreamRec &strm, char * version, int recsize);
extern PACKAGE int __fastcall inflate(TZStreamRec &strm, int flush);
extern PACKAGE int __fastcall inflateEnd(TZStreamRec &strm);
extern PACKAGE int __fastcall inflateSetDictionary(TZStreamRec &strm, const char * dictionary, unsigned dictLength);
extern PACKAGE int __fastcall inflateGetHeader(TZStreamRec &strm, TgzHeaderRec &head);
extern PACKAGE int __fastcall inflateSync(TZStreamRec &strm);
extern PACKAGE int __fastcall inflateSyncPoint(TZStreamRec &z);
extern PACKAGE int __fastcall inflateCopy(TZStreamRec &dest, TZStreamRec &source);
extern PACKAGE int __fastcall uncompress(char * dest, unsigned &destLen, const char * source, unsigned sourceLen);
extern PACKAGE unsigned __fastcall zlibCompileFlags(void);
extern PACKAGE char * __fastcall zError(int err);

}	/* namespace Idzlib */
using namespace Idzlib;
#pragma pack(pop)
#pragma option pop

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// Idzlib
