yumapro  23.10T-7
YumaPro SDK
Loading...
Searching...
No Matches
val_tree.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016 - 2021, YumaWorks, Inc., All Rights Reserved.
3 *
4 * Unless required by applicable law or agreed to in writing,
5 * software distributed under the License is distributed on an
6 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
7 * KIND, either express or implied. See the License for the
8 * specific language governing permissions and limitations
9 * under the License.
10 */
11#ifndef _H_val_tree
12#define _H_val_tree
13
14/* FILE: val_tree.h
15*********************************************************************
16* *
17* P U R P O S E *
18* *
19*********************************************************************/
20
26/*********************************************************************
27* *
28* C H A N G E H I S T O R Y *
29* *
30*********************************************************************
31
32date init comment
33----------------------------------------------------------------------
3421-mar-16 abb Begun; start from obj_dict.c
35
36*/
37
38#include "dict.h"
39#include "dlq.h"
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
45
46/********************************************************************
47* *
48* T Y P E S *
49* *
50*********************************************************************/
51
52/* group defined in val_child.h */
60#ifdef UCLINUX
61typedef struct val_tree_t_ {
62 struct hb_tree *tree;
64#else
65typedef struct val_tree_t_ {
66 hb_tree *tree;
68#endif // UCLINUX
69
70
71/********************************************************************
72* *
73* F U N C T I O N S *
74* *
75*********************************************************************/
76
77
83extern val_tree_t *
84 val_tree_new (void);
85
86
92extern void
93 val_tree_free (val_tree_t *val_tree);
94
95
111extern status_t
112 val_tree_insert (val_value_t *childval,
113 val_tree_t *val_tree,
114 boolean ignore_err,
115 boolean *inserted);
116
117
125extern boolean
126 val_tree_remove (val_value_t *childval,
127 val_tree_t *val_tree);
128
129
138extern status_t
139 val_tree_swap (val_value_t *newval,
140 val_value_t *childval,
141 val_tree_t *val_tree);
142
143
151extern void
153 val_tree_t *val_tree);
154
155
167extern status_t
169 val_tree_t *val_tree);
170
171
179extern val_value_t *
180 val_tree_find (const val_value_t *childval,
181 val_tree_t *val_tree);
182
183
187#ifdef __cplusplus
188} /* end extern 'C' */
189#endif
190
191#endif /* _H_val_tree */
dlq provides general double-linked list and queue support:
void val_tree_remove_deleted(val_value_t *childval, val_tree_t *val_tree)
A node is being removed from the tree but not the que because it is marked as VAL_FL_DELETED.
Definition: val_tree.c:442
status_t val_tree_add_undeleted(val_value_t *childval, val_tree_t *val_tree)
A node is being added back to the the tree but not the que because it was marked as VAL_FL_DELETED.
Definition: val_tree.c:479
val_tree_t * val_tree_new(void)
Create a new empty val_tree.
Definition: val_tree.c:184
val_value_t * val_tree_find(const val_value_t *childval, val_tree_t *val_tree)
Find a value node from the specified val_tree.
Definition: val_tree.c:516
status_t val_tree_insert(val_value_t *childval, val_tree_t *val_tree, boolean ignore_err, boolean *inserted)
Add a list entry to the val_tree.
Definition: val_tree.c:247
boolean val_tree_remove(val_value_t *childval, val_tree_t *val_tree)
Remove a value node from the specified val_tree.
Definition: val_tree.c:334
status_t val_tree_swap(val_value_t *newval, val_value_t *childval, val_tree_t *val_tree)
Change the node in the specified tree.
Definition: val_tree.c:387
void val_tree_free(val_tree_t *val_tree)
Clean and free the specified val_tree.
Definition: val_tree.c:212
status_t
global error return code
Definition: status_enum.h:210
wrapper for the height-balanced tree struct
Definition: val_tree.h:65
hb_tree * tree
AVL stree.
Definition: val_tree.h:66
one value to match one type
Definition: val.h:911