Lines Matching defs:btreePtr
149 u_int16_t *GetOffsetAddress (BTreeControlBlockPtr btreePtr,
153 void InsertOffset (BTreeControlBlockPtr btreePtr,
158 void DeleteOffset (BTreeControlBlockPtr btreePtr,
165 #define GetRecordOffset(btreePtr,node,index) (*(short *) ((u_int8_t *)(node) + (btreePtr)->nodeSize - ((index) << 1) - kOffsetSize))
182 Input: btreePtr - pointer to BTree control block
192 OSStatus GetNode (BTreeControlBlockPtr btreePtr,
203 if( nodeNum >= btreePtr->totalNodes )
210 nodePtr->blockSize = btreePtr->nodeSize; // indicate the size of a node
218 getNodeProc = btreePtr->getBlockProc;
219 err = getNodeProc (btreePtr->fileRefNum,
229 ++btreePtr->numGetNodes;
249 Input: btreePtr - pointer to BTree control block
258 OSStatus GetNewNode (BTreeControlBlockPtr btreePtr,
270 returnNodePtr->blockSize = btreePtr->nodeSize; // indicate the size of a node
272 getNodeProc = btreePtr->getBlockProc;
273 err = getNodeProc (btreePtr->fileRefNum,
284 ++btreePtr->numGetNewNodes;
291 ClearNode (btreePtr, node); // clear the node
293 pos = (char *)node + btreePtr->nodeSize - 2; // find address of last offset
308 Input: btreePtr - pointer to BTree control block
315 OSStatus ReleaseNode (BTreeControlBlockPtr btreePtr,
326 releaseNodeProc = btreePtr->releaseBlockProc;
327 err = releaseNodeProc (btreePtr->fileRefNum,
331 ++btreePtr->numReleaseNodes;
350 Input: btreePtr - pointer to BTree control block
357 OSStatus TrashNode (BTreeControlBlockPtr btreePtr,
368 releaseNodeProc = btreePtr->releaseBlockProc;
369 err = releaseNodeProc (btreePtr->fileRefNum,
373 ++btreePtr->numReleaseNodes;
390 Input: btreePtr - pointer to BTree control block
399 OSStatus UpdateNode (BTreeControlBlockPtr btreePtr,
414 releaseNodeProc = btreePtr->releaseBlockProc;
415 err = releaseNodeProc (btreePtr->fileRefNum,
418 ++btreePtr->numUpdateNodes;
462 Input: btreePtr - pointer to BTree control block
468 void ClearNode (BTreeControlBlockPtr btreePtr, NodeDescPtr node )
470 ClearMemory( node, btreePtr->nodeSize );
481 Input: btreePtr - pointer to BTree control block
490 Boolean InsertRecord (BTreeControlBlockPtr btreePtr,
505 freeSpace = GetNodeFreeSize (btreePtr, node);
515 indexOffset = GetRecordOffset (btreePtr, node, index);
516 freeOffset = GetRecordOffset (btreePtr, node, node->numRecords);
527 InsertOffset (btreePtr, node, index, recSize);
548 Input: btreePtr - pointer to BTree control block
560 Boolean InsertKeyRecord (BTreeControlBlockPtr btreePtr,
580 if ( btreePtr->attributes & kBTBigKeysMask )
591 freeSpace = GetNodeFreeSize (btreePtr, node);
601 indexOffset = GetRecordOffset (btreePtr, node, index);
602 freeOffset = GetRecordOffset (btreePtr, node, node->numRecords);
613 InsertOffset (btreePtr, node, index, keySize + recSize);
620 if ( btreePtr->attributes & kBTBigKeysMask )
658 Input: btreePtr - pointer to BTree control block
665 void DeleteRecord (BTreeControlBlockPtr btreePtr,
677 indexOffset = GetRecordOffset (btreePtr, node, index);
678 nextOffset = GetRecordOffset (btreePtr, node, index + 1);
679 freeOffset = GetRecordOffset (btreePtr, node, node->numRecords);
688 DeleteOffset (btreePtr, node, index);
692 ClearMemory(GetRecordAddress(btreePtr, node, node->numRecords), bytesToMove);
708 Input: btreePtr - pointer to BTree control block
718 SearchNode( BTreeControlBlockPtr btreePtr,
729 KeyCompareProcPtr compareProc = btreePtr->keyCompareProc;
733 offset = (u_int16_t *) ((u_int8_t *)(node) + (btreePtr)->nodeSize - kOffsetSize);
765 Input: btreePtr - pointer to BTree control block
776 OSStatus GetRecordByIndex (BTreeControlBlockPtr btreePtr,
794 offset = GetRecordOffset (btreePtr, node, index);
798 keySize = CalcKeySize(btreePtr, *keyPtr);
806 nextOffset = GetRecordOffset (btreePtr, node, index + 1);
821 Input: btreePtr - pointer to BTree control block
827 u_int16_t GetNodeDataSize (BTreeControlBlockPtr btreePtr, NodeDescPtr node )
831 freeOffset = GetRecordOffset (btreePtr, node, node->numRecords);
844 Input: btreePtr - pointer to BTree control block
850 u_int16_t GetNodeFreeSize (BTreeControlBlockPtr btreePtr, NodeDescPtr node )
854 freeOffset = GetRecordOffset (btreePtr, node, node->numRecords); //�� inline?
856 return btreePtr->nodeSize - freeOffset - (node->numRecords << 1) - kOffsetSize;
867 Input: btreePtr - pointer to BTree control block
875 u_int16_t GetRecordOffset (BTreeControlBlockPtr btreePtr,
882 pos = (u_int8_t *)node + btreePtr->nodeSize - (index << 1) - kOffsetSize;
896 Input: btreePtr - pointer to BTree control block
904 u_int8_t * GetRecordAddress (BTreeControlBlockPtr btreePtr,
910 pos = (u_int8_t *)node + GetRecordOffset (btreePtr, node, index);
926 Input: btreePtr - pointer to BTree control block
933 u_int16_t GetRecordSize (BTreeControlBlockPtr btreePtr,
939 pos = (u_int16_t *) ((Ptr)node + btreePtr->nodeSize - (index << 1) - kOffsetSize);
951 Input: btreePtr - pointer to BTree control block
958 u_int16_t *GetOffsetAddress (BTreeControlBlockPtr btreePtr,
964 pos = (Ptr)node + btreePtr->nodeSize - (index << 1) -2;
979 Input: btreePtr - pointer to BTree control block
986 u_int32_t GetChildNodeNum (BTreeControlBlockPtr btreePtr,
992 pos = GetRecordAddress (btreePtr, nodePtr, index);
993 pos += CalcKeySize(btreePtr, (BTreeKey *) pos); // key.length + size of length field
1007 Input: btreePtr - pointer to BTree control block
1015 void InsertOffset (BTreeControlBlockPtr btreePtr,
1023 src = GetOffsetAddress (btreePtr, node, node->numRecords); // point to free offset
1042 Input: btreePtr - pointer to BTree control block
1049 void DeleteOffset (BTreeControlBlockPtr btreePtr,
1057 dst = GetOffsetAddress (btreePtr, node, index);