This source file includes following definitions.
- gl_rbtree_omap_check_invariants
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #include <config.h>
19
20
21 #include "gl_rbtree_omap.h"
22
23 #include <stdlib.h>
24
25
26
27
28 #define CONTAINER_T gl_omap_t
29 #define CONTAINER_IMPL gl_omap_impl
30 #define CONTAINER_IMPL_BASE gl_omap_impl_base
31 #define NODE_IMPL gl_omap_node_impl
32 #define NODE_T gl_omap_node_t
33 #define NODE_PAYLOAD_FIELDS \
34 const void *key; \
35 const void *value;
36 #define NODE_PAYLOAD_PARAMS \
37 const void *key, const void *value
38 #define NODE_PAYLOAD_ASSIGN(node) \
39 node->key = key; \
40 node->value = value;
41 #define NODE_PAYLOAD_DISPOSE(container, node) \
42 if (container->base.kdispose_fn != NULL) \
43 container->base.kdispose_fn (node->key);
44
45 #include "gl_rbtree_ordered.h"
46
47
48 #include "gl_anytree_omap.h"
49
50
51 void
52 gl_rbtree_omap_check_invariants (gl_omap_t map)
53 {
54 size_t counter = 0;
55 if (map->root != NULL)
56 check_invariants (map->root, NULL, &counter);
57 if (!(map->count == counter))
58 abort ();
59 }
60
61 const struct gl_omap_implementation gl_rbtree_omap_implementation =
62 {
63 gl_tree_nx_create_empty,
64 gl_tree_size,
65 gl_tree_search,
66 gl_tree_search_atleast,
67 gl_tree_nx_getput,
68 gl_tree_getremove,
69 gl_tree_omap_free,
70 gl_tree_iterator,
71 gl_tree_iterator_next,
72 gl_tree_iterator_free
73 };