summaryrefslogtreecommitdiff
path: root/src/include/skalibs/avlnode.h
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2021-07-28 23:45:20 +0000
committerLaurent Bercot <ska@appnovation.com>2021-07-28 23:45:20 +0000
commit9592bfd0dda7c575de07bce2c7a81b8432d845a4 (patch)
tree57c66c3e0dfeb63cfd3ebfef18e30a2145ae3f88 /src/include/skalibs/avlnode.h
parentc15bccec3fd551583ff838673ba284ee6c7e788a (diff)
downloadskalibs-9592bfd0dda7c575de07bce2c7a81b8432d845a4.tar.xz
Huge incompatible changes.
- Obsolete skalibs/environ.h and skalibs/getpeereid.h removed. - rc4 and md5 removed. - All *_t types renamed to avoid treading on POSIX namespace. - subgetopt() renamed to lgetopt(). - signal functions reworked; skasigaction removed; sig_stack removed - Various functions removed: skaoffsetof(), selfpipe_untrap() - New posixplz function: munmap_void. Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/include/skalibs/avlnode.h')
-rw-r--r--src/include/skalibs/avlnode.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/include/skalibs/avlnode.h b/src/include/skalibs/avlnode.h
index 554a185..42c544b 100644
--- a/src/include/skalibs/avlnode.h
+++ b/src/include/skalibs/avlnode.h
@@ -1,17 +1,18 @@
/* ISC license. */
-#ifndef AVLNODE_H
-#define AVLNODE_H
+#ifndef SKALIBS_AVLNODE_H
+#define SKALIBS_AVLNODE_H
#include <stdint.h>
+
#include <skalibs/gccattributes.h>
#include <skalibs/functypes.h>
#define AVLNODE_MAXDEPTH 49 /* enough for 2^32 nodes in the worst case */
-typedef int avliterfunc_t (uint32_t, unsigned int, void *) ;
-typedef avliterfunc_t *avliterfunc_t_ref ;
+typedef int avliter_func (uint32_t, unsigned int, void *) ;
+typedef avliter_func *avliter_func_ref ;
typedef struct avlnode_s avlnode, *avlnode_ref ;
struct avlnode_s
@@ -24,8 +25,8 @@ struct avlnode_s
#define AVLNODE_ZERO { .data = 0, .child = { UINT32_MAX, UINT32_MAX }, .balance = 0 }
extern avlnode const avlnode_zero ;
-extern uint32_t avlnode_searchnode (avlnode const *, uint32_t, uint32_t, void const *, dtokfunc_t_ref, cmpfunc_t_ref, void *) ;
-extern int avlnode_search (avlnode const *, uint32_t, uint32_t, void const *, uint32_t *, dtokfunc_t_ref, cmpfunc_t_ref, void *) ;
+extern uint32_t avlnode_searchnode (avlnode const *, uint32_t, uint32_t, void const *, dtok_func_ref, cmp_func_ref, void *) ;
+extern int avlnode_search (avlnode const *, uint32_t, uint32_t, void const *, uint32_t *, dtok_func_ref, cmp_func_ref, void *) ;
extern unsigned int avlnode_height (avlnode const *, uint32_t, uint32_t) gccattr_pure ;
extern uint32_t avlnode_extremenode (avlnode const *, uint32_t, uint32_t, int) gccattr_pure ;
@@ -36,11 +37,11 @@ extern int avlnode_extreme (avlnode const *, uint32_t, uint32_t, int, uint32_t *
#define avlnode_min(s, max, r, data) avlnode_extreme(s, max, (r), 0, data)
#define avlnode_max(s, max, r, data) avlnode_extreme(s, max, (r), 1, data)
-extern uint32_t avlnode_insertnode (avlnode *, uint32_t, uint32_t, uint32_t, dtokfunc_t_ref, cmpfunc_t_ref, void *) ;
-extern uint32_t avlnode_delete (avlnode *, uint32_t, uint32_t *, void const *, dtokfunc_t_ref, cmpfunc_t_ref, void *) ;
+extern uint32_t avlnode_insertnode (avlnode *, uint32_t, uint32_t, uint32_t, dtok_func_ref, cmp_func_ref, void *) ;
+extern uint32_t avlnode_delete (avlnode *, uint32_t, uint32_t *, void const *, dtok_func_ref, cmp_func_ref, void *) ;
-extern uint32_t avlnode_iter_nocancel (avlnode *, uint32_t, uint32_t, uint32_t, avliterfunc_t_ref, void *) ;
+extern uint32_t avlnode_iter_nocancel (avlnode *, uint32_t, uint32_t, uint32_t, avliter_func_ref, void *) ;
#define avlnode_iter(tree, max, root, f, stuff) (avlnode_iter_nocancel(tree, max, max, root, f, stuff) == (max))
-extern int avlnode_iter_withcancel (avlnode *, uint32_t, uint32_t, avliterfunc_t_ref, avliterfunc_t_ref, void *) ;
+extern int avlnode_iter_withcancel (avlnode *, uint32_t, uint32_t, avliter_func_ref, avliter_func_ref, void *) ;
#endif