// Borland C++ Builder
// Copyright (c) 1995, 1999 by Borland International
// All rights reserved

// (DO NOT EDIT: machine generated header) 'zlibpas_sg.pas' rev: 5.00

#ifndef zlibpas_sgHPP
#define zlibpas_sgHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

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

namespace Zlibpas_sg
{
//-- type declarations -------------------------------------------------------
typedef Byte Bytef;

typedef Byte charf;

typedef int int;

typedef int intf;

typedef unsigned uInt;

typedef unsigned uIntf;

typedef int Long;

typedef int uLong;

typedef int uLongf;

typedef void *voidp;

typedef void *voidpf;

typedef Byte *pBytef;

typedef int *pIntf;

typedef unsigned *puIntf;

typedef int *puLong;

typedef unsigned ptr2int;

typedef Byte zByteArray[2147483647];

typedef Byte *pzByteArray;

typedef int zIntfArray[536870911];

typedef int *pzIntfArray;

typedef unsigned zuIntArray[536870911];

typedef unsigned *PuIntArray;

typedef Byte uch;

typedef Byte uchf;

typedef Word ush;

typedef Word ushf;

typedef int ulg;

typedef unsigned unsigned;

typedef Byte *pcharf;

typedef Byte *puchf;

typedef Word *pushf;

typedef Byte zuchfArray[2147483647];

typedef Byte *puchfArray;

typedef Word zushfArray[1073741823];

typedef Word *pushfArray;

struct inflate_huft
{
	Byte Exop;
	Byte bits;
	unsigned base;
} ;

typedef inflate_huft *pInflate_huft;

typedef inflate_huft huft_field[268435455];

typedef inflate_huft *huft_ptr;

typedef pInflate_huft *ppInflate_huft;

#pragma option push -b-
enum inflate_codes_mode { START, LEN, LENEXT, DIST, DISTEXT, COPY, LIT, WASH, ZEND, BADCODE };
#pragma option pop

struct inflate_codes_state;
typedef inflate_codes_state *pInflate_codes_state;

struct zlibpas_sg__2
{
	inflate_huft *tree;
	unsigned need;
} ;

struct zlibpas_sg__3
{
	unsigned get;
	unsigned dist;
} ;

struct zlibpas_sg__1
{
	
	union
	{
		struct 
		{
			zlibpas_sg__3 copy;
			
		};
		struct 
		{
			unsigned lit;
			
		};
		struct 
		{
			zlibpas_sg__2 code;
			
		};
		
	};
} ;

struct inflate_codes_state
{
	inflate_codes_mode mode;
	unsigned len;
	zlibpas_sg__1 sub;
	Byte lbits;
	Byte dbits;
	inflate_huft *ltree;
	inflate_huft *dtree;
} ;

typedef int __fastcall (*check_func)(int check, pBytef buf, unsigned len);

#pragma option push -b-
enum inflate_block_mode { ZTYPE, LENS, STORED, TABLE, BTREE, DTREE, CODES, DRY, BLKDONE, BLKBAD };
#pragma option pop

struct inflate_blocks_state;
typedef inflate_blocks_state *pInflate_blocks_state;

struct zlibpas_sg__5
{
	unsigned table;
	unsigned index;
	unsigned *blens;
	unsigned bb;
	inflate_huft *tb;
} ;

struct zlibpas_sg__6
{
	inflate_huft *tl;
	inflate_huft *td;
	inflate_codes_state *codes;
} ;

struct zlibpas_sg__4
{
	
	union
	{
		struct 
		{
			zlibpas_sg__6 decode;
			
		};
		struct 
		{
			zlibpas_sg__5 trees;
			
		};
		struct 
		{
			unsigned left;
			
		};
		
	};
} ;

struct inflate_blocks_state
{
	inflate_block_mode mode;
	zlibpas_sg__4 sub;
	bool last;
	unsigned bitk;
	int bitb;
	inflate_huft *hufts;
	Byte *window;
	Byte *zend;
	Byte *read;
	Byte *write;
	check_func checkfn;
	int check;
} ;

#pragma option push -b-
enum inflate_mode { METHOD, FLAG, DICT4, DICT3, DICT2, DICT1, DICT0, BLOCKS, CHECK4, CHECK3, CHECK2, 
	CHECK1, DONE, BAD };
#pragma option pop

struct internal_state;
typedef internal_state *pInternal_state;

struct zlibpas_sg__8
{
	int was;
	int need;
} ;

struct zlibpas_sg__7
{
	
