Archived
1
0
Fork 0

rbtree.c: don't call delete_fn in rbtree_insert, return a value on duplicate keys instead.

for design reasons, it's more flexible to not use callbacks for this purpose.
This commit is contained in:
Henrik Hautakoski 2011-02-01 10:53:17 +01:00
parent 7dcfd815ee
commit ae3dec912a
2 changed files with 4 additions and 11 deletions

View file

@ -39,8 +39,7 @@ Functions
`rbtree_insert()`::
Creates and inserts a new node in the tree. +
If provided, calls `rbtree->delete_fn` if a node should be updated. +
Returns nonzero if a new node was inserted or updated, zero otherwise.
Returns a positive value if the node was inserted, zero if the key already exists in the tree and a negative value if an error occured.
NOTE: The memory pointed to by the 'key' pointer is *not* copied so you must ensure that it has a infinite lifetime.