Wireshark  4.3.0
The Wireshark network protocol analyzer
wmem_tree-int.h
Go to the documentation of this file.
1 
13 #ifndef __WMEM_TREE_INT_H__
14 #define __WMEM_TREE_INT_H__
15 
16 #include "wmem_tree.h"
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif /* __cplusplus */
21 
22 typedef enum _wmem_node_color_t {
23  WMEM_NODE_COLOR_RED,
24  WMEM_NODE_COLOR_BLACK
25 } wmem_node_color_t;
26 
27 
29  struct _wmem_tree_node_t *parent;
30  struct _wmem_tree_node_t *left;
31  struct _wmem_tree_node_t *right;
32 
33  const void *key;
34  void *data;
35 
36  wmem_node_color_t color;
37  bool is_subtree;
38  bool is_removed;
39 
40 
41 };
42 
43 typedef struct _wmem_tree_node_t wmem_tree_node_t;
44 
45 
46 typedef struct _wmem_itree_node_t wmem_itree_node_t;
47 
48 struct _wmem_tree_t {
49  wmem_allocator_t *metadata_allocator;
50  wmem_allocator_t *data_allocator;
51  wmem_tree_node_t *root;
52  unsigned metadata_scope_cb_id;
53  unsigned data_scope_cb_id;
54 
55  void (*post_rotation_cb)(wmem_tree_node_t *);
56 };
57 
58 typedef int (*compare_func)(const void *a, const void *b);
59 
61 wmem_tree_insert(wmem_tree_t *tree, const void *key, void *data, compare_func cmp);
62 
63 typedef struct _wmem_range_t wmem_range_t;
64 
65 bool
66 wmem_itree_range_overlap(const wmem_range_t *r1, const wmem_range_t *r2);
67 
68 #ifdef __cplusplus
69 }
70 #endif /* __cplusplus */
71 
72 #endif /* __WMEM_TREE__INTERNALS_H__ */
73 
74 /*
75  * Editor modelines - https://www.wireshark.org/tools/modelines.html
76  *
77  * Local variables:
78  * c-basic-offset: 4
79  * tab-width: 8
80  * indent-tabs-mode: nil
81  * End:
82  *
83  * vi: set shiftwidth=4 tabstop=8 expandtab:
84  * :indentSize=4:tabSize=8:noTabs=true:
85  */
Definition: wmem_allocator.h:27
Definition: wmem_interval_tree.h:39
Definition: wmem_tree-int.h:28
Definition: wmem_tree-int.h:48