| 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
21 extern "C" {
22#endif /* __cplusplus */
23
36 struct _wmem_tree_t;
37
46 typedef struct _wmem_tree_t wmem_itree_t;
47
54 struct _wmem_range_t {
55 uint64_t low;
56 uint64_t high;
57 uint64_t max_edge;
58};
59
60
71WS_DLL_PUBLIC
72 wmem_itree_t *
73 wmem_itree_new(wmem_allocator_t *allocator)
74G_GNUC_MALLOC;
75
76
85WS_DLL_PUBLIC
86 bool
87 wmem_itree_is_empty(wmem_itree_t *tree);
88
89
102WS_DLL_PUBLIC
103 void
104 wmem_itree_insert(wmem_itree_t *tree, const uint64_t low, const uint64_t high, void *data);
105
106
120WS_DLL_PUBLIC
121 wmem_list_t *
122 wmem_itree_find_intervals(wmem_itree_t *tree, wmem_allocator_t *allocator, uint64_t low, uint64_t high);
123
124
134 void
135 wmem_print_itree(wmem_itree_t *tree);
136
140#ifdef __cplusplus
141}
142#endif /* __cplusplus */
143
144#endif /* __WMEM_INTERVAL_TREE_H__ */
145
146/*
147 * Editor modelines - https://www.wireshark.org/tools/modelines.html
148 *
149 * Local variables:
150 * c-basic-offset: 4
151 * tab-width: 8
152 * indent-tabs-mode: nil
153 * End:
154 *
155 * vi: set shiftwidth=4 tabstop=8 expandtab:
156 * :indentSize=4:tabSize=8:noTabs=true:
157 */
wmem_itree_new
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
wmem_itree_find_intervals
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
wmem_itree_is_empty
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
wmem_print_itree
void wmem_print_itree(wmem_itree_t *tree)
Print all intervals stored in the interval tree.
Definition wmem_interval_tree.c:173
wmem_itree_insert
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
_wmem_allocator_t
Internal memory allocator interface used by the wmem subsystem.
Definition wmem_allocator.h:34
_wmem_list_t
Definition wmem_list.c:23
_wmem_range_t
Represents a numeric range used in wmem's internal range tree.
Definition wmem_interval_tree.h:54
_wmem_range_t::low
uint64_t low
Definition wmem_interval_tree.h:55
_wmem_range_t::high
uint64_t high
Definition wmem_interval_tree.h:56
_wmem_range_t::max_edge
uint64_t max_edge
Definition wmem_interval_tree.h:57
_wmem_tree_t
Internal representation of a wmem balanced tree.
Definition wmem_tree-int.h:81
wmem_core.h
wmem_list.h
wmem_tree.h