mtree_build(3)

mtree_build3

Build a merkle tree from base data

Usage

#include <librecast/mtree.h>

int mtree_build(mtree_t *tree, void * const data, q_t *q);

Compile and link with -llibrecast.

Library

Librecast library (liblibrecast, -llibrecast)

Overview

The mtree_build function builds a merkle tree tree which was previously initialized with mtree_init(3) from the base data pointed to by data.

If q is not NULL, it must point to a queue q_t structure previously initialized with q_init(3). This queue will have jobs enqueued to build the tree. This is normally used in conjunction with a threadpool created with q_pool_create(3) with threads all calling q_job_seek(3).

If q is NULL, the creation and destruction of a queue and threadpool will be handled automatically.

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

TODO

Examples

TODO

Bugs

No error handling.

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