myMPD
Internal API documentation
Loading...
Searching...
No Matches
rax_extras.h File Reference

RAX helper functions. More...

#include "dist/rax/rax.h"
#include "dist/sds/sds.h"
Include dependency graph for rax_extras.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef void(* rax_free_data_callback) (void *data)

Functions

sds rax_insert_no_dup (rax *r, sds key, void *data)
void rax_free_data (rax *r, rax_free_data_callback free_cb)
void rax_free_sds_data (rax *r)

Detailed Description

RAX helper functions.

Typedef Documentation

◆ rax_free_data_callback

typedef void(* rax_free_data_callback) (void *data)

Definition of callback to free radix data

Function Documentation

◆ rax_free_data()

void rax_free_data ( rax * r,
rax_free_data_callback free_cb )

Frees a rax tree and its data with a free_cb

Parameters
rrax tree to free
free_cbcallback to free data or NULL to free a pointer

◆ rax_free_sds_data()

void rax_free_sds_data ( rax * r)

Frees a rax tree and its sds data

Parameters
rrax tree to free

◆ rax_insert_no_dup()

sds rax_insert_no_dup ( rax * r,
sds key,
void * data )

Inserts the key into the radix tree. Appends random chars to the key until it is uniq.

Parameters
rrax tree to insert
keykey to insert
datadata to insert
Returns
the key that was inserted (may be different from the original key if it was a duplicate)