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

// (DO NOT EDIT: machine generated header) 'ABSTypes.pas' rev: 35.00 (Windows)

#ifndef AbstypesHPP
#define AbstypesHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member 
#pragma pack(push,8)
#include <System.hpp>
#include <SysInit.hpp>
#include <System.SysUtils.hpp>
#include <System.Classes.hpp>
#include <Winapi.Windows.hpp>
#include <ABSMemory.hpp>
#include <ABSConst.hpp>
#include <ABSExcept.hpp>

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

namespace Abstypes
{
//-- forward type declarations -----------------------------------------------
struct TABSPageItemID;
struct TGraphicHeader;
struct TABSDBHeader;
struct TABSCryptoHeader;
struct TABSLockedBytes;
struct TABSDiskPageHeader;
struct TABSListHeader;
struct TABSInternalFileHeader;
struct TABSSystemDirectoryListItem;
struct TABSTableListItem;
struct TABSTablePFSPageMapItem;
struct TABSLockParams;
struct TABSMemoryTableFileHeader;
struct TABSBookmarkInfo;
struct TABSTimeoutParams;
struct TABSKeyBuffer;
struct TABSNavigationInfo;
class DELPHICLASS TABSIndexPositionCache;
class DELPHICLASS TABSScanSearchCondition;
struct TABSExtractedConditionInfo;
class DELPHICLASS TABSScanSearchConditionArray;
struct TABSSortSpecification;
struct TABSDateTime;
class DELPHICLASS TABSIntegerArray;
class DELPHICLASS TABSSortedStringPtrArray;
struct TABSBLOBDescriptor;
struct TABSPartialBLOBDescriptor;
struct TABSPartialTemporaryBLOBDescriptor;
struct TABSCompressedStreamBlockHeader;
class DELPHICLASS TABSCompressedStreamBlockHeadersArray;
struct TABSDiskBLOBCache;
struct TABSDiskBLOBHeader;
struct TABSPageListLink;
class DELPHICLASS TABSBitsArray;
//-- type declarations -------------------------------------------------------
typedef System::PByte TAbsPByte;

typedef char * TAbsPChar;

typedef int TABSErrorCode;

typedef int TABSPageNo;

typedef int *PABSPageNo;

typedef System::PByte TABSPageBuffer;

enum DECLSPEC_DENUM TABSGetRecordMode : unsigned char { grmCurrent, grmNext, grmPrior };

enum DECLSPEC_DENUM TABSGetRecordResult : unsigned char { grrOK, grrBOF, grrEOF, grrError };

enum DECLSPEC_DENUM TABSBLOBOpenMode : unsigned char { bomWrite, bomRead, bomReadWrite };

typedef System::PByte TABSRecordBuffer;

typedef int TABSState;

typedef int TABSObjectID;

typedef int TABSTableID;

typedef System::ShortString TABSObjectName;

typedef int TABSSessionID;

typedef __int64 TABSRecordNo;

#pragma pack(push,1)
struct DECLSPEC_DRECORD TABSPageItemID
{
public:
	int PageNo;
	System::Word PageItemNo;
};
#pragma pack(pop)


typedef TABSPageItemID *PABSPageItemID;

typedef TABSPageItemID TABSRecordID;

typedef TABSPageItemID *PABSRecordID;

struct DECLSPEC_DRECORD TGraphicHeader
{
public:
	System::Word Count;
	System::Word HType;
	int Size;
};


typedef System::Word TABSPageRecordCount;

typedef System::Word *PABSPageRecordCount;

enum DECLSPEC_DENUM TABSDBFileType : unsigned char { dbftUnknown, dbftTablesList, dbftActiveSessionsList };

enum DECLSPEC_DENUM TABSLockType : unsigned char { ltIS, ltS, ltSIRW, ltXIRW, ltRW, ltU, ltX };

enum DECLSPEC_DENUM TABSLockObjectType : unsigned char { lotDatabase, lotTable, lotRecord };

enum DECLSPEC_DENUM TABSTablePageType : unsigned char { tptRowStart, tptRowContinue, tptVarchar, tptBLOB };

typedef TABSDBHeader *PABSDBHeader;

#pragma pack(push,1)
struct DECLSPEC_DRECORD TABSDBHeader
{
public:
	System::StaticArray<char, 16> Signature;
	short HeaderSize;
	double Version;
	System::Word PageSize;
	System::Word PageCountInExtent;
	int TotalPageCount;
	int LastUsedPageNo;
	int State;
	System::Byte WriteChangesState;
	System::ByteBool Encrypted;
	System::StaticArray<System::Byte, 32> Reserved;
};
#pragma pack(pop)


#pragma pack(push,1)
struct DECLSPEC_DRECORD TABSCryptoHeader
{
public:
	short CryptoHeaderSize;
	System::Byte CryptoAlgorithm;
	System::Byte CryptoMode;
	System::StaticArray<System::Byte, 256> ControlBlock;
	unsigned ControlBlockCRC;
	System::StaticArray<System::Byte, 16> Reserverd;
};
#pragma pack(pop)


#pragma pack(push,1)
struct DECLSPEC_DRECORD TABSLockedBytes
{
public:
	short LockedByteSize;
	System::Byte FSMByte;
	System::Byte TablesByte;
	System::Byte DBHeaderByte;
	System::StaticArray<System::Byte, 15> Reserved;
};
#pragma pack(pop)


typedef int TABSLastObjectID;

typedef System::Word TABSPageTypeID;

#pragma pack(push,1)
struct DECLSPEC_DRECORD TABSDiskPageHeader
{
public:
	System::StaticArray<char, 4> Signature;
	int State;
	System::Word PageType;
	int NextPageNo;
	unsigned CRC32;
	System::Byte CRCType;
	System::Byte HashType;
	System::Byte Cipherype;
	System::Byte MACType;
	int ObjectID;
	TABSPageItemID RecordID;
	System::StaticArray<System::Byte, 8> Reserved;
};
#pragma pack(pop)


typedef TABSDiskPageHeader *PABSDiskPageHeader;

enum DECLSPEC_DENUM TABSShareMode : unsigned char { smExclusive, smShareDenyNone, smShareDenyWrite };

enum DECLSPEC_DENUM TABSAccessMode : unsigned char { amReadOnly, amReadWrite };

typedef TABSListHeader *PABSListHeader;

#pragma pack(push,1)
struct DECLSPEC_DRECORD TABSListHeader
{
public:
	int Count;
	int ItemSize;
	int NextPageNo;
};
#pragma pack(pop)


typedef TABSInternalFileHeader *PABSInternalFileHeader;

#pragma pack(push,1)
struct DECLSPEC_DRECORD TABSInternalFileHeader
{
public:
	System::Byte FileHeaderSize;
	int FileSize;
	int DecompressedSize;
	System::Byte CompressionAlgorithm;
};
#pragma pack(pop)


#pragma pack(push,1)
struct DECLSPEC_DRECORD TABSSystemDirectoryListItem
{
public:
	TABSDBFileType FileID;
	int FirstPageNo;
};
#pragma pack(pop)


typedef TABSTableListItem *PABSTableListItem;

#pragma pack(push,1)
struct DECLSPEC_DRECORD TABSTableListItem
{
public:
	System::ShortString TableName;
	int TableID;
	int MetaDataFilePageNo;
	int MostUpdatedFilePageNo;
	int LocksFilePageNo;
};
#pragma pack(pop)


#pragma pack(push,1)
struct DECLSPEC_DRECORD TABSTablePFSPageMapItem
{
public:
	int PageNo;
	System::Word PageRecordCount;
};
#pragma pack(pop)


struct DECLSPEC_DRECORD TABSLockParams
{
public:
	int SessionID;
	TABSLockType LockType;
	TABSLockObjectType ObjectType;
	TABSPageItemID RowID;
	int TableID;
};


enum DECLSPEC_DENUM TABSJoinType : unsigned char { ajtCross, ajtInner, ajtLeftOuter, ajtRightOuter, ajtFullOuter };

enum DECLSPEC_DENUM TABSUnionType : unsigned char { autUnion, autIntersect, autExcept };

enum DECLSPEC_DENUM TABSTableType : unsigned char { attTable, attJoinedTable, attSubQuery };

enum DECLSPEC_DENUM TABSQueryExprType : unsigned char { qetSelect, qetUnion, qetExcept, qetIntersect };

enum DECLSPEC_DENUM TABSBatchMoveType : unsigned char { bmtAppend, bmtAppendUpdate, bmtCopy, bmtDelete, bmtUpdate, bmtSynchronize };

enum DECLSPEC_DENUM TABSBaseFieldType : unsigned char { bftUnknown, bftChar, bftWideChar, bftVarchar, bftWideVarchar, bftSignedInt8, bftSignedInt16, bftSignedInt32, bftSignedInt64, bftUnsignedInt8, bftUnsignedInt16, bftUnsignedInt32, bftSingle, bftDouble, bftExtended, bftDate, bftTime, bftDateTime, bftBlob, bftClob, bftWideClob, bftLogical, bftCurrency, bftBytes, bftVarBytes, bftBFile };

enum DECLSPEC_DENUM TABSAdvancedFieldType : unsigned char { aftUnknown, aftChar, aftString, aftWideChar, aftWideString, aftShortint, aftSmallint, aftInteger, aftLargeint, aftByte, aftWord, aftCardinal, aftAutoInc, aftAutoIncShortint, aftAutoIncSmallint, aftAutoIncInteger, aftAutoIncLargeint, aftAutoIncByte, aftAutoIncWord, aftAutoIncCardinal, aftSingle, aftDouble, aftExtended, aftBoolean, aftCurrency, aftDate, aftTime, aftDateTime, aftTimeStamp, aftBytes, aftVarBytes, aftBlob, aftGraphic, aftMemo, aftFormattedMemo, aftWideMemo, aftGuid };

enum DECLSPEC_DENUM TABSConstraintType : unsigned char { ctPK, ctFK, ctUnique, ctNotNull, ctCheck };

enum DECLSPEC_DENUM TABSCompareResult : unsigned char { cmprEqual, cmprLower, cmprGreater, cmprLeftNull, cmprRightNull, cmprBothNull };

enum DECLSPEC_DENUM TABSDataOperator : unsigned char { doUNDEFINED, doEQ, doNE, doGT, doLT, doGE, doLE, doNOT, doAND, doOR, doIN, doNOTIN, doEXISTS, doBETWEEN, doNOTBETWEEN, doLIKE, doNOTLIKE, doISNULL, doISNOTNULL, doTRUE, doFALSE, doADD, doSUB, doMUL, doDIV, doCONCAT, doUPPER, doLOWER, doTRIM, doLTRIM, doRTRIM, doLENGTH, doPOS, doSUBSTRING, doSUM, doAVG, doMIN, doMAX, doCOUNT, doCOUNTALL, doSYSDATE, doCURRENT_DATE, doCURRENT_TIME, doTODATE, doTOSTRING, doEXTRACT, doCAST, doLASTAUTOINC, doMIMETOBIN, doROWNUM, doABS, doACOS, doASIN, doATAN, doCEIL, doCOS, doEXP, doFLOOR, doLOG, doPOWER, doRAND, doROUND, doSIGN, doSIN, doSQR, doSQRT };

#pragma pack(push,1)
struct DECLSPEC_DRECORD TABSMemoryTableFileHeader
{
public:
	System::StaticArray<char, 4> Signature;
	double Version;
	__int64 RecordCount;
	__int64 UncompressedSize;
	__int64 NumBlocks;
	int BlockSize;
	System::Byte CompressionAlgorithm;
	System::Byte CompressionMode;
	System::Byte NameLength;
};
#pragma pack(pop)


typedef System::TObject TABSIndexPosition;

typedef void * TABSSearchInfo;

enum DECLSPEC_DENUM TABSBookmarkFlag : unsigned char { abfCurrent, abfBOF, abfEOF, abfInserted };

#pragma pack(push,1)
struct DECLSPEC_DRECORD TABSBookmarkInfo
{
public:
	TABSPageItemID BookmarkData;
	TABSBookmarkFlag BookmarkFlag;
};
#pragma pack(pop)


typedef TABSBookmarkInfo *PABSBookmarkInfo;

typedef __int64 TABSSequenceValue;

struct DECLSPEC_DRECORD TABSTimeoutParams
{
public:
	System::Word RetryCount;
	int Timeout;
};


enum DECLSPEC_DENUM TABSKeyIndex : unsigned char { kiLookup, kiRangeStart, kiRangeEnd, kiCurRangeStart, kiCurRangeEnd, kiSave };

enum DECLSPEC_DENUM TABSSearchCondition : unsigned char { scNone, scEqual, scLower, scGreater, scLowerEqual, scGreaterEqual };

enum DECLSPEC_DENUM TABSKeySearchType : unsigned char { kstFirst, kstLast, kstAny };

typedef TABSKeyBuffer *PABSKeyBuffer;

#pragma pack(push,1)
struct DECLSPEC_DRECORD TABSKeyBuffer
{
public:
	bool Modified;
	bool Exclusive;
	int FieldCount;
};
#pragma pack(pop)


#pragma pack(push,1)
struct DECLSPEC_DRECORD TABSNavigationInfo
{
public:
	TABSGetRecordMode GetRecordMode;
	int IndexID;
	TABSPageItemID RecordID;
	System::Byte *RecordBuffer;
	bool FirstPosition;
	bool LastPosition;
	TABSGetRecordResult GetRecordResult;
};
#pragma pack(pop)


enum DECLSPEC_DENUM TABSDateTimeExtractField : unsigned char { dtefYear, dtefMonth, dtefDay, dtefHour, dtefMinute, dtefSecond };

class PASCALIMPLEMENTATION TABSIndexPositionCache : public System::TObject
{
	typedef System::TObject inherited;
	
public:
	void *Position;
	int IndexID;
	TABSPageItemID RecordID;
	int TableState;
	__fastcall TABSIndexPositionCache();
	__fastcall virtual ~TABSIndexPositionCache();
};


class PASCALIMPLEMENTATION TABSScanSearchCondition : public System::TObject
{
	typedef System::TObject inherited;
	
public:
	void *Expression;
	TABSSearchCondition Condition;
	System::Byte *KeyRecordBuffer;
	int KeyRecordBufferSize;
	int KeyFieldCount;
	int IndexID;
	bool CreatedFromExpression;
	System::Classes::TList* ParentExpressions;
	System::Classes::TList* ParentExpressionNodes;
	bool FExternalKeyRecordBuffer;
	bool PartialCompare;
	void __fastcall ClearKeyRecordBuffer();
	__fastcall TABSScanSearchCondition(bool ExternalKeyRecordBuffer);
	__fastcall virtual ~TABSScanSearchCondition();
	void __fastcall Assign(TABSScanSearchCondition* ScanSearchCondition);
};


#pragma pack(push,1)
struct DECLSPEC_DRECORD TABSExtractedConditionInfo
{
public:
	System::Byte *KeyRecordBuffer;
	void *ExtractedExpressionNode;
	void *Expression;
};
#pragma pack(pop)


typedef TABSExtractedConditionInfo *PABSExtractedConditionInfo;

class PASCALIMPLEMENTATION TABSScanSearchConditionArray : public System::TObject
{
	typedef System::TObject inherited;
	
	
private:
	typedef System::DynamicArray<TABSScanSearchCondition*> _TABSScanSearchConditionArray__1;
	
	
public:
	_TABSScanSearchConditionArray__1 Items;
	int Count;
	__fastcall TABSScanSearchConditionArray();
	__fastcall virtual ~TABSScanSearchConditionArray();
	void __fastcall Delete(int ItemNo);
	void __fastcall AddExpression(void * Expression);
	void __fastcall AddCondition(TABSScanSearchCondition* ScanSearchCondition);
	
private:
	void __fastcall TryToExtendMultiFieldIndexCondition(int ConditionNo, void * IndexDef, System::Classes::TList* Expressions);
	
public:
	void __fastcall CreateIndexScanConditionsFromExpressions(void * IndexDefs, int SessionID);
	void __fastcall RemoveUnusedConditionsCreatedFromExpressions(int &ScanConditionNo, int &ScanEndConditionNo);
	void __fastcall ExtractChosenConditionsFromExpressions(int ScanConditionNo, int ScanEndConditionNo);
	void __fastcall ReturnExtractedConditionsToExpressions(int ScanConditionNo, int ScanEndConditionNo);
};


struct DECLSPEC_DRECORD TABSSortSpecification
{
public:
	System::AnsiString TableName;
	System::AnsiString ColumnName;
	bool Descending;
};


typedef int *PABSDate;

typedef int TABSDate;

typedef int *PABSTime;

typedef int TABSTime;

typedef TABSDateTime *PABSDateTime;

#pragma pack(push,1)
struct DECLSPEC_DRECORD TABSDateTime
{
public:
	int Date;
	int Time;
};
#pragma pack(pop)


typedef System::WordBool *PABSLogical;

typedef System::WordBool TABSLogical;

typedef double *PABSCurrency;

typedef double TABSCurrency;

typedef GUID *PABSGuid;

typedef GUID TABSGuid;

typedef TABSIntegerArray TABSPagesArray;;

class PASCALIMPLEMENTATION TABSIntegerArray : public System::TObject
{
	typedef System::TObject inherited;
	
	
private:
	typedef System::DynamicArray<int> _TABSIntegerArray__1;
	
	
public:
	_TABSIntegerArray__1 Items;
	int ItemCount;
	int AllocBy;
	int deAllocBy;
	int MaxAllocBy;
	int AllocItemCount;
	__fastcall TABSIntegerArray(int size, int DefaultAllocBy, int MaximumAllocBy);
	__fastcall virtual ~TABSIntegerArray();
	void __fastcall SetSize(int newSize);
	void __fastcall Assign(TABSIntegerArray* v);
	void __fastcall Append(int value);
	void __fastcall Insert(int ItemNo, int value);
	void __fastcall Delete(int ItemNo);
	void __fastcall MoveTo(int itemNo, int newItemNo);
	void __fastcall CopyTo(int *ar, const int ar_High, int itemNo, int iCount);
	bool __fastcall IsValueExists(int value);
	int __fastcall IndexOf(int value);
};


class PASCALIMPLEMENTATION TABSSortedStringPtrArray : public System::Classes::TList
{
	typedef System::Classes::TList inherited;
	
public:
	/* TList.Destroy */ inline __fastcall virtual ~TABSSortedStringPtrArray() { }
	
public:
	/* TObject.Create */ inline __fastcall TABSSortedStringPtrArray() : System::Classes::TList() { }
	
};


#pragma pack(push,1)
struct DECLSPEC_DRECORD TABSBLOBDescriptor
{
public:
	int BlockSize;
	__int64 NumBlocks;
	__int64 UncompressedSize;
	__int64 StartPosition;
	System::Byte CompressionAlgorithm;
	System::Byte CompressionMode;
	System::StaticArray<System::Byte, 2> Reserved;
};
#pragma pack(pop)


typedef TABSBLOBDescriptor *PABSBLOBDescriptor;

#pragma pack(push,1)
struct DECLSPEC_DRECORD TABSPartialBLOBDescriptor
{
public:
	int NumBlocks;
	__int64 UncompressedSize;
};
#pragma pack(pop)


typedef TABSPartialBLOBDescriptor *PABSPartialBLOBDescriptor;

#pragma pack(push,1)
struct DECLSPEC_DRECORD TABSPartialTemporaryBLOBDescriptor
{
public:
	int NumBlocks;
	__int64 UncompressedSize;
	__int64 CompressedSize;
};
#pragma pack(pop)


typedef TABSPartialTemporaryBLOBDescriptor *PABSPartialTemporaryBLOBDescriptor;

#pragma pack(push,1)
struct DECLSPEC_DRECORD TABSCompressedStreamBlockHeader
{
public:
	int CompressedSize;
	int UncompressedSize;
	unsigned Crc32;
	__int64 OffsetToNextHeader;
};
#pragma pack(pop)


class PASCALIMPLEMENTATION TABSCompressedStreamBlockHeadersArray : public System::TObject
{
	typedef System::TObject inherited;
	
	
private:
	typedef System::DynamicArray<TABSCompressedStreamBlockHeader> _TABSCompressedStreamBlockHeadersArray__1;
	
	typedef System::DynamicArray<__int64> _TABSCompressedStreamBlockHeadersArray__2;
	
	
private:
	__int64 AllocBy;
	__int64 DeAllocBy;
	__int64 MaxAllocBy;
	__int64 AllocItemCount;
	
public:
	_TABSCompressedStreamBlockHeadersArray__1 Items;
	_TABSCompressedStreamBlockHeadersArray__2 Positions;
	__int64 ItemCount;
	__fastcall TABSCompressedStreamBlockHeadersArray();
	__fastcall virtual ~TABSCompressedStreamBlockHeadersArray();
	void __fastcall SetSize(__int64 NewSize);
	void __fastcall AppendItem(const TABSCompressedStreamBlockHeader &Value, __int64 Pos);
	int __fastcall FindPosition(__int64 Pos);
};


#pragma pack(push,1)
struct DECLSPEC_DRECORD TABSDiskBLOBCache
{
public:
	int NumBlocks;
	__int64 UncompressedSize;
	bool Modified;
	System::Byte *BlobData;
};
#pragma pack(pop)


typedef TABSDiskBLOBCache *PABSDiskBLOBCache;

typedef PABSDiskBLOBCache *PPABSDiskBLOBCache;

#pragma pack(push,1)
struct DECLSPEC_DRECORD TABSDiskBLOBHeader
{
public:
	System::Word BlobID;
	int NumBlocks;
	__int64 CompressedSize;
	__int64 UncompressedSize;
};
#pragma pack(pop)


typedef TABSDiskBLOBHeader *PABSDiskBLOBHeader;

#pragma pack(push,1)
struct DECLSPEC_DRECORD TABSPageListLink
{
public:
	int StartPageNo;
	System::Word StartOffset;
	int ItemCount;
};
#pragma pack(pop)


class PASCALIMPLEMENTATION TABSBitsArray : public System::TObject
{
	typedef System::TObject inherited;
	
private:
	System::Byte *FBits;
	int FBitCount;
	int FNonZeroBitCount;
	System::StaticArray<System::Byte, 256> FBitsTable;
	
protected:
	int __fastcall GetNonZeroBitCount();
	void __fastcall SetSize(int NewSize);
	
public:
	void __fastcall LoadFromStream(System::Classes::TStream* Stream);
	void __fastcall SaveToStream(System::Classes::TStream* Stream);
	__fastcall TABSBitsArray();
	__fastcall virtual ~TABSBitsArray();
	bool __fastcall GetBit(int BitNo);
	void __fastcall SetBit(int BitNo, bool Value);
	int __fastcall GetBitNoByBitPosition(int BitPosition);
	int __fastcall GetBitPositionByBitNo(int BitNo);
	void __fastcall SetAllBits();
	bool __fastcall FindBit(bool Value, int &BitNo);
	bool __fastcall Find(bool Restart, bool GoForward, int CurBitNo, int &FoundBitNo);
	__property int Size = {read=FBitCount, write=SetSize, nodefault};
	__property int NonZeroBitCount = {read=FNonZeroBitCount, nodefault};
};


//-- var, const, procedure ---------------------------------------------------
extern DELPHI_PACKAGE System::StaticArray<System::StaticArray<bool, 7>, 7> LocksCompatible;
extern DELPHI_PACKAGE bool __fastcall CheckNullFlag(int BitNo, System::PByte NullFlags);
extern DELPHI_PACKAGE void __fastcall SetNullFlag(bool ToSet, int BitNo, System::PByte NullFlags);
extern DELPHI_PACKAGE System::UnicodeString __fastcall GetTemporaryName(System::UnicodeString Prefix);
extern DELPHI_PACKAGE System::AnsiString __fastcall BracketFieldName(System::AnsiString name);
}	/* namespace Abstypes */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_ABSTYPES)
using namespace Abstypes;
#endif
#pragma pack(pop)
#pragma option pop

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