This source file includes following definitions.
- gl_avltree_oset_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_avltree_oset.h"
22
23 #include <stdlib.h>
24
25
26
27
28 #define CONTAINER_T gl_oset_t
29 #define CONTAINER_IMPL gl_oset_impl
30 #define CONTAINER_IMPL_BASE gl_oset_impl_base
31 #define NODE_IMPL gl_oset_node_impl
32 #define NODE_T gl_oset_node_t
33 #define NODE_PAYLOAD_FIELDS \
34 const void *value;
35 #define NODE_PAYLOAD_PARAMS \
36 const void *elt
37 #define NODE_PAYLOAD_ASSIGN(node) \
38 node->value = elt;
39 #define NODE_PAYLOAD_DISPOSE(container, node) \
40 if (container->base.dispose_fn != NULL) \
41 container->base.dispose_fn (node->value);
42
43 #include "gl_avltree_ordered.h"
44
45
46 #include "gl_anytree_oset.h"
47
48
49 void
50 gl_avltree_oset_check_invariants (gl_oset_t set)
51 {
52 size_t counter = 0;
53 if (set->root != NULL)
54 check_invariants (set->root, NULL, &counter);
55 if (!(set->count == counter))
56 abort ();
57 }
58
59 const struct gl_oset_implementation gl_avltree_oset_implementation =
60 {
61 gl_tree_nx_create_empty,
62 gl_tree_size,
63 gl_tree_search,
64 gl_tree_search_atleast,
65 gl_tree_nx_add,
66 gl_tree_remove,
67 gl_tree_update,
68 gl_tree_oset_free,
69 gl_tree_iterator,
70 gl_tree_iterator_atleast,
71 gl_tree_iterator_next,
72 gl_tree_iterator_free
73 };