MGE General C Library - Full Internal Documentation  v1.4.1
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  * *
33  ************************************************************************
34  */
35 
36 #ifndef BSTREE_INTERNAL_H
37 #define BSTREE_INTERNAL_H
38 
39 #include <portability.h>
40 
41 #include <bstree.h>
42 
44 
45 static struct bstreenode *add_node(struct bstreenode *currentnode,
46  const void *object, size_t objsize,
47  struct bstree *tree);
48 
49 static void *find_node(const struct bstreenode *currentnode,
50  const void *searchobj,
51  int (*comp)(const void *, const void *));
52 
53 static int get_counter_node(const struct bstreenode *currentnode,
54  const void *searchobj,
55  int (*comp)(const void *, const void *));
56 
57 static void *find_next_node(const struct bstreenode *currentnode,
58  const void *searchobj,
59  int (*comp)(const void *, const void *));
60 
61 static void *find_prev_node(const struct bstreenode *currentnode,
62  const void *searchobj,
63  int (*comp)(const void *, const void *));
64 
65 static void *upd_node(struct bstreenode *currentnode, const void *updobj,
66  size_t objsize, int (*comp)(const void *, const void *));
67 
68 static struct bstreenode *del_node(struct bstreenode *currentnode,
69  const void *searchobj, struct bstree *tree);
70 
71 static struct bstreenode *free_bstree(struct bstreenode *currentnode);
72 
73 static struct bstreenode *free_bst_node(struct bstreenode *currentnode);
74 
75 static struct bstobjcoord *
76 find_next_node_trace(const struct bstreenode *currentnode,
77  struct bstobjcoord *searchobj,
78  int (*comp)(const void *, const void *));
79 
81 
82 #endif /* ndef BSTREE_INTERNAL_H */
83 
Binary search tree.
Definition: bstree.h:69
static struct bstreenode * free_bstree(struct bstreenode *currentnode)
static void * find_next_node(const struct bstreenode *currentnode, const void *searchobj, int(*comp)(const void *, const void *))
Header file to ease portability.
static int get_counter_node(const struct bstreenode *currentnode, const void *searchobj, int(*comp)(const void *, const void *))
static BEGIN_C_DECLS struct bstreenode * add_node(struct bstreenode *currentnode, const void *object, size_t objsize, struct bstree *tree)
Node coordinates for test tracing.
Definition: bstree.h:53
static void * upd_node(struct bstreenode *currentnode, const void *updobj, size_t objsize, int(*comp)(const void *, const void *))
static struct bstreenode * free_bst_node(struct bstreenode *currentnode)
#define END_C_DECLS
Use END_C_DECLS at the end of C declarations.
Definition: portability.h:50
static void * find_prev_node(const struct bstreenode *currentnode, const void *searchobj, int(*comp)(const void *, const void *))
Binary search tree header file.
#define BEGIN_C_DECLS
BEGIN_C_DECLS should be used at the beginning of declarations so that C++ compilers don&#39;t mangle thei...
Definition: portability.h:46
Binary search tree node.
Definition: bstree.h:61
static struct bstobjcoord * find_next_node_trace(const struct bstreenode *currentnode, struct bstobjcoord *searchobj, int(*comp)(const void *, const void *))
static struct bstreenode * del_node(struct bstreenode *currentnode, const void *searchobj, struct bstree *tree)
static void * find_node(const struct bstreenode *currentnode, const void *searchobj, int(*comp)(const void *, const void *))