// CodeGear C++Builder
// Copyright (c) 1995, 2011 by Embarcadero Technologies, Inc.
// All rights reserved

// (DO NOT EDIT: machine generated header) 'LiteStaticUni.pas' rev: 23.00 (Win32)

#ifndef LitestaticuniHPP
#define LitestaticuniHPP

#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 <Winapi.Windows.hpp>	// Pascal unit
#include <System.Win.Crtl.hpp>	// Pascal unit
#include <System.SysUtils.hpp>	// Pascal unit
#include <CLRClasses.hpp>	// Pascal unit
#include <CRTypes.hpp>	// Pascal unit
#include <CRFunctions.hpp>	// Pascal unit
#include <CREncryption.hpp>	// Pascal unit
#include <MemData.hpp>	// Pascal unit
#include <MemUtils.hpp>	// Pascal unit
#include <System.SyncObjs.hpp>	// Pascal unit
#include <LiteCallUni.hpp>	// Pascal unit

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

namespace Litestaticuni
{
//-- type declarations -------------------------------------------------------
typedef unsigned u32;

typedef int time_t;

typedef unsigned size_t;

typedef int __cdecl (*qsort_callback)(void * p1, void * p2);

typedef void * pSQLite3Pager;

typedef void * pSQLite3BTree;

struct tm;
typedef tm *ptm;

#pragma pack(push,1)
struct DECLSPEC_DRECORD tm
{
	
public:
	int tm_sec;
	int tm_min;
	int tm_hour;
	int tm_mday;
	int tm_mon;
	int tm_year;
	int tm_wday;
	int tm_yday;
	int tm_isdst;
};
#pragma pack(pop)


struct TSQLite3Backend;
typedef TSQLite3Backend *pSQLite3Backend;

struct DECLSPEC_DRECORD TSQLite3Backend
{
	
public:
	char *zName;
	void *pBt;
	System::Byte inTrans;
	System::Byte safety_level;
	void *pSchema;
};


typedef System::DynamicArray<pSQLite3Backend> TSQLite3BackendArray;

typedef TSQLite3BackendArray *pSQLite3BackendArray;

struct DECLSPEC_DRECORD TSQLite3
{
	
public:
	void *pVfs;
	void *pVdbe;
	void *pDfltColl;
	void *mutex;
	TSQLite3BackendArray aDb;
	int nDb;
};


class DELPHICLASS TSQLiteCodec;
#pragma pack(push,4)
class PASCALIMPLEMENTATION TSQLiteCodec : public System::TObject
{
	typedef System::TObject inherited;
	
private:
	int FBufferSize;
	void *FBuffer;
	Crencryption::TCREncryptor* FReadCipher;
	Crencryption::TCREncryptor* FWriteCipher;
	System::AnsiString FReadEncryptionKey;
	System::AnsiString FWriteEncryptionKey;
	Crencryption::TCREncryptionAlgorithm FEncryptionAlgorithm;
	void __fastcall SetBufferSize(int Value);
	void __fastcall SetReadEncryptionKey(System::AnsiString Value);
	void __fastcall SetWriteEncryptionKey(System::AnsiString Value);
	
public:
	__fastcall TSQLiteCodec(System::AnsiString ReadKey, System::AnsiString WriteKey, Crencryption::TCREncryptionAlgorithm Algorithm);
	__fastcall virtual ~TSQLiteCodec(void);
	__property Crencryption::TCREncryptionAlgorithm EncryptionAlgorithm = {read=FEncryptionAlgorithm, nodefault};
	__property System::AnsiString ReadEncryptionKey = {read=FReadEncryptionKey, write=SetReadEncryptionKey};
	__property System::AnsiString WriteEncryptionKey = {read=FWriteEncryptionKey, write=SetWriteEncryptionKey};
	__property Crencryption::TCREncryptor* ReadCipher = {read=FReadCipher};
	__property Crencryption::TCREncryptor* WriteCipher = {read=FWriteCipher};
	__property void * Buffer = {read=FBuffer};
	__property int BufferSize = {read=FBufferSize, write=SetBufferSize, nodefault};
};

#pragma pack(pop)

//-- var, const, procedure ---------------------------------------------------
extern PACKAGE int _fltused;
static const System::Int8 SQLITE_FILE_HEADER_SIZE = System::Int8(0x10);
extern PACKAGE System::Word __turbofloat;
extern PACKAGE System::Syncobjs::TCriticalSection* SQLiteCodecSection;
extern PACKAGE int __fastcall NoStaticEncryption(void);
extern PACKAGE void __fastcall InitStaticFunction(const Litecalluni::TSQLite3API* API);
extern PACKAGE __int64 __cdecl _ftol(void);
extern PACKAGE unsigned __int64 __cdecl _ftoul(void);
extern PACKAGE void * __cdecl malloc(unsigned size);
extern PACKAGE void __cdecl free(void * pmem);
extern PACKAGE void * __cdecl realloc(void * pmem, unsigned size);
extern PACKAGE void * __cdecl memset(void * pmem, int value, unsigned size);
extern PACKAGE void __cdecl memmove(void * dest, void * source, unsigned size);
extern PACKAGE void __cdecl memcpy(void * dest, void * source, unsigned size);
extern PACKAGE int __cdecl memcmp(void * p1, void * p2, unsigned size);
extern PACKAGE void __fastcall _lldiv(void);
extern PACKAGE void __fastcall _lludiv(void);
extern PACKAGE void __fastcall _llmod(void);
extern PACKAGE void __fastcall _llmul(void);
extern PACKAGE void __fastcall _llumod(void);
extern PACKAGE void __fastcall _llshl(void);
extern PACKAGE void __fastcall _llshr(void);
extern PACKAGE void __fastcall _llushr(void);
extern PACKAGE int __cdecl strncmp(System::PByte p1, System::PByte p2, unsigned size);
extern PACKAGE int __cdecl strcmp(System::PByte p1, System::PByte p2);
extern PACKAGE ptm __cdecl localtime(void * timer);
extern PACKAGE void __cdecl qsort(System::PByte base, unsigned num, unsigned width, qsort_callback compare);
extern PACKAGE int __cdecl sqlite3_key(void * pSQLite, char * key, int size);
extern PACKAGE int __cdecl sqlite3_key_v2(void * pSQLite, char * dbName, char * key, int size);
extern PACKAGE int __cdecl sqlite3_rekey(void * pSQLite, char * newkey, int size);
extern PACKAGE int __cdecl sqlite3_rekey_v2(void * pSQLite, char * dbName, char * newkey, int size);
extern PACKAGE int __cdecl sqlite3CodecAttach(void * pSQLite, int nDb, char * key, int size, Litecalluni::TLiteEncryptionAlgorithm Algorithm = (Litecalluni::TLiteEncryptionAlgorithm)(0x7))/* overload */;
extern PACKAGE void __cdecl sqlite3CodecGetKey(void * pSQLite, int nDb, void * &key, PINT &size);
extern PACKAGE void __cdecl sqlite3_activate_see(char * zPassPhrase);
extern PACKAGE void __fastcall Sqlite3CodecSetKey(void * pSQLite, int nDb, char * key, bool is_read, Litecalluni::TLiteEncryptionAlgorithm Algorithm = (Litecalluni::TLiteEncryptionAlgorithm)(0x7));
extern PACKAGE TSQLiteCodec* __fastcall Sqlite3GetCodec(void * pSQLite, int nDb);
extern PACKAGE int __cdecl sqlite3_enable_shared_cache(int Value);
extern PACKAGE int __cdecl sqlite3_finalize(void * pStmt);
extern PACKAGE int __cdecl sqlite3_reset(void * pStmt);
extern PACKAGE void * __cdecl sqlite3_value_blob(void * pValue);
extern PACKAGE int __cdecl sqlite3_value_bytes(void * pValue);
extern PACKAGE int __cdecl sqlite3_value_bytes16(void * pValue);
extern PACKAGE double __cdecl sqlite3_value_double(void * pValue);
extern PACKAGE int __cdecl sqlite3_value_int(void * pValue);
extern PACKAGE __int64 __cdecl sqlite3_value_int64(void * pValue);
extern PACKAGE void * __cdecl sqlite3_value_text(void * pValue);
extern PACKAGE void * __cdecl sqlite3_value_text16(void * pValue);
extern PACKAGE int __cdecl sqlite3_value_type(void * pValue);
extern PACKAGE void __cdecl sqlite3_result_blob(Litecalluni::pSQLite3Context pContext, void * pBlob, int Size, void * pDestrType);
extern PACKAGE void __cdecl sqlite3_result_double(Litecalluni::pSQLite3Context pContext, double Value);
extern PACKAGE void __cdecl sqlite3_result_error(Litecalluni::pSQLite3Context pContext, void * pMsg, int Size);
extern PACKAGE void __cdecl sqlite3_result_error16(Litecalluni::pSQLite3Context pContext, void * pMsg, int Size);
extern PACKAGE void __cdecl sqlite3_result_int(Litecalluni::pSQLite3Context pContext, int Value);
extern PACKAGE void __cdecl sqlite3_result_int64(Litecalluni::pSQLite3Context pContext, __int64 Value);
extern PACKAGE void __cdecl sqlite3_result_null(Litecalluni::pSQLite3Context pContext);
extern PACKAGE void __cdecl sqlite3_result_text(Litecalluni::pSQLite3Context pContext, void * pStr, int Size, void * pDestrType);
extern PACKAGE void __cdecl sqlite3_result_text16(Litecalluni::pSQLite3Context pContext, void * pStr, int Size, void * pDestrType);
extern PACKAGE void __cdecl sqlite3_result_text16be(Litecalluni::pSQLite3Context pContext, void * pStr, int Size, void * pDestrType);
extern PACKAGE void __cdecl sqlite3_result_text16le(Litecalluni::pSQLite3Context pContext, void * pStr, int Size, void * pDestrType);
extern PACKAGE void __cdecl sqlite3_result_value(Litecalluni::pSQLite3Context pContext, void * Value);
extern PACKAGE void __cdecl sqlite3_result_zeroblob(Litecalluni::pSQLite3Context pContext, int Size);
extern PACKAGE void __cdecl sqlite3_result_error_code(Litecalluni::pSQLite3Context pContext, int ErrorCode);
extern PACKAGE void __cdecl sqlite3_result_error_toobig(Litecalluni::pSQLite3Context pContext);
extern PACKAGE void __cdecl sqlite3_result_error_nomem(Litecalluni::pSQLite3Context pContext);
extern PACKAGE int __cdecl sqlite3_step(void * pStmt);
extern PACKAGE void * __cdecl sqlite3_user_data(Litecalluni::pSQLite3Context pContext);
extern PACKAGE int __cdecl sqlite3_column_count(void * pStmt);
extern PACKAGE void * __cdecl sqlite3_column_blob(void * pStmt, int iCol);
extern PACKAGE int __cdecl sqlite3_column_bytes(void * pStmt, int iCol);
extern PACKAGE double __cdecl sqlite3_column_double(void * pStmt, int iCol);
extern PACKAGE int __cdecl sqlite3_column_int(void * pStmt, int iCol);
extern PACKAGE __int64 __cdecl sqlite3_column_int64(void * pStmt, int iCol);
extern PACKAGE char * __cdecl sqlite3_column_text(void * pStmt, int iCol);
extern PACKAGE int __cdecl sqlite3_column_type(void * pStmt, int iCol);
extern PACKAGE char * __cdecl sqlite3_column_name(void * pStmt, int iCol);
extern PACKAGE char * __cdecl sqlite3_column_decltype(void * pStmt, int iCol);
extern PACKAGE char * __cdecl sqlite3_column_database_name(void * pStmt, int iCol);
extern PACKAGE char * __cdecl sqlite3_column_table_name(void * pStmt, int iCol);
extern PACKAGE char * __cdecl sqlite3_column_origin_name(void * pStmt, int iCol);
extern PACKAGE int __cdecl sqlite3_bind_blob(void * pStmt, int index, void * value, int size, void * destr);
extern PACKAGE int __cdecl sqlite3_bind_double(void * pStmt, int index, double value);
extern PACKAGE int __cdecl sqlite3_bind_int(void * pStmt, int index, int value);
extern PACKAGE int __cdecl sqlite3_bind_int64(void * pStmt, int index, __int64 value);
extern PACKAGE int __cdecl sqlite3_bind_null(void * pStmt, int index);
extern PACKAGE int __cdecl sqlite3_bind_text(void * pStmt, int index, char * value, int size, void * destr);
extern PACKAGE int __cdecl sqlite3_bind_parameter_count(void * pStmt);
extern PACKAGE int __cdecl sqlite3_enable_load_extension(void * pSQLite, int OnOff);
extern PACKAGE int __cdecl sqlite3_prepare_v2(void * db, char * zSql, int nByte, /* out */ void * &ppStmt, /* out */ void * &pzTail);
extern PACKAGE char * __cdecl sqlite3_libversion(void);
extern PACKAGE int __cdecl sqlite3_libversion_number(void);
extern PACKAGE __int64 __cdecl sqlite3_last_insert_rowid(void * pDb);
extern PACKAGE int __cdecl sqlite3_changes(void * pDb);
extern PACKAGE int __cdecl sqlite3_close(void * pDb);
extern PACKAGE int __cdecl sqlite3_busy_handler(void * pSQLite, void * func, void * userData);
extern PACKAGE int __cdecl sqlite3_busy_timeout(void * pSQLite, int MilliSeconds);
extern PACKAGE int __cdecl sqlite3_create_function(void * pSQLite, char * zFunctionName, int nArg, int eTextRep, void * pApp, void * xFunc, void * xStep, void * xFinal);
extern PACKAGE int __cdecl sqlite3_create_function16(void * pSQLite, System::WideChar * zFunctionName, int nArg, int eTextRep, void * pApp, void * xFunc, void * xStep, void * xFinal);
extern PACKAGE char * __cdecl sqlite3_errmsg(void * pDb);
extern PACKAGE int __cdecl sqlite3_errcode(void * pDb);
extern PACKAGE int __cdecl sqlite3_extended_errcode(void * pDb);
extern PACKAGE int __cdecl sqlite3_open(char * filename, /* out */ void * &ppDb);
extern PACKAGE int __cdecl sqlite3_open_v2(char * filename, /* out */ void * &ppDb, int flags, char * zVfs);
extern PACKAGE int __cdecl sqlite3_open16(System::WideChar * filename, /* out */ void * &ppDb);
extern PACKAGE int __cdecl sqlite3_create_collation(void * pSQLite, char * zName, int eTextRep, void * userData, void * func);
extern PACKAGE int __cdecl sqlite3_create_collation16(void * pSQLite, System::WideChar * zName, int eTextRep, void * userData, void * func);
extern PACKAGE int __cdecl sqlite3_table_column_metadata(void * pDb, char * zDbName, char * zTableName, char * zColumnName, /* out */ void * &pzDataType, /* out */ void * &pzCollSeq, /* out */ int &pNotNull, /* out */ int &pPrimaryKey, /* out */ int &pAutoinc);
extern PACKAGE int __cdecl sqlite3_extended_result_codes(void * pDb, int onoff);
extern PACKAGE pSQLite3Backend __cdecl lite_sqlite3GetBackend(void * pSQLite, int nDb);
extern PACKAGE void * __cdecl lite_sqlite3GetBtreePager(void * pBTree);
extern PACKAGE int __cdecl lite_sqlite3BtreeGetPageSize(void * pBTree);
extern PACKAGE int __cdecl lite_sqlite3BtreeBeginTrans(void * pBTree, int wrflag);
extern PACKAGE void * __cdecl lite_sqlite3PagerGetCodec(void * pPager);
extern PACKAGE void __cdecl lite_sqlite3PagerSetCodec(void * pPager, void * xCodec, void * xCodecSizeChng, void * xCodecFree, void * pCodec);
extern PACKAGE void __cdecl lite_sqlite3PagerPagecount(void * pPager, Crtypes::PInteger pnPage);
extern PACKAGE int __cdecl lite_sqlite3PagerIsMjPgno(void * pPager, unsigned pgno);
extern PACKAGE int __cdecl lite_sqlite3PagerGet(void * pPager, unsigned pgno, void * ppPage);
extern PACKAGE int __cdecl lite_sqlite3PagerWrite(void * pDbPage);
extern PACKAGE void __cdecl lite_sqlite3PagerUnref(void * pPg);
extern PACKAGE int __cdecl lite_sqlite3BtreeCommit(void * pBTree);
extern PACKAGE int __cdecl lite_sqlite3BtreeRollback(void * pBTree, int tripCode);

}	/* namespace Litestaticuni */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_LITESTATICUNI)
using namespace Litestaticuni;
#endif
#pragma pack(pop)
#pragma option pop

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