	union
	{
		struct 
		{
			unsigned marker;
			
		};
		struct 
		{
			zlibpas_sg__8 check;
			
		};
		struct 
		{
			unsigned method;
			
		};
		
	};
} ;

struct internal_state
{
	inflate_mode mode;
	zlibpas_sg__7 sub;
	bool nowrap;
	unsigned wbits;
	inflate_blocks_state *blocks;
} ;

typedef void * __fastcall (*alloc_func)(void * opaque, unsigned items, unsigned size);

typedef void __fastcall (*free_func)(void * opaque, void * address);

struct z_stream;
typedef z_stream *z_streamp;

struct z_stream
{
	Byte *next_in;
	unsigned avail_in;
	int total_in;
	Byte *next_out;
	unsigned avail_out;
	int total_out;
	System::SmallString<255>  msg;
	internal_state *state;
	alloc_func zalloc;
	free_func zfree;
	void *opaque;
	int data_type;
	int adler;
	int reserved;
} ;

//-- var, const, procedure ---------------------------------------------------
static const int MaxMemBlock = 0x7fffffff;
static const Shortint MAX_MEM_LEVEL = 0x9;
static const Shortint DEF_MEM_LEVEL = 0x8;
static const Shortint MAX_WBITS = 0xf;
static const Shortint DEF_WBITS = 0xf;
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_OK = 0x0;
static const Shortint Z_STREAM_END = 0x1;
static const Shortint Z_NEED_DICT = 0x2;
static const Shortint Z_ERRNO = 0xffffffff;
static const Shortint Z_STREAM_ERROR = 0xfffffffe;
static const Shortint Z_DATA_ERROR = 0xfffffffd;
static const Shortint Z_MEM_ERROR = 0xfffffffc;
static const Shortint Z_BUF_ERROR = 0xfffffffb;
static const Shortint Z_VERSION_ERROR = 0xfffffffa;
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 = 0xffffffff;
static const Shortint Z_FILTERED = 0x1;
static const Shortint Z_HUFFMAN_ONLY = 0x2;
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;
#define Z_NULL (void *)(0x0)
static const Shortint STORED_BLOCK = 0x0;
static const Shortint STATIC_TREES = 0x1;
static const Shortint DYN_TREES = 0x2;
static const Shortint MIN_MATCH = 0x3;
static const Word MAX_MATCH = 0x102;
static const Shortint PRESET_DICT = 0x20;
extern PACKAGE System::SmallString<10>  ZLIB_VERSION;
static const Shortint z_errbase = 0x2;
extern PACKAGE System::SmallString<21>  z_errmsg[10];
extern PACKAGE int z_verbose;
#define inflate_copyright "inflate 1.1.2 Copyright 1995-1998 Mark Adler"
extern PACKAGE AnsiString __fastcall zError(int err);
extern PACKAGE AnsiString __fastcall zlibVersion(void);
extern PACKAGE void __fastcall Trace(AnsiString x);
extern PACKAGE void __fastcall Tracev(AnsiString x);
extern PACKAGE void __fastcall Tracevv(AnsiString x);
extern PACKAGE void __fastcall Tracevvv(AnsiString x);
extern PACKAGE void __fastcall Tracec(bool c, AnsiString x);
extern PACKAGE void __fastcall Tracecv(bool c, AnsiString x);
extern PACKAGE void * __fastcall ZALLOC(z_stream &strm, unsigned items, unsigned size);
extern PACKAGE void __fastcall ZFREE(z_stream &strm, void * ptr);
extern PACKAGE void __fastcall TRY_FREE(z_stream &strm, void * ptr);
extern PACKAGE int __fastcall crc32(int crc, pBytef buf, unsigned len);
extern PACKAGE int __fastcall inflateReset(z_stream &z);
extern PACKAGE int __fastcall inflateEnd(z_stream &z);
extern PACKAGE int __fastcall inflateInit2_(z_stream &z, int w, const AnsiString version, int stream_size
	);
extern PACKAGE int __fastcall inflateInit2(z_stream &z, int windowBits);
extern PACKAGE int __fastcall inflateInit(z_stream &z);
extern PACKAGE int __fastcall inflateInit_(z_streamp z, const AnsiString version, int stream_size);
extern PACKAGE int __fastcall inflate(z_stream &z, int f);
extern PACKAGE int __fastcall inflateSetDictionary(z_stream &z, pBytef dictionary, unsigned dictLength
	);
extern PACKAGE int __fastcall inflateSync(z_stream &z);
extern PACKAGE int __fastcall inflateSyncPoint(z_stream &z);
extern PACKAGE int __fastcall deflateInit2(z_stream &strm, int level, int method, int windowBits, int 
	memLevel, int strategy);
extern PACKAGE int __fastcall deflateInit_(z_streamp strm, int level, const AnsiString version, int 
	stream_size);
extern PACKAGE int __fastcall deflateInit(z_stream &strm, int level);
extern PACKAGE int __fastcall deflateSetDictionary(z_stream &strm, pBytef dictionary, unsigned dictLength
	);
extern PACKAGE int __fastcall deflateReset(z_stream &strm);
extern PACKAGE int __fastcall deflateParams(z_stream &strm, int level, int strategy);
extern PACKAGE int __fastcall deflate(z_stream &strm, int flush);
extern PACKAGE int __fastcall deflateEnd(z_stream &strm);
extern PACKAGE int __fastcall deflateCopy(z_streamp dest, z_streamp source);

}	/* namespace Zlibpas_sg */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Zlibpas_sg;
#endif
#pragma option pop	// -w-
#pragma option pop	// -Vx

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