-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathskiplist.h
More file actions
51 lines (39 loc) · 1.58 KB
/
Copy pathskiplist.h
File metadata and controls
51 lines (39 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef __skiplist_h
#define __skiplist_h
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
struct skiplist;
extern const size_t skiplist_size;
struct skiplist * skiplist_create( size_t memsize
, void *mem
, size_t maxlevel
, size_t itemsize
, bool (*leq)(void*,void*)
, void (*cpy)(void*,void*)
, void *allocator
, void *(*alloc)(void*,size_t)
, void (*dealloc)(void*,void*)
, void *rndgen
, uint64_t (*rnd)(void*)
);
void skiplist_destroy(struct skiplist *sl);
bool skiplist_insert(struct skiplist *sl, void *v);
void *skiplist_find( struct skiplist *sl
, void *v
, bool (*eq)(void*,void*)
);
bool skiplist_remove( struct skiplist *sl
, void *v
, bool (*eq)(void*,void*)
);
void skiplist_enum( struct skiplist *sl
, void *cc
, void (*fn)(void*,void*) );
void skiplist_enum_debug( struct skiplist *sl
, void *cc
, void (*fn)( void *cc
, uint8_t level
, int tp // -1, 0, +1 for -inf, regular, +inf nodes
, void *v ) );
#endif