Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
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
21extern "C" {
22#endif /* __cplusplus */
23
36struct _wmem_tree_t;
37typedef struct _wmem_tree_t wmem_itree_t;
38
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
55WS_DLL_PUBLIC
58G_GNUC_MALLOC;
59
60
69WS_DLL_PUBLIC
70bool
72
73
86WS_DLL_PUBLIC
87void
88wmem_itree_insert(wmem_itree_t *tree, const uint64_t low, const uint64_t high, void *data);
89
90
104WS_DLL_PUBLIC
106wmem_itree_find_intervals(wmem_itree_t *tree, wmem_allocator_t *allocator, uint64_t low, uint64_t high);
107
108
118void
120
124#ifdef __cplusplus
125}
126#endif /* __cplusplus */
127
128#endif /* __WMEM_INTERVAL_TREE_H__ */
129
130/*
131 * Editor modelines - https://www.wireshark.org/tools/modelines.html
132 *
133 * Local variables:
134 * c-basic-offset: 4
135 * tab-width: 8
136 * indent-tabs-mode: nil
137 * End:
138 *
139 * vi: set shiftwidth=4 tabstop=8 expandtab:
140 * :indentSize=4:tabSize=8:noTabs=true:
141 */
WS_DLL_PUBLIC wmem_itree_t * wmem_itree_new(wmem_allocator_t *allocator) G_GNUC_MALLOC
Create a new interval tree using the specified memory allocator.
Definition wmem_interval_tree.c:91
WS_DLL_PUBLIC wmem_list_t * wmem_itree_find_intervals(wmem_itree_t *tree, wmem_allocator_t *allocator, uint64_t low, uint64_t high)
Find all intervals overlapping a given range in an interval tree.
Definition wmem_interval_tree.c:161
WS_DLL_PUBLIC bool wmem_itree_is_empty(wmem_itree_t *tree)
Check whether an interval tree is empty.
Definition wmem_interval_tree.c:99
void wmem_print_itree(wmem_itree_t *tree)
Print all intervals stored in the interval 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)
Insert an interval into the interval tree.
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