68 #define XB_INLINE_COMPAREKEY
69 #define XB_INLINE_GETDBFNO
71 #define XB_NDX_NODE_BASESIZE 24 // size of base header data
73 #define XB_VAR_NODESIZE // define to enable variable node sizes
75 #ifndef XB_VAR_NODESIZE
76 #define XB_NDX_NODE_SIZE 2048
79 #define XB_DEFAULT_NDX_NODE_SIZE 512
80 #define XB_MAX_NDX_NODE_SIZE 4096
81 #define XB_NDX_NODE_SIZE NodeSize
82 #define XB_NDX_NODE_MULTIPLE 512
83 #endif // XB_VAR_NODESIZE
100 #ifndef XB_VAR_NODESIZE
104 #endif // XB_VAR_NODESIZE
113 #ifndef XB_VAR_NODESIZE
117 #endif // XB_VAR_NODESIZE
166 void DumpNodeRec(
xbLong NodeNo );
167 void DumpNodeChain();
200 #ifndef XB_VAR_NODESIZE
204 #endif // XB_VAR_NODESIZE
219 #ifndef XB_INLINE_COMPAREKEY
220 xbShort CompareKey(
const char *Key1,
const char *Key2,
xbShort Klen );
234 if(!( Key1 && Key2 ))
return -1;
236 if( Klen > HeadNode.KeyLen ) Klen = HeadNode.KeyLen;
238 if( HeadNode.KeyType == 0 )
240 c = memcmp(Key1, Key2, Klen);
249 d1 = dbf->xbase->GetDouble( Key1 );
250 d2 = dbf->xbase->GetDouble( Key2 );
251 if( d1 == d2 )
return 0;
252 else if( d1 > d2 )
return 1;
257 #ifndef XB_INLINE_GETDBFNO
271 p += RecNo * ( 8 + HeadNode.KeyLen );
272 return( dbf->xbase->GetLong( p ));
284 xbLong GetLeafFromInteriorNode(
const char *Tkey,
xbShort Klen );
304 void ProcessDeleteList();
struct xbNdxLeafNode Leaf
Definition: ndx.h:129
virtual xbShort GetCurrentKey(char *key)=0
virtual xbShort CreateIndex(const char *, const char *, xbShort, xbShort)=0
xbLong TotalNodes
Definition: ndx.h:91
double xbDouble
xbDouble type
Definition: xtypes.h:76
~xbNdx()
Definition: ndx.h:144
xbNdxNodeLink struct
Definition: ndx.h:124
#define XB_NDX_NODE_SIZE
Definition: ndx.h:81
xbLong NodeNo
Definition: ndx.h:128
virtual xbShort OpenIndex(const char *)=0
xbString IndexName
Definition: ndx.h:199
xbNdx class
Definition: ndx.h:136
virtual xbShort KeyExists(xbDouble)=0
#define XBDLLEXPORT
Definition: xbase.h:101
xbLong ReusedxbNodeLinks
Definition: ndx.h:198
xbNdxNodeLink * FreeNodeChain
Definition: ndx.h:209
xbUShort KeyLen
Definition: ndx.h:93
xbLong KeySize
Definition: ndx.h:96
virtual void SetNodeSize(xbShort size)
Definition: index.h:133
xbLong GetDbfNo(xbShort RecNo, xbNdxNodeLink *n)
Short description.
Definition: ndx.h:263
char Unknown2
Definition: ndx.h:97
xbNdxNodeLink * CurNode
Definition: ndx.h:210
xbLong NoOfKeysThisNode
Definition: ndx.h:112
xbShort GetFirstKey()
Short description.
Definition: ndx.h:181
virtual xbShort GetLastKey()=0
char * KeyBuf2
Definition: ndx.h:215
char * KeyBuf
Definition: ndx.h:214
xbShort KeyExists(const char *Key)
Definition: ndx.h:187
virtual xbShort GetNextKey()=0
xbNdx()
Definition: ndx.h:141
xbString class
Definition: xbstring.h:69
virtual xbShort FindKey()=0
virtual xbShort ReIndex(void(*statusFunc)(xbLong itemNum, xbLong numItems)=0)=0
xbLong NoOfKeys
Definition: ndx.h:92
virtual xbShort KeyWasChanged()=0
xbLong CurKeyNo
Definition: ndx.h:127
xbNdxNodeLink * CloneChain
Definition: ndx.h:212
xbShort UniqueIndex()
Definition: ndx.h:158
xbIndex class
Definition: index.h:67
virtual xbShort GetFirstKey()=0
xbNdxHeadNode HeadNode
Definition: ndx.h:195
xbNdxLeafNode LeafNode
Definition: ndx.h:196
virtual xbShort AddKey(xbLong)=0
#define xbLong
Definition: xtypes.h:67
virtual xbShort CloseIndex()=0
short int xbShort
xbShort type
Definition: xtypes.h:65
xbUShort KeysPerNode
Definition: ndx.h:94
xbLong CurDbfRec
Definition: ndx.h:213
char Unique
Definition: ndx.h:98
virtual xbShort GetPrevKey()=0
#define XB_MAX_NDX_NODE_SIZE
Definition: ndx.h:80
xbNdxNodeLink * DeleteChain
Definition: ndx.h:211
xbLong StartNode
Definition: ndx.h:90
xbLong CurDbfRec
Definition: index.h:79
xbNdxNodeLink * NextNode
Definition: ndx.h:126
virtual xbShort CreateKey(xbShort, xbShort)=0
virtual xbShort DeleteKey(xbLong)=0
xbNdxLeafNode struct
Definition: ndx.h:111
xbNdxHeadnode struct
Definition: ndx.h:89
xbUShort KeyType
Definition: ndx.h:95
virtual xbLong GetTotalNodes()=0
xbShort GetLastKey()
Short description.
Definition: ndx.h:177
xbShort GetPrevKey()
Short description.
Definition: ndx.h:185
xbLong xbNodeLinkCtr
Definition: ndx.h:197
xbNdxNodeLink * NodeChain
Definition: ndx.h:208
xbMH struct
Definition: dbf.h:201
xbShort GetNextKey()
Short description.
Definition: ndx.h:173
unsigned short int xbUShort
xbUShort type
Definition: xtypes.h:61
virtual void GetExpression(char *buf, int len)=0
xbShort CompareKey(const char *Key1, const char *Key2, xbShort Klen)
Short description.
Definition: ndx.h:225
char KeyRecs[XB_MAX_NDX_NODE_SIZE-4]
Definition: ndx.h:116
xbLong GetCurDbfRec()
Definition: ndx.h:154
xbNdxNodeLink * PrevNode
Definition: ndx.h:125