summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/my_tree.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/my_tree.h b/include/my_tree.h
index ca207932c73..3aeef20e0ad 100644
--- a/include/my_tree.h
+++ b/include/my_tree.h
@@ -30,6 +30,15 @@ extern "C" {
#define tree_set_pointer(element,ptr) *((uchar **) (element+1))=((uchar*) (ptr))
+/*
+ A tree with its flag set to TREE_ONLY_DUPS behaves differently on inserting
+ an element that is not in the tree:
+ the element is not added at all, but instead tree_insert() returns a special
+ address TREE_ELEMENT_UNIQUE as an indication that the function has not failed
+ due to lack of memory.
+*/
+
+#define TREE_ELEMENT_UNIQUE ((TREE_ELEMENT *) 1)
#define TREE_NO_DUPS 1
#define TREE_ONLY_DUPS 2