Skip to main content

Name

sl_remove — Remove a node by key

Synopsis

#include "skiplist.h"

| int **sl_remove** ( | sl, |   | |   | key, |   | |   | myfree); |   |

Skiplist * <var class="pdparam">sl</var>; const void * <var class="pdparam">key</var>; FreeFunc <var class="pdparam">myfree</var>;

Description

Remove node (and all it's clones) by key and free datum with the myfree function.

Parameters

sl

The Skiplist.

key

The key.

myfree

This is the optional, user-defined function that frees a data element in the skiplist. It is defined as: typedef void (*FreeFunc) (void *);

Return Value

On success this function returns the height of the resulting skiplist and 0 on error.

Threading

It is legal to call this function in any thread but skiplist functions are not thread safe.

See Also

Was this page helpful?