.TH MDEX_INIT 3 2023-06-20 "LIBRECAST" "Librecast Programmer's Manual" .SH NAME mdex_init, mtree_free \- initialize and free a multicast index .SH LIBRARY Librecast library .RI ( liblibrecast ", " \-llibrecast ) .SH SYNOPSIS .nf .B #include .PP .BI "mdex_t *mdex_init(size_t " entries ");" .BI "void mdex_free(mdex_t " *mdex ");" .fi .PP Compile and link with \fI\-llibrecast\fP. .SH DESCRIPTION The .BR mdex_init function initializes a multicast index. .PP .IR 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. .SH RETURN VALUE .BR mdex_init () returns a pointer to a .IR mdex_t handle, which should be freed by passing to .BR mdex_free () when done. On error, NULL is returned, and .I errno is set to indicate the error. .PP The .BR mdex_free () function returns no value, and preserves .IR errno . .SH ERRORS .TP .BR ENOMEM Not enough space/cannot allocate memory (POSIX.1-2001). .PP .SH SEE ALSO .BR mdex_get (3), .BR mdex_put (3), .BR mdex_del (3)