فهرست منبع

structure: add SAvl, a wrapper around CAvl assuming links are pointers

ambrop7 13 سال پیش
والد
کامیت
b4a52f1a7a
6فایلهای تغییر یافته به همراه430 افزوده شده و 0 حذف شده
  1. 40 0
      structure/SAvl.h
  2. 69 0
      structure/SAvl_decl.h
  3. 81 0
      structure/SAvl_footer.h
  4. 85 0
      structure/SAvl_header.h
  5. 137 0
      structure/SAvl_impl.h
  6. 18 0
      structure/SAvl_tree.h

+ 40 - 0
structure/SAvl.h

@@ -0,0 +1,40 @@
+/**
+ * @file SAvl.h
+ * @author Ambroz Bizjak <ambrop7@gmail.com>
+ * 
+ * @section LICENSE
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the
+ *    names of its contributors may be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef BADVPN_SAVL_H
+#define BADVPN_SAVL_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include <structure/CAvl.h>
+#include <misc/merge.h>
+#include <misc/debug.h>
+
+#endif

+ 69 - 0
structure/SAvl_decl.h

@@ -0,0 +1,69 @@
+/**
+ * @file SAvl_decl.h
+ * @author Ambroz Bizjak <ambrop7@gmail.com>
+ * 
+ * @section LICENSE
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the
+ *    names of its contributors may be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "SAvl_header.h"
+
+typedef SAvlEntry *SAvl__TreeLink;
+
+#include "SAvl_tree.h"
+#include <structure/CAvl_decl.h>
+
+typedef struct {
+    SAvl__Tree tree;
+} SAvl;
+
+typedef struct {
+    SAvlEntry *child[2];
+    SAvlEntry *parent;
+    int8_t balance;
+#if CAVL_PARAM_FEATURE_COUNTS
+    SAvlCount count;
+#endif
+} SAvlNode;
+
+static void SAvl_Init (SAvl *o);
+static int SAvl_Insert (SAvl *o, SAvlArg arg, SAvlEntry *entry, SAvlEntry **out_existing);
+static void SAvl_Remove (SAvl *o, SAvlArg arg, SAvlEntry *entry);
+#if !SAVL_PARAM_FEATURE_NOKEYS
+static SAvlEntry * SAvl_Lookup (const SAvl *o, SAvlArg arg, SAvlKey key);
+static SAvlEntry * SAvl_LookupExact (const SAvl *o, SAvlArg arg, SAvlKey key);
+#endif
+static SAvlEntry * SAvl_GetFirst (const SAvl *o, SAvlArg arg);
+static SAvlEntry * SAvl_GetLast (const SAvl *o, SAvlArg arg);
+static SAvlEntry * SAvl_GetNext (const SAvl *o, SAvlArg arg, SAvlEntry *entry);
+static SAvlEntry * SAvl_GetPrev (const SAvl *o, SAvlArg arg, SAvlEntry *entry);
+static int SAvl_IsEmpty (const SAvl *o);
+static void SAvl_Verify (const SAvl *o, SAvlArg arg);
+#if SAVL_PARAM_FEATURE_COUNTS
+static SAvlCount SAvl_Count (const SAvl *o, SAvlArg arg);
+static SAvlCount SAvl_IndexOf (const SAvl *o, SAvlArg arg, SAvlEntry *entry);
+static SAvlEntry * SAvl_GetAt (const SAvl *o, SAvlArg arg, SAvlCount index);
+#endif
+
+#include "SAvl_footer.h"

+ 81 - 0
structure/SAvl_footer.h

@@ -0,0 +1,81 @@
+/**
+ * @file SAvl_footer.h
+ * @author Ambroz Bizjak <ambrop7@gmail.com>
+ * 
+ * @section LICENSE
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the
+ *    names of its contributors may be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#undef SAVL_PARAM_NAME
+#undef SAVL_PARAM_FEATURE_COUNTS
+#undef SAVL_PARAM_FEATURE_NOKEYS
+#undef SAVL_PARAM_TYPE_ENTRY
+#undef SAVL_PARAM_TYPE_KEY
+#undef SAVL_PARAM_TYPE_ARG
+#undef SAVL_PARAM_TYPE_COUNT
+#undef SAVL_PARAM_VALUE_COUNT_MAX
+#undef SAVL_PARAM_FUN_COMPARE_ENTRIES
+#undef SAVL_PARAM_FUN_COMPARE_KEY_ENTRY
+#undef SAVL_PARAM_MEMBER_NODE
+
+#undef SAvl
+#undef SAvlEntry
+#undef SAvlArg
+#undef SAvlKey
+#undef SAvlCount
+#undef SAvlNode
+
+#undef SAvl_Init
+#undef SAvl_Insert
+#undef SAvl_Remove
+#undef SAvl_Lookup
+#undef SAvl_LookupExact
+#undef SAvl_GetFirst
+#undef SAvl_GetLast
+#undef SAvl_GetNext
+#undef SAvl_GetPrev
+#undef SAvl_IsEmpty
+#undef SAvl_Verify
+#undef SAvl_Count
+#undef SAvl_IndexOf
+#undef SAvl_GetAt
+
+#undef SAvl__Tree
+#undef SAvl__TreeRef
+#undef SAvl__TreeLink
+#undef SAvl__TreeDeref
+#undef SAvl__Tree_Init
+#undef SAvl__Tree_Insert
+#undef SAvl__Tree_Remove
+#undef SAvl__Tree_Lookup
+#undef SAvl__Tree_LookupExact
+#undef SAvl__Tree_GetFirst
+#undef SAvl__Tree_GetLast
+#undef SAvl__Tree_GetNext
+#undef SAvl__Tree_GetPrev
+#undef SAvl__Tree_IsEmpty
+#undef SAvl__Tree_Verify
+#undef SAvl__Tree_Count
+#undef SAvl__Tree_IndexOf
+#undef SAvl__Tree_GetAt

+ 85 - 0
structure/SAvl_header.h

@@ -0,0 +1,85 @@
+/**
+ * @file SAvl_header.h
+ * @author Ambroz Bizjak <ambrop7@gmail.com>
+ * 
+ * @section LICENSE
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the
+ *    names of its contributors may be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// Preprocessor inputs. All types must be typedef names unless stated otherwise.
+// SAVL_PARAM_NAME - name of this data structure
+// SAVL_PARAM_FEATURE_COUNTS - whether to keep count information (0 or 1)
+// SAVL_PARAM_FEATURE_NOKEYS - define to 1 if there is no need for a lookup operation
+// SAVL_PARAM_TYPE_ENTRY - type of entry. This can also be a struct (e.g.: struct Foo).
+// SAVL_PARAM_TYPE_KEY - type of key (ignored if SAVL_PARAM_FEATURE_NOKEYS)
+// SAVL_PARAM_TYPE_ARG - type of argument pass through to callbacks
+// SAVL_PARAM_TYPE_COUNT - type of count (only if SAVL_PARAM_FEATURE_COUNTS)
+// SAVL_PARAM_VALUE_COUNT_MAX - maximum value of count (of type SAVL_PARAM_TYPE_COUNT) (only if SAVL_PARAM_FEATURE_COUNTS)
+// SAVL_PARAM_FUN_COMPARE_ENTRIES(arg, entry1, entry2) - compare two entries; returns -1/0/1
+// SAVL_PARAM_FUN_COMPARE_KEY_ENTRY(arg, key1, entry2) - compare key and entry; returns -1/0/1 (ignored if SAVL_PARAM_FEATURE_NOKEYS) 
+// SAVL_PARAM_MEMBER_NODE - node member in entry
+
+// types
+#define SAvl SAVL_PARAM_NAME
+#define SAvlEntry SAVL_PARAM_TYPE_ENTRY
+#define SAvlArg SAVL_PARAM_TYPE_ARG
+#define SAvlKey SAVL_PARAM_TYPE_KEY
+#define SAvlCount SAVL_PARAM_TYPE_COUNT
+#define SAvlNode MERGE(SAvl, Node)
+
+// public functions
+#define SAvl_Init MERGE(SAvl, _Init)
+#define SAvl_Insert MERGE(SAvl, _Insert)
+#define SAvl_Remove MERGE(SAvl, _Remove)
+#define SAvl_Lookup MERGE(SAvl, _Lookup)
+#define SAvl_LookupExact MERGE(SAvl, _LookupExact)
+#define SAvl_GetFirst MERGE(SAvl, _GetFirst)
+#define SAvl_GetLast MERGE(SAvl, _GetLast)
+#define SAvl_GetNext MERGE(SAvl, _GetNext)
+#define SAvl_GetPrev MERGE(SAvl, _GetPrev)
+#define SAvl_IsEmpty MERGE(SAvl, _IsEmpty)
+#define SAvl_Verify MERGE(SAvl, _Verify)
+#define SAvl_Count MERGE(SAvl, _Count)
+#define SAvl_IndexOf MERGE(SAvl, _IndexOf)
+#define SAvl_GetAt MERGE(SAvl, _GetAt)
+
+// internal stuff
+#define SAvl__Tree MERGE(SAvl, __Tree)
+#define SAvl__TreeRef MERGE(SAvl, __TreeRef)
+#define SAvl__TreeLink MERGE(SAvl, __TreeLink)
+#define SAvl__TreeDeref MERGE(SAvl, __TreeDeref)
+#define SAvl__Tree_Init MERGE(SAvl, __Tree_Init)
+#define SAvl__Tree_Insert MERGE(SAvl, __Tree_Insert)
+#define SAvl__Tree_Remove MERGE(SAvl, __Tree_Remove)
+#define SAvl__Tree_Lookup MERGE(SAvl, __Tree_Lookup)
+#define SAvl__Tree_LookupExact MERGE(SAvl, __Tree_LookupExact)
+#define SAvl__Tree_GetFirst MERGE(SAvl, __Tree_GetFirst)
+#define SAvl__Tree_GetLast MERGE(SAvl, __Tree_GetLast)
+#define SAvl__Tree_GetNext MERGE(SAvl, __Tree_GetNext)
+#define SAvl__Tree_GetPrev MERGE(SAvl, __Tree_GetPrev)
+#define SAvl__Tree_IsEmpty MERGE(SAvl, __Tree_IsEmpty)
+#define SAvl__Tree_Verify MERGE(SAvl, __Tree_Verify)
+#define SAvl__Tree_Count MERGE(SAvl, __Tree_Count)
+#define SAvl__Tree_IndexOf MERGE(SAvl, __Tree_IndexOf)
+#define SAvl__Tree_GetAt MERGE(SAvl, __Tree_GetAt)

+ 137 - 0
structure/SAvl_impl.h

@@ -0,0 +1,137 @@
+/**
+ * @file SAvl_impl.h
+ * @author Ambroz Bizjak <ambrop7@gmail.com>
+ * 
+ * @section LICENSE
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the
+ *    names of its contributors may be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "SAvl_header.h"
+
+#include "SAvl_tree.h"
+#include <structure/CAvl_impl.h>
+
+static void SAvl_Init (SAvl *o)
+{
+    SAvl__Tree_Init(&o->tree);
+}
+
+static int SAvl_Insert (SAvl *o, SAvlArg arg, SAvlEntry *entry, SAvlEntry **out_existing)
+{
+    ASSERT(entry)
+    
+    SAvl__TreeRef out_ref;
+    int res = SAvl__Tree_Insert(&o->tree, arg, SAvl__TreeDeref(arg, entry), &out_ref);
+    
+    if (out_existing) {
+        *out_existing = out_ref.link;
+    }
+    
+    return res;
+}
+
+static void SAvl_Remove (SAvl *o, SAvlArg arg, SAvlEntry *entry)
+{
+    ASSERT(entry)
+    
+    SAvl__Tree_Remove(&o->tree, arg, SAvl__TreeDeref(arg, entry));
+}
+
+#if !SAVL_PARAM_FEATURE_NOKEYS
+
+static SAvlEntry * SAvl_Lookup (const SAvl *o, SAvlArg arg, SAvlKey key)
+{
+    SAvl__TreeRef ref = SAvl__Tree_Lookup(&o->tree, arg, key);
+    return ref.link;
+}
+
+static SAvlEntry * SAvl_LookupExact (const SAvl *o, SAvlArg arg, SAvlKey key)
+{
+    SAvl__TreeRef ref = SAvl__Tree_LookupExact(&o->tree, arg, key);
+    return ref.link;
+}
+
+#endif
+
+static SAvlEntry * SAvl_GetFirst (const SAvl *o, SAvlArg arg)
+{
+    SAvl__TreeRef ref = SAvl__Tree_GetFirst(&o->tree, arg);
+    return ref.link;
+}
+
+static SAvlEntry * SAvl_GetLast (const SAvl *o, SAvlArg arg)
+{
+    SAvl__TreeRef ref = SAvl__Tree_GetLast(&o->tree, arg);
+    return ref.link;
+}
+
+static SAvlEntry * SAvl_GetNext (const SAvl *o, SAvlArg arg, SAvlEntry *entry)
+{
+    ASSERT(entry)
+    
+    SAvl__TreeRef ref = SAvl__Tree_GetNext(&o->tree, arg, SAvl__TreeDeref(arg, entry));
+    return ref.link;
+}
+
+static SAvlEntry * SAvl_GetPrev (const SAvl *o, SAvlArg arg, SAvlEntry *entry)
+{
+    ASSERT(entry)
+    
+    SAvl__TreeRef ref = SAvl__Tree_GetPrev(&o->tree, arg, SAvl__TreeDeref(arg, entry));
+    return ref.link;
+}
+
+static int SAvl_IsEmpty (const SAvl *o)
+{
+    return SAvl__Tree_IsEmpty(&o->tree);
+}
+
+static void SAvl_Verify (const SAvl *o, SAvlArg arg)
+{
+    return SAvl__Tree_Verify(&o->tree, arg);
+}
+
+#if SAVL_PARAM_FEATURE_COUNTS
+
+static SAvlCount SAvl_Count (const SAvl *o, SAvlArg arg)
+{
+    return SAvl__Tree_Count(&o->tree, arg);
+}
+
+static SAvlCount SAvl_IndexOf (const SAvl *o, SAvlArg arg, SAvlEntry *entry)
+{
+    ASSERT(entry)
+    
+    return SAvl__Tree_IndexOf(&o->tree, arg, SAvl__TreeDeref(arg, entry));
+}
+
+static SAvlEntry * SAvl_GetAt (const SAvl *o, SAvlArg arg, SAvlCount index)
+{
+    SAvl__TreeRef ref = SAvl__Tree_GetAt(&o->tree, arg, index);
+    return ref.link;
+}
+
+#endif
+
+#include "SAvl_footer.h"

+ 18 - 0
structure/SAvl_tree.h

@@ -0,0 +1,18 @@
+#define CAVL_PARAM_NAME SAvl__Tree
+#define CAVL_PARAM_FEATURE_COUNTS SAVL_PARAM_FEATURE_COUNTS
+#define CAVL_PARAM_FEATURE_KEYS_ARE_INDICES 0
+#define CAVL_PARAM_FEATURE_NOKEYS SAVL_PARAM_FEATURE_NOKEYS
+#define CAVL_PARAM_TYPE_ENTRY SAvlEntry
+#define CAVL_PARAM_TYPE_LINK SAvl__TreeLink
+#define CAVL_PARAM_TYPE_KEY SAvlKey
+#define CAVL_PARAM_TYPE_ARG SAvlArg
+#define CAVL_PARAM_TYPE_COUNT SAvlCount
+#define CAVL_PARAM_VALUE_COUNT_MAX SAVL_PARAM_VALUE_COUNT_MAX
+#define CAVL_PARAM_VALUE_NULL ((SAvl__TreeLink)NULL)
+#define CAVL_PARAM_FUN_DEREF(arg, link) (link)
+#define CAVL_PARAM_FUN_COMPARE_ENTRIES(arg, entry1, entry2) SAVL_PARAM_FUN_COMPARE_ENTRIES((arg), (entry1).link, (entry2).link)
+#define CAVL_PARAM_FUN_COMPARE_KEY_ENTRY(arg, key1, entry2) SAVL_PARAM_FUN_COMPARE_KEY_ENTRY((arg), (key1), (entry2).link)
+#define CAVL_PARAM_MEMBER_CHILD SAVL_PARAM_MEMBER_NODE . child
+#define CAVL_PARAM_MEMBER_BALANCE SAVL_PARAM_MEMBER_NODE . balance
+#define CAVL_PARAM_MEMBER_PARENT SAVL_PARAM_MEMBER_NODE . parent
+#define CAVL_PARAM_MEMBER_COUNT SAVL_PARAM_MEMBER_NODE . count