MGE General C Library - Full Internal Documentation  v1.6.8
Library of general C functions.
bstree-internal.h
Go to the documentation of this file.
1 
15 /* **********************************************************************
16  * *
17  * Changelog *
18  * *
19  * Date Author Version Description *
20  * *
21  * 04/11/2017 MG 1.0.1 Started ChangeLog. *
22  * 09/11/2017 MG 1.0.2 Add SPDX license tag. *
23  * 02/01/2018 MG 1.0.3 Move to new source directory structure. *
24  * 19/05/2018 MG 1.0.4 Include dllist and sllist prototypes. *
25  * 20/05/2018 MG 1.0.5 Add re-inclusion prevention #defines. *
26  * 20/05/2018 MG 1.0.6 Standardise on define name format. *
27  * 02/06/2018 MG 1.0.7 Add support for counter and node totals *
28  * for a tree. *
29  * 09/06/2019 MG 1.0.8 clang-format coding style changes. *
30  * 12/07/2019 MG 1.0.9 Separate combined header file into *
31  * specific individual files. *
32  * 03/12/2021 MG 1.0.10 Tighten SPDX tag. *
33  * *
34  ************************************************************************
35  */
36 
37 #ifndef BSTREE_INTERNAL_H
38 #define BSTREE_INTERNAL_H
39 
40 #include <portability.h>
41 
42 #include <bstree.h>
43 
45 
46 static struct bstreenode *add_node(struct bstreenode *currentnode,
47  const void *object, size_t objsize,
48  struct bstree *tree);
49 
50 static void *find_node(const struct bstreenode *currentnode,
51  const void *searchobj,
52  int (*comp)(const void *, const void *));
53 
54 static int get_counter_node(const struct bstreenode *currentnode,
55  const void *searchobj,
56  int (*comp)(const void *, const void *));
57 
58 static void *find_next_node(const struct bstreenode *currentnode,
59  const void *searchobj,
60  int (*comp)(const void *, const void *));
61 
62 static void *find_prev_node(const struct bstreenode *currentnode,
63  const void *searchobj,
64  int (*comp)(const void *, const void *));
65 
66 static void *upd_node(struct bstreenode *currentnode, const void *updobj,
67  size_t objsize, int (*comp)(const void *, const void *));
68 
69 static struct bstreenode *del_node(struct bstreenode *currentnode,
70  const void *searchobj, struct bstree *tree);
71 
72 static struct bstreenode *free_bstree(struct bstreenode *currentnode);
73 
74 static struct bstreenode *free_bst_node(struct bstreenode *currentnode);
75 
76 static struct bstobjcoord *
77 find_next_node_trace(const struct bstreenode *currentnode,
78  struct bstobjcoord *searchobj,
79  int (*comp)(const void *, const void *));
80 
82 
83 #endif /* ndef BSTREE_INTERNAL_H */
84 
static void * find_node(const struct bstreenode *currentnode, const void *searchobj, int(*comp)(const void *, const void *))
static int get_counter_node(const struct bstreenode *currentnode, const void *searchobj, int(*comp)(const void *, const void *))
static struct bstreenode * free_bstree(struct bstreenode *currentnode)
static void * upd_node(struct bstreenode *currentnode, const void *updobj, size_t objsize, int(*comp)(const void *, const void *))
static void * find_prev_node(const struct bstreenode *currentnode, const void *searchobj, int(*comp)(const void *, const void *))
static struct bstreenode * free_bst_node(struct bstreenode *currentnode)
static BEGIN_C_DECLS struct bstreenode * add_node(struct bstreenode *currentnode, const void *object, size_t objsize, struct bstree *tree)
static struct bstreenode * del_node(struct bstreenode *currentnode, const void *searchobj, struct bstree *tree)
static struct bstobjcoord * find_next_node_trace(const struct bstreenode *currentnode, struct bstobjcoord *searchobj, int(*comp)(const void *, const void *))
static void * find_next_node(const struct bstreenode *currentnode, const void *searchobj, int(*comp)(const void *, const void *))
Binary search tree header file.
Header file to ease portability.
#define BEGIN_C_DECLS
BEGIN_C_DECLS should be used at the beginning of declarations so that C++ compilers don't mangle thei...
Definition: portability.h:47
#define END_C_DECLS
Use END_C_DECLS at the end of C declarations.
Definition: portability.h:51
Node coordinates for test tracing.
Definition: bstree.h:54
Binary search tree.
Definition: bstree.h:70
Binary search tree node.
Definition: bstree.h:62