mtree_init(3)

mtree_init3

Initialize and free a merkle tree

Usage

#include <librecast/mtree.h>

int mtree_init(mtree_t *tree, size_t sz); void mtree_free(mtree_t *tree);

Compile and link with -llibrecast.

Library

Librecast library (liblibrecast, -llibrecast)

Overview

The tree_init function initializes the merkle tree structure tree with base data size sz. sz is the size in bytes of the base file or data which will be used to build the tree by calling mtree_build(3).

Return value

mtree_init() returns zero on success. On error, -1 is returned, and errno is set to indicate the error.

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

Errors

ENOMEM

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

From liblibrecast-dev 0.9.1-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.