-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- change API name into unified naming convention ( pkg_moduleFUNC /w cammel case ) - revising heavily recursive into less or no recursive for practical use - generic base class(like) is integrated to lists / trees implementation
- Loading branch information
Showing
28 changed files
with
1,169 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* cdsl_nrbtree.h | ||
* | ||
* Created on: Mar 24, 2016 | ||
* Author: innocentevil | ||
*/ | ||
|
||
#ifndef INCLUDE_CDSL_NRBTREE_H_ | ||
#define INCLUDE_CDSL_NRBTREE_H_ | ||
|
||
#include "base_tree.h" | ||
#include "cdsl.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
|
||
#ifndef rb_key_t | ||
#define rb_key_t uint32_t | ||
#endif | ||
|
||
#define cdsl_nrbtreeMaxDepth(root) tree_max_depth((base_treeRoot_t*) root) | ||
#define cdsl_nrbtreeTraverse(root, cb, order) tree_traverse((base_treeRoot_t*) root, (base_tree_callback_t) cb, order) | ||
#define cdsl_nrbtreeSize(root) tree_size((base_treeRoot_t*) root) | ||
#define cdsl_nrbtreePrint(root, print) tree_print((base_treeRoot_t*) root, print) | ||
|
||
typedef struct cdsl_nrbtree nrbtreeNode_t; | ||
typedef struct cdsl_nrbroot { | ||
union { | ||
struct base_tree_root base_root; | ||
nrbtreeNode_t* entry; | ||
}; | ||
}nrbtreeRoot_t; | ||
|
||
struct cdsl_nrbtree { | ||
union { | ||
struct base_tree_node base_node; | ||
struct { | ||
nrbtreeNode_t* left; | ||
nrbtreeNode_t* right; | ||
}; | ||
|
||
}; | ||
rb_key_t key; | ||
}; | ||
|
||
|
||
|
||
extern void cdsl_nrbtreeRootInit(nrbtreeRoot_t* rootp); | ||
extern void cdsl_nrbtreeNodeInit(nrbtreeNode_t* node, rb_key_t key); | ||
extern nrbtreeNode_t* cdsl_nrbtreeInsert(nrbtreeRoot_t* rootp,nrbtreeNode_t* item); | ||
extern nrbtreeNode_t* cdsl_nrbtreeLookup(nrbtreeRoot_t* rootp,rb_key_t key); | ||
extern nrbtreeNode_t* cdsl_nrbtreeDelete(nrbtreeRoot_t* rootp,rb_key_t key); | ||
|
||
#ifdef __DBG | ||
extern void cdsl_nrbtreePrint_dev(nrbtreeRoot_t* root); | ||
#else | ||
#define cdsl_nrbtreePrint_dev(root) | ||
#endif | ||
|
||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* INCLUDE_CDSL_NRBTREE_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* cdsl_nrbtree_test.h | ||
* | ||
* Created on: Mar 26, 2016 | ||
* Author: innocentevil | ||
*/ | ||
|
||
#ifndef INCLUDE_TEST_CDSL_NRBTREE_TEST_H_ | ||
#define INCLUDE_TEST_CDSL_NRBTREE_TEST_H_ | ||
#include "cdsl.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
extern BOOL cdsl_nrbtreeDoTest(void); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* INCLUDE_TEST_CDSL_NRBTREE_TEST_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.