Wireshark  4.3.0
The Wireshark network protocol analyzer
wmem_interval_tree.h
Go to the documentation of this file.
1 
12 #ifndef __WMEM_INTERVAL_TREE_H__
13 #define __WMEM_INTERVAL_TREE_H__
14 
15 #include "wmem_core.h"
16 #include "wmem_tree.h"
17 #include "wmem_list.h"
18 
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif /* __cplusplus */
23 
36 struct _wmem_tree_t;
37 typedef struct _wmem_tree_t wmem_itree_t;
38 
39 struct _wmem_range_t {
40  uint64_t low; /* low is used as the key in the binary tree */
41  uint64_t high; /* Max value of the range */
42  uint64_t max_edge; /* max value among subtrees */
43 };
44 
45 WS_DLL_PUBLIC
47 wmem_itree_new(wmem_allocator_t *allocator)
48 G_GNUC_MALLOC;
49 
50 
52 WS_DLL_PUBLIC
53 bool
55 
56 
61 WS_DLL_PUBLIC
62 void
63 wmem_itree_insert(wmem_itree_t *tree, const uint64_t low, const uint64_t high, void *data);
64 
65 
66 /*
67  * Save results in a wmem_list with the scope passed as a parameter.
68  * wmem_list_t is always allocated even if there is no result
69  */
70 WS_DLL_PUBLIC
72 wmem_itree_find_intervals(wmem_itree_t *tree, wmem_allocator_t *allocator, uint64_t low, uint64_t high);
73 
74 
78 void
80 
84 #ifdef __cplusplus
85 }
86 #endif /* __cplusplus */
87 
88 #endif /* __WMEM_INTERVAL_TREE_H__ */
89 
90 /*
91  * Editor modelines - https://www.wireshark.org/tools/modelines.html
92  *
93  * Local variables:
94  * c-basic-offset: 4
95  * tab-width: 8
96  * indent-tabs-mode: nil
97  * End:
98  *
99  * vi: set shiftwidth=4 tabstop=8 expandtab:
100  * :indentSize=4:tabSize=8:noTabs=true:
101  */
WS_DLL_PUBLIC bool wmem_itree_is_empty(wmem_itree_t *tree)
Definition: wmem_interval_tree.c:99
void wmem_print_itree(wmem_itree_t *tree)
Definition: wmem_interval_tree.c:173
WS_DLL_PUBLIC void wmem_itree_insert(wmem_itree_t *tree, const uint64_t low, const uint64_t high, void *data)
Definition: wmem_interval_tree.c:120
Definition: wmem_allocator.h:27
Definition: wmem_list.c:23
Definition: wmem_interval_tree.h:39
Definition: wmem_tree-int.h:48