/* Generated by version 3.20 of Ctran from isam.cat */
/* Thursday 05-03-1992 19:38:37 */
#define ISAM_G
#ifndef P_STD_H
#include <p_std.h>
#endif
#ifndef P_OBJECT_H
#include <p_object.h>
#endif
#ifndef P_DBF_H
#include <p_dbf.h>
#endif
#ifndef P_MATH_H
#include <p_math.h>
#endif
/* Category Numbers */
#ifndef EPOC
GLREF_D P_CLASS *ct_isam[];
#endif /* EPOC */
#ifdef EPOC
#define CAT_ISAM_ISAM 0
#else
#define CAT_ISAM_ISAM (&ct_isam[0])
#endif
/* Class Numbers */
#define C_ISROOT 0
#define C_IXREC 1
#define C_ISAMAN 2
#define C_BTDBF 3
#define C_DADBF 4
#define C_IXBTREE 5
#define C_BLOCKER 6
/* Method Numbers */
#define O_IX_NEXT 13
#define O_DA_READ 6
#define O_IS_IERASE 27
#define O_DA_SIZE 10
#define O_IS_GET_FIELD 13
#define O_IS_GET_KEYDEF 11
#define O_IX_INSERT 6
#define O_IS_ILAST 35
#define O_IX_ERASEALL 9
#define O_BL_INIT 1
#define O_IX_GET_KEYDEF 20
#define O_BL_ALLOC 8
#define O_IS_DFLUSH 3
#define O_IS_IQADD 26
#define O_DA_ERASE 5
#define O_IX_FLUSH 12
#define O_IS_ICLOSE 18
#define O_IS_IFLUSH 19
#define O_BL_FREEALL 10
#define O_DA_INIT 1
#define O_IX_SET_NMATCH 3
#define O_IS_UPDATE 39
#define O_IS_ADD 37
#define O_IX_UPDATE 10
#define O_IS_DNEXT 6
#define O_BL_DELETE 5
#define O_BL_WRITE_HEADER 14
#define O_IS_SET_DFORMAT 16
#define O_IX_BACK 14
#define O_IX_LAST 16
#define O_IS_PUT_FIELD 12
#define O_IS_DOPEN 2
#define O_IS_INEXT 32
#define O_DA_APPEND 4
#define O_IS_IOPEN 17
#define O_DA_NEXT 9
#define O_IS_DSIZE 4
#define O_IS_GET_TYPE 14
#define O_IS_SET_FIELDDEF 8
#define O_IX_DUP 2
#define O_IX_OPEN 5
#define O_IX_FIND 11
#define O_IS_ISIZE 30
#define O_BL_READ_HEADER 13
#define O_BL_FREE 9
#define O_IX_FIRST 15
#define O_IX_COUNT 18
#define O_IS_IDUP 21
#define O_IX_FILTER 1
#define O_IS_IFLAGS 22
#define O_BL_FLUSH 4
#define O_IS_ICOUNT 29
#define O_BL_UPDATE 12
#define O_DA_FLUSH 3
#define O_IS_ICURRENT 36
#define O_IS_IFIND 31
#define O_IX_SIZE 19
#define O_IX_CURRENT 17
#define O_IS_DFIRST 5
#define O_IS_GET_FIELDDEF 9
#define O_IS_IADD 25
#define O_BL_OPEN 2
#define O_IS_ERASE 38
#define O_DBF_HEADER 11
#define O_IS_IFILTER 20
#define O_IS_IFIRST 34
#define O_BL_COUNT 7
#define O_IS_INIT 1
#define O_IX_ERASE 8
#define O_IS_SET_KEYDEF 10
#define O_BL_CLOSE 3
#define O_IX_QINSERT 7
#define O_IS_IERASEALL 28
#define O_IS_IBUILD 23
#define O_IX_INIT 4
#define O_IS_SET_RADIX 15
#define O_IS_IBACK 33
#define O_BL_NFILES 6
#define O_IS_DESTROY 0
#define O_DA_OPEN 2
#define O_IS_GET_RBUF 7
#define O_DA_GET_SEQ 7
#define O_DA_FIRST 8
#define O_IS_IQBUILD 24
#define O_IX_FLAGS 21
#define O_BL_READ 11
/* Property of isroot */
typedef struct {
P_OBJECT pc;
} PRS_ISROOT;
typedef struct pr_isroot
{
PRS_ISROOT isroot;
} PR_ISROOT;
/* Property of darec */
typedef struct pr_darec
{
PRS_ISROOT isroot;
} PR_DAREC;
/* Property of ixrec */
typedef struct {
VOID *filterObj;
WORD filterMeth;
VOID *dupObj;
WORD dupMeth;
WORD nMatch;
} PRS_IXREC;
typedef struct pr_ixrec
{
PRS_ISROOT isroot;
PRS_IXREC ixrec;
} PR_IXREC;
/* Constants for isaman */
#define ISAM_MAX_INDEXES 8
#define ISAM_MAX_KEY_LENGTH 64
#define ISAM_MAX_DEFINED_FIELDS 32
#define ISAM_MAX_KEYFIELDS 8
#define ISAM_MAX_KEYDEF_LENGTH 66
#define ISAM_MAX_FIELD_LENGTH 256
#define ISAM_MAX_SEG_BLOCKS 1024
#define ISAM_MIN_RECORD_BUFFER 512
#define ISAM_MAX_RECORD_BUFFER 16384
#define ISAM_MAX_RECORD_FIELDS 4094
#define ISAM_RECORD_LENGTH_MASK 0xfff
#define ISAM_BLOCK_SIZE 512
#define ISAM_BLOCK_SHIFTS 9
#define ISAM_FIELDTYPE_WORD 0
#define ISAM_FIELDTYPE_UWORD 0x80
#define ISAM_FIELDTYPE_LONG 1
#define ISAM_FIELDTYPE_ULONG 0x81
#define ISAM_FIELDTYPE_DOUBLE 2
#define ISAM_FIELDTYPE_STRING 3
#define ISAM_FIELDTYPE_BYTE 4
#define ISAM_FIELDTYPE_UBYTE 0x84
#define ISAM_FIELDTYPE_LIMIT 4
#define ISAM_CONVERT_NOFOLD 0
#define ISAM_CONVERT_FOLD 1
#define ISAM_CONVERT_UPPER 2
#define ISAM_CONVERT_LOWER 3
#define ISAM_FIELDFLAG_ASCEND 0
#define ISAM_FIELDFLAG_DESCEND 1
#define ISAM_FLAG_ALLOWDUP 1
#define ISAM_FLAG_MANUAL 2
#define ISAM_FLAG_MINIMIZE 4
#define ISAM_DEFAULT_FIELD_COUNT 32
#define ISAM_DEFAULT_FIELD_TYPE ISAM_FIELDTYPE_STRING
#define ISAM_DEFAULT_KEY_FIELD_COUNT 1
#define ISAM_DEFAULT_KEY_STRING_LENGTH 8
#define ISAM_DEFAULT_RADIX 10
#define ISAM_DEFAULT_DTOB_WIDTH 20
#define ISAM_DEFAULT_DTOB_POINT '.'
#define ISAM_PANIC_CALL 160
#define ISAM_PANIC_PARAM 161
/* Types for isaman */
typedef struct
{
WORD nFields;
UBYTE type[ISAM_MAX_DEFINED_FIELDS];
} ISAM_FIELDDEF;
typedef struct
{
WORD field;
UBYTE type;
UBYTE flags;
UBYTE offset;
UBYTE len;
WORD convert;
} ISAM_KEY_FIELD;
typedef struct
{
WORD nKeyFields;
ISAM_KEY_FIELD keyField[ISAM_MAX_KEYFIELDS];
} ISAM_KEYDEF;
/* Property of isaman */
typedef struct {
PR_DAREC *daRec;
PR_IXREC *ixRec[ISAM_MAX_INDEXES];
WORD ixCat;
WORD ixClass;
WORD iBufBlocks;
LONG ref;
WORD radix;
P_DTOB dFormat;
WORD rBufSize;
UBYTE *rBuf;
ISAM_FIELDDEF fieldInfo;
ISAM_KEYDEF keyDef;
UBYTE zeroBuf[sizeof(DOUBLE)];
UBYTE tempField[ISAM_MAX_FIELD_LENGTH];
} PRS_ISAMAN;
typedef struct pr_isaman
{
PRS_ISROOT isroot;
PRS_ISAMAN isaman;
} PR_ISAMAN;
/* Property of btdbf */
typedef struct pr_btdbf
{
PRS_ISROOT isroot;
PRS_ISAMAN isaman;
} PR_BTDBF;
/* Property of dadbf */
typedef struct {
VOID *pfcb;
UBYTE *buffer;
WORD maxBufSize;
WORD currentBufSize;
WORD nextOffset;
UWORD recordType;
LONG dataStart;
LONG bufFilePos;
LONG ref;
DbfHeader header;
} PRS_DADBF;
typedef struct pr_dadbf
{
PRS_ISROOT isroot;
PRS_DADBF dadbf;
} PR_DADBF;
/* Constants for ixbtree */
#define BT_SIG_LENGTH 16
#define BT_INDEXFILE_VERSION 0x100F
#define BT_INDEXFILE_TYPE1 1
#define BT_MAX_LEVELS 10
/* Types for ixbtree */
typedef struct
{
UBYTE signature[BT_SIG_LENGTH];
UWORD version;
WORD type;
LONG count;
UWORD rootBlock;
WORD flags;
WORD keyLen;
WORD entryLen;
WORD maxEntries;
UBYTE keyDef[ISAM_MAX_KEYDEF_LENGTH];
} IXBTREE_FILE_HEADER;
typedef struct
{
UWORD child;
LONG ref;
UBYTE key[ISAM_MAX_KEY_LENGTH];
} IXBTREE_ENTRY;
typedef struct
{
WORD nEntries;
UBYTE entry[2];
} IXBTREE_BLOCK;
typedef struct
{
UWORD blockNum;
WORD entryNum;
} IXBTREE_STACK;
/* Property of ixbtree */
typedef struct {
WORD fileId;
WORD level;
UWORD blockNum;
WORD entryNum;
LONG ref;
IXBTREE_BLOCK *pB;
IXBTREE_STACK stack[BT_MAX_LEVELS];
IXBTREE_FILE_HEADER head;
} PRS_IXBTREE;
typedef struct pr_ixbtree
{
PRS_ISROOT isroot;
PRS_IXREC ixrec;
PRS_IXBTREE ixbtree;
} PR_IXBTREE;
/* Constants for blocker */
#define BL_BLOCK_SIZE 512
#define BL_BLOCK_SHIFTS 9
#define BL_SEG_BLOCKS 20
#define BL_DS_BLOCKS 4
#define BL_BLOCK_GRANULARITY 4
#define BL_MAX_FILES 32
#define BL_SIG_LENGTH 16
#define BL_FILE_VERSION 0x100F
#define BL_LIST_SIZE 6
/* Types for blocker */
typedef struct
{
WORD dirty;
UWORD totalBlocks;
UWORD ffBlock;
} BLOCKER_INFO;
typedef struct
{
UBYTE signature[BL_SIG_LENGTH];
UWORD version;
BLOCKER_INFO info;
UBYTE spare[8];
} BLOCKER_FILE_HEADER;
typedef struct
{
VOID *chan;
UWORD actualBlocks;
BLOCKER_INFO info;
} BLOCKER_FCB;
typedef struct
{
WORD lru;
WORD fileId;
UWORD block;
UBYTE data[BL_BLOCK_SIZE];
} BLOCKER_DS_BUF;
/* Property of blocker */
typedef struct {
UWORD *pBlock;
UBYTE *pFileId;
UBYTE *pDirty;
WORD *pLru;
HANDLE segHandle;
WORD maxBlocks;
WORD nFiles;
WORD currBuf;
BLOCKER_FCB fileCB[BL_MAX_FILES];
BLOCKER_DS_BUF dsBuf[BL_DS_BLOCKS];
UBYTE temp[BL_BLOCK_SIZE];
} PRS_BLOCKER;
typedef struct pr_blocker
{
PRS_ISROOT isroot;
PRS_BLOCKER blocker;
} PR_BLOCKER;
