Shared Persistent Heap Data Environment Manual  1.1.0
sasstringbtree.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2004-2014 IBM Corporation.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation, Steven Munroe - initial API and implementation
10  * IBM Corporation, Adhemerval Zanella - bugfixes and documentation
11  */
12 
13 #ifndef __SAS_STRINGBTREE_H
14 #define __SAS_STRINGBTREE_H
15 
16 #include "sasstringbtreenode.h"
102 typedef void *SASStringBTree_t;
103 
104 #ifdef __cplusplus
105 #define __C__ "C"
106 #else
107 #define __C__
108 #endif
109 
120 extern __C__ SASStringBTree_t
121 SASStringBTreeFixedCreate (block_size_t block_size);
122 
135 extern __C__ SASStringBTree_t
137 
149 extern __C__ SASStringBTree_t
150 SASStringBTreeCreate (block_size_t block_size);
151 
163 extern __C__ SASStringBTree_t
164 SASStringBTreeCreatePageSize (block_size_t block_size, block_size_t page_size);
165 
175 extern __C__ void
177 
186 extern __C__ block_size_t
188 
198 extern __C__ block_size_t
200 
213 extern __C__ SASStringBTreeNode_t
215 
230 extern __C__ SASStringBTreeNode_t
231 SASStringBTreeNearAlloc (void *nearObj);
232 
243 extern __C__ void
244 SASStringBTreeFree (SASStringBTree_t btree, SASStringBTreeNode_t free_block);
245 
257 extern __C__ void
258 SASStringBTreeNearDealloc (void *memAddr);
259 
270 extern __C__ SASStringBTreeNode_t
272 
283 extern __C__ SASStringBTreeNode_t
285 
286 
300 extern __C__ long
302 
319 extern __C__ long
321 
336 extern __C__ char *
338 
356 extern __C__ char *
358 
373 extern __C__ char *
375 
393 extern __C__ char *
395 
407 extern __C__ int
409 
424 extern __C__ int
426 
441 extern __C__ void *
442 SASStringBTreeGet (SASStringBTree_t btree, char *key);
443 
461 extern __C__ void *
462 SASStringBTreeGet_nolock (SASStringBTree_t btree, char *key);
463 
473 extern __C__ int
475 
488 extern __C__ int
490 
500 extern __C__ long
502 
503 
520 extern __C__ int
521 SASStringBTreePut (SASStringBTree_t btree, char *key, void *value);
522 
542 extern __C__ int
543 SASStringBTreePut_nolock (SASStringBTree_t btree, char *key, void *value);
544 
545 
562 extern __C__ void *
563 SASStringBTreeReplace (SASStringBTree_t btree, char *key, void *value);
564 
584 extern __C__ void *
585 SASStringBTreeReplace_nolock (SASStringBTree_t btree, char *key, void *value);
586 
587 
604 extern __C__ void *
605 SASStringBTreeRemove (SASStringBTree_t btree, char *key);
606 
626 extern __C__ void *
628 
645 extern __C__ SASStringBTree_t
646 SASStringBTreeInit (void *block, block_size_t block_size,
647  block_size_t page_size, int expanding);
648 
656 extern __C__ void
658 
667 extern __C__ block_size_t
669 
678 extern __C__ SASStringBTreeNode_t
680 
690 extern __C__ SASStringBTreeNode_t
691 SASStringBTreeNearAllocNoLock (void *nearObj);
692 
702 extern __C__ void
703 SASStringBTreeNearDeallocNoLock (void *memAddr);
704 
713 extern __C__ void
715  SASStringBTreeNode_t free_block);
716 
717 #endif /* __SAS_STRINGBTREE_H */
__C__ block_size_t SASStringBTreeFreeSpaceNoLock(SASStringBTree_t btree)
Internal function. Return the total available free space on SAS B-Tree btree.
__C__ int SASStringBTreeContainsKey(SASStringBTree_t btree, char *key)
Return true if the SAS B-Tree btree contains the key key.
__C__ SASStringBTreeNode_t SASStringBTreeNearAlloc(void *nearObj)
Internal function to allocate a new SASStringBTreeNode_t from the containing SAS B-Tree near an exist...
__C__ void * SASStringBTreeGet(SASStringBTree_t btree, char *key)
Return the memory address value associated with key in SAS B-Tree btree.
__C__ SASStringBTree_t SASStringBTreeExpandCreate(SASStringBTree_t btree)
Internal function that creates new block of B-Tree nodes for an expanding SAS B-Tree btree...
__C__ long SASStringBTreeGetModCount(SASStringBTree_t btree)
Return the number or insert/replace/remove operations performed on btree.
__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.
__C__ int SASStringBTreeIsEmpty_nolock(SASStringBTree_t btree)
Return true if the SAS B-Tree btree is empty.
__C__ int SASStringBTreePut(SASStringBTree_t btree, char *key, void *value)
Add a new element value with key key in the SAS B-Tree btree.
__C__ SASStringBTreeNode_t SASStringBTreeAllocNoLock(SASStringBTree_t btree)
Internal function. Allocate a new SASStringBTreeNode_t from SAS B-Tree btree.
__C__ SASStringBTreeNode_t SASStringBTreeGetRootNode(SASStringBTree_t btree)
Internal function that returns the root SASStringBTreeNode_t node for btree B-Tree.
void * SASStringBTree_t
Handle to an instance of String B-tree.
Definition: sasstringbtree.h:102
__C__ SASStringBTreeNode_t SASStringBTreeAlloc(SASStringBTree_t btree)
Internal function to allocate a new SASStringBTreeNode_t for SAS B-Tree btree.
__C__ void SASStringBTreeDestroyNoLock(SASStringBTree_t btree)
Destroy the SAS B-Tree btree.
#define __C__
ignore this macro behind the curtain
Definition: sasmsync.h:32
__C__ SASStringBTreeNode_t SASStringBTreeGetRootNodeNoLock(SASStringBTree_t btree)
Internal function that returns the root SASStringBTreeNode_t node for btree B-Tree.
__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...
__C__ int SASStringBTreeContainsKey_nolock(SASStringBTree_t btree, char *key)
Return true if the SAS B-Tree btree contains the key key.
__C__ void SASStringBTreeNearDealloc(void *memAddr)
Internal function to free the SASStringBTreeNode_t at memAddr from its associated SASStringBTree_t B-...
__C__ long SASStringBTreeGetCurCount(SASStringBTree_t btree)
Return the number of elements in the SAS B-Tree btree.
__C__ void * SASStringBTreeGet_nolock(SASStringBTree_t btree, char *key)
Return the memory address value associated with key in SAS B-Tree btree.
__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.
__C__ void * SASStringBTreeRemove_nolock(SASStringBTree_t btree, char *key)
Remove the key key and its associated value from SAS B-Tree btree.
__C__ void SASStringBTreeNearDeallocNoLock(void *memAddr)
Internal function. Free the SASStringBTreeNode_t on memAddr from its associated SASStringBTree_t B-Tr...
__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...
__C__ long SASStringBTreeGetModCount_nolock(SASStringBTree_t btree)
Return the number or insert/replace/remove operations performed on btree.
__C__ void SASStringBTreeDestroy(SASStringBTree_t btree)
Destroy the SAS B-Tree btree.
__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...
__C__ void * SASStringBTreeRemove(SASStringBTree_t btree, char *key)
Remove the key key and its associated value from SAS B-Tree btree.
__C__ char * SASStringBTreeGetMaxKey(SASStringBTree_t btree)
Return the maximum key string from btree.
__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.
__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...
__C__ block_size_t SASStringBTreeFreeSpace(SASStringBTree_t btree)
Return the total available node free space for btree.
__C__ char * SASStringBTreeGetMaxKey_nolock(SASStringBTree_t btree)
Return the maximum key string from btree.
__C__ SASStringBTree_t SASStringBTreeFixedCreate(block_size_t block_size)
Create a fixed SAS B-Tree of block_size size capacity.
__C__ block_size_t SASStringBTreeAllocSize(SASStringBTree_t btree)
Return the page size used for node allocation for btree.
__C__ void SASStringBTreeFreeNoLock(SASStringBTree_t btree, SASStringBTreeNode_t free_block)
Internal function. Free the SASStringBTreeNode_t free_block from B-tree btree.
__C__ char * SASStringBTreeGetMinKey_nolock(SASStringBTree_t btree)
Return the minimum key string from btree.
__C__ int SASStringBTreeIsEmpty(SASStringBTree_t btree)
Return true if the SAS B-Tree btree is empty.
__C__ char * SASStringBTreeGetMinKey(SASStringBTree_t btree)
Return the minimum key string from btree.
__C__ SASStringBTreeNode_t SASStringBTreeNearAllocNoLock(void *nearObj)
Internal function. Allocate a new SASStringBTreeNode_t from SAS B-Tree near nearObj.