Loading...
Searching...
No Matches
sasstringbtree.h
Go to the documentation of this file.
/*
* Copyright (c) 2004-2014 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation, Steven Munroe - initial API and implementation
* IBM Corporation, Adhemerval Zanella - bugfixes and documentation
*/
#ifndef __SAS_STRINGBTREE_H
#define __SAS_STRINGBTREE_H
#include "sasstringbtreenode.h"
typedef void *SASStringBTree_t;
#ifdef __cplusplus
#define __C__ "C"
#else
#define __C__
#endif
extern __C__ SASStringBTree_t
SASStringBTreeFixedCreate (block_size_t block_size);
extern __C__ SASStringBTree_t
SASStringBTreeExpandCreate (SASStringBTree_t btree);
extern __C__ SASStringBTree_t
SASStringBTreeCreate (block_size_t block_size);
extern __C__ SASStringBTree_t
SASStringBTreeCreatePageSize (block_size_t block_size, block_size_t page_size);
extern __C__ void
SASStringBTreeDestroy (SASStringBTree_t btree);
extern __C__ block_size_t
SASStringBTreeAllocSize (SASStringBTree_t btree);
extern __C__ block_size_t
SASStringBTreeFreeSpace (SASStringBTree_t btree);
extern __C__ SASStringBTreeNode_t
SASStringBTreeAlloc (SASStringBTree_t btree);
extern __C__ SASStringBTreeNode_t
SASStringBTreeNearAlloc (void *nearObj);
extern __C__ void
SASStringBTreeFree (SASStringBTree_t btree, SASStringBTreeNode_t free_block);
extern __C__ void
SASStringBTreeNearDealloc (void *memAddr);
extern __C__ SASStringBTreeNode_t
SASStringBTreeGetRootNode (SASStringBTree_t btree);
extern __C__ SASStringBTreeNode_t
SASStringBTreeGetRootNodeNoLock (SASStringBTree_t btree);
extern __C__ long
SASStringBTreeGetModCount (SASStringBTree_t btree);
extern __C__ long
SASStringBTreeGetModCount_nolock (SASStringBTree_t btree);
extern __C__ char *
SASStringBTreeGetMaxKey (SASStringBTree_t btree);
extern __C__ char *
SASStringBTreeGetMaxKey_nolock (SASStringBTree_t btree);
extern __C__ char *
SASStringBTreeGetMinKey (SASStringBTree_t btree);
extern __C__ char *
SASStringBTreeGetMinKey_nolock (SASStringBTree_t btree);
extern __C__ int
SASStringBTreeContainsKey (SASStringBTree_t btree, char *key);
extern __C__ int
SASStringBTreeContainsKey_nolock (SASStringBTree_t btree, char *key);
extern __C__ void *
SASStringBTreeGet (SASStringBTree_t btree, char *key);
extern __C__ void *
SASStringBTreeGet_nolock (SASStringBTree_t btree, char *key);
extern __C__ int
SASStringBTreeIsEmpty (SASStringBTree_t btree);
extern __C__ int
SASStringBTreeIsEmpty_nolock (SASStringBTree_t btree);
extern __C__ long
SASStringBTreeGetCurCount (SASStringBTree_t btree);
extern __C__ int
SASStringBTreePut (SASStringBTree_t btree, char *key, void *value);
extern __C__ int
SASStringBTreePut_nolock (SASStringBTree_t btree, char *key, void *value);
extern __C__ void *
SASStringBTreeReplace (SASStringBTree_t btree, char *key, void *value);
extern __C__ void *
SASStringBTreeReplace_nolock (SASStringBTree_t btree, char *key, void *value);
extern __C__ void *
SASStringBTreeRemove (SASStringBTree_t btree, char *key);
extern __C__ void *
SASStringBTreeRemove_nolock (SASStringBTree_t btree, char *key);
extern __C__ SASStringBTree_t
SASStringBTreeInit (void *block, block_size_t block_size,
block_size_t page_size, int expanding);
extern __C__ void
SASStringBTreeDestroyNoLock (SASStringBTree_t btree);
extern __C__ block_size_t
SASStringBTreeFreeSpaceNoLock (SASStringBTree_t btree);
extern __C__ SASStringBTreeNode_t
SASStringBTreeAllocNoLock (SASStringBTree_t btree);
extern __C__ SASStringBTreeNode_t
SASStringBTreeNearAllocNoLock (void *nearObj);
extern __C__ void
SASStringBTreeNearDeallocNoLock (void *memAddr);
extern __C__ void
SASStringBTreeFreeNoLock (SASStringBTree_t btree,
SASStringBTreeNode_t free_block);
#endif /* __SAS_STRINGBTREE_H */
__C__
#define __C__
ignore this macro behind the curtain
Definition sasmsync.h:32
SASStringBTreeNearAlloc
__C__ SASStringBTreeNode_t SASStringBTreeNearAlloc(void *nearObj)
Internal function to allocate a new SASStringBTreeNode_t from the containing SAS B-Tree near an exist...
SASStringBTreeNearDealloc
__C__ void SASStringBTreeNearDealloc(void *memAddr)
Internal function to free the SASStringBTreeNode_t at memAddr from its associated SASStringBTree_t B-...
SASStringBTreeNearDeallocNoLock
__C__ void SASStringBTreeNearDeallocNoLock(void *memAddr)
Internal function. Free the SASStringBTreeNode_t on memAddr from its associated SASStringBTree_t B-Tr...
SASStringBTree_t
void * SASStringBTree_t
Handle to an instance of String B-tree.
Definition sasstringbtree.h:101
SASStringBTreeCreatePageSize
__C__ SASStringBTree_t SASStringBTreeCreatePageSize(block_size_t block_size, block_size_t page_size)
Create a new expanding SAS B-Tree with heap_size size and page_size node size.
SASStringBTreeRemove
__C__ void * SASStringBTreeRemove(SASStringBTree_t btree, char *key)
Remove the key key and its associated value from SAS B-Tree btree.
SASStringBTreeGetMinKey
__C__ char * SASStringBTreeGetMinKey(SASStringBTree_t btree)
Return the minimum key string from btree.
SASStringBTreeGetModCount_nolock
__C__ long SASStringBTreeGetModCount_nolock(SASStringBTree_t btree)
Return the number or insert/replace/remove operations performed on btree.
SASStringBTreeReplace
__C__ void * SASStringBTreeReplace(SASStringBTree_t btree, char *key, void *value)
Replace the associated value of the element with key key in SAS B-Tree btree with the value value.
SASStringBTreeGetCurCount
__C__ long SASStringBTreeGetCurCount(SASStringBTree_t btree)
Return the number of elements in the SAS B-Tree btree.
SASStringBTreeRemove_nolock
__C__ void * SASStringBTreeRemove_nolock(SASStringBTree_t btree, char *key)
Remove the key key and its associated value from SAS B-Tree btree.
SASStringBTreeCreate
__C__ SASStringBTree_t SASStringBTreeCreate(block_size_t block_size)
Create a new expanding SAS B-Tree with initial heap_size size and default page_size for nodes.
SASStringBTreeNearAllocNoLock
__C__ SASStringBTreeNode_t SASStringBTreeNearAllocNoLock(void *nearObj)
Internal function. Allocate a new SASStringBTreeNode_t from SAS B-Tree near nearObj.
SASStringBTreeGetRootNodeNoLock
__C__ SASStringBTreeNode_t SASStringBTreeGetRootNodeNoLock(SASStringBTree_t btree)
Internal function that returns the root SASStringBTreeNode_t node for btree B-Tree.
SASStringBTreeIsEmpty
__C__ int SASStringBTreeIsEmpty(SASStringBTree_t btree)
Return true if the SAS B-Tree btree is empty.
SASStringBTreeIsEmpty_nolock
__C__ int SASStringBTreeIsEmpty_nolock(SASStringBTree_t btree)
Return true if the SAS B-Tree btree is empty.
SASStringBTreeFree
__C__ void SASStringBTreeFree(SASStringBTree_t btree, SASStringBTreeNode_t free_block)
Internal function to return a SASStringBTreeNode_t free_block to the free space of B-tree btree for l...
SASStringBTreeFreeSpace
__C__ block_size_t SASStringBTreeFreeSpace(SASStringBTree_t btree)
Return the total available node free space for btree.
SASStringBTreeGetRootNode
__C__ SASStringBTreeNode_t SASStringBTreeGetRootNode(SASStringBTree_t btree)
Internal function that returns the root SASStringBTreeNode_t node for btree B-Tree.
SASStringBTreeGetMinKey_nolock
__C__ char * SASStringBTreeGetMinKey_nolock(SASStringBTree_t btree)
Return the minimum key string from btree.
SASStringBTreeGetMaxKey_nolock
__C__ char * SASStringBTreeGetMaxKey_nolock(SASStringBTree_t btree)
Return the maximum key string from btree.
SASStringBTreeExpandCreate
__C__ SASStringBTree_t SASStringBTreeExpandCreate(SASStringBTree_t btree)
Internal function that creates new block of B-Tree nodes for an expanding SAS B-Tree btree.
SASStringBTreeReplace_nolock
__C__ void * SASStringBTreeReplace_nolock(SASStringBTree_t btree, char *key, void *value)
Replace the associated value of the element with key key in SAS B-Tree btree with the value value.
SASStringBTreeGet
__C__ void * SASStringBTreeGet(SASStringBTree_t btree, char *key)
Return the memory address value associated with key in SAS B-Tree btree.
SASStringBTreeFreeNoLock
__C__ void SASStringBTreeFreeNoLock(SASStringBTree_t btree, SASStringBTreeNode_t free_block)
Internal function. Free the SASStringBTreeNode_t free_block from B-tree btree.
SASStringBTreeGetModCount
__C__ long SASStringBTreeGetModCount(SASStringBTree_t btree)
Return the number or insert/replace/remove operations performed on btree.
SASStringBTreeGetMaxKey
__C__ char * SASStringBTreeGetMaxKey(SASStringBTree_t btree)
Return the maximum key string from btree.
SASStringBTreePut_nolock
__C__ int SASStringBTreePut_nolock(SASStringBTree_t btree, char *key, void *value)
Add a new element value with key key in the SAS B-Tree btree.
SASStringBTreeDestroyNoLock
__C__ void SASStringBTreeDestroyNoLock(SASStringBTree_t btree)
Destroy the SAS B-Tree btree.
SASStringBTreeAllocSize
__C__ block_size_t SASStringBTreeAllocSize(SASStringBTree_t btree)
Return the page size used for node allocation for btree.
SASStringBTreeGet_nolock
__C__ void * SASStringBTreeGet_nolock(SASStringBTree_t btree, char *key)
Return the memory address value associated with key in SAS B-Tree btree.
SASStringBTreeContainsKey_nolock
__C__ int SASStringBTreeContainsKey_nolock(SASStringBTree_t btree, char *key)
Return true if the SAS B-Tree btree contains the key key.
SASStringBTreePut
__C__ int SASStringBTreePut(SASStringBTree_t btree, char *key, void *value)
Add a new element value with key key in the SAS B-Tree btree.
SASStringBTreeInit
__C__ SASStringBTree_t SASStringBTreeInit(void *block, block_size_t block_size, block_size_t page_size, int expanding)
Internal function to initialize storage as a B-tree.
SASStringBTreeContainsKey
__C__ int SASStringBTreeContainsKey(SASStringBTree_t btree, char *key)
Return true if the SAS B-Tree btree contains the key key.
SASStringBTreeFreeSpaceNoLock
__C__ block_size_t SASStringBTreeFreeSpaceNoLock(SASStringBTree_t btree)
Internal function. Return the total available free space on SAS B-Tree btree.
SASStringBTreeFixedCreate
__C__ SASStringBTree_t SASStringBTreeFixedCreate(block_size_t block_size)
Create a fixed SAS B-Tree of block_size size capacity.
SASStringBTreeDestroy
__C__ void SASStringBTreeDestroy(SASStringBTree_t btree)
Destroy the SAS B-Tree btree.
SASStringBTreeAllocNoLock
__C__ SASStringBTreeNode_t SASStringBTreeAllocNoLock(SASStringBTree_t btree)
Internal function. Allocate a new SASStringBTreeNode_t from SAS B-Tree btree.
SASStringBTreeAlloc
__C__ SASStringBTreeNode_t SASStringBTreeAlloc(SASStringBTree_t btree)
Internal function to allocate a new SASStringBTreeNode_t for SAS B-Tree btree.