.TH MDEX_PUT 3 2023-06-20 "LIBRECAST" "Librecast Programmer's Manual" .SH NAME mdex_put \- insert an entry into a multicast index .SH LIBRARY Librecast library .RI ( liblibrecast ", " \-llibrecast ) .SH SYNOPSIS .nf .B #include .PP .BI "int mdex_put(mdex_t " *mdex ", unsigned char " *hash ", size_t " hashlen ", mdex_entry_t " *entry ");" .fi .PP Compile and link with \fI\-llibrecast\fP. .SH DESCRIPTION The .BR mdex_put function stores the value of .IR entry in the multicast index .IR mdex , using .IR hash (of length .IR hashlen ) as the key. .PP .IR entry may be NULL, and an entry will still be created. .SH RETURN VALUE .BR mdex_put () returns zero on success. On error, \-1 is returned, and .I errno is set to indicate the error. .SH ERRORS .TP .BR EINVAL Invalid argument. Both .IR mdex and .IR hash are required (not NULL), and .IR hashlen > 0. .PP .BR ENOMEM Not enough space/cannot allocate memory (POSIX.1-2001). .PP .SH SEE ALSO .BR mdex_init (3), .BR mdex_free (3), .BR mdex_get (3), .BR mdex_del (3), .BR lc_share (3)