Scroll to navigation

MDEX_INIT(3) Librecast Programmer's Manual MDEX_INIT(3)

NAME

mdex_init, mtree_free - initialize and free a multicast index

LIBRARY

Librecast library (liblibrecast, -llibrecast)

SYNOPSIS

#include <librecast/mdex.h>
mdex_t *mdex_init(size_t entries);
void mdex_free(mdex_t *mdex);

Compile and link with -llibrecast.

DESCRIPTION

The mdex_init function initializes a multicast index.

entries gives the initial number of entries to allocate. This is just a hint for initial memory allocation, and the index will be resized as required.

RETURN VALUE

mdex_init() returns a pointer to a mdex_t handle, which should be freed by passing to mdex_free() when done. On error, NULL is returned, and errno is set to indicate the error.

The mdex_free() function returns no value, and preserves errno.

ERRORS

Not enough space/cannot allocate memory (POSIX.1-2001).

SEE ALSO

mdex_get(3), mdex_put(3), mdex_del(3)

2023-06-20 LIBRECAST