.TH MTREE_INIT 3 2023-06-20 "LIBRECAST" "Librecast Programmer's Manual" .SH NAME mtree_init, mtree_free \- initialize and free a merkle tree .SH LIBRARY Librecast library .RI ( liblibrecast ", " \-llibrecast ) .SH SYNOPSIS .nf .B #include .PP .BI "int mtree_init(mtree_t " *tree ", size_t " sz ");" .BI "void mtree_free(mtree_t " *tree ");" .fi .PP Compile and link with \fI\-llibrecast\fP. .SH DESCRIPTION The .BR tree_init function initializes the merkle tree structure .IR tree with base data size .IR sz . sz is the size in bytes of the base file or data which will be used to build the tree by calling .BR mtree_build (3). .SH RETURN VALUE .BR mtree_init () returns zero on success. On error, -1 is returned, and .I errno is set to indicate the error. .PP The .BR mtree_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)