MTREE_BUILD(3)
π MTREE_BUILD π
okay so bestie, welcome to the Librecast Programmer's Manual β this is mtree_build(3) and it's lowkey iconic. let's get into it β¨
πΈ NAME πΈ
mtree_build β build a merkle tree from base data
π LIBRARY π
Librecast library (liblibrecast, -llibrecast)
β¨ SYNOPSIS β¨
#include <librecast/mtree.h>
int mtree_build(mtree_t *tree, void * const data, q_t *q);
Compile and link with -llibrecast.
π¦ DESCRIPTION π¦
so the mtree_build function builds a merkle tree β that's the tree β and no, you can't just show up with an empty vibe, it has to have been previously initialized with mtree_init(3) first. the base data it's building from is the stuff pointed to by data. periodt.
now, the q situation, listen up:
- if
qis notNULL, it must point to a queueq_tstructure that was previously initialized withq_init(3). this queue is gonna have jobs enqueued to it to build the tree. normally you'd pair this with a threadpool created withq_pool_create(3), where the threads are all callingq_job_seek(3). that's the whole squad working together, main character energy fr fr π₯ - if
qisNULL, then the creation and destruction of a queue and threadpool gets handled automatically for you. no cap, it just does it. you don't have to lift a finger π
π RETURN VALUE π
okay so here's the tea:
mtree_init()returns zero on success. on error,-1is returned, anderrnois set to indicate the error.- the
mtree_free()function returns no value, and preserveserrno.
and yes bestie, the return value section really is out here talking aboutmtree_init()andmtree_free()β that's literally what the page says, iykyk π
π ERRORS π
TODO
(yeah. that's it. that's the whole section. we love a mystery π«Ά)
π BUGS π
No error handling.
not me reading that and going π β that's verbatim what the manpage says, bestie. it's giving "we'll deal with it later" and honestly? relatable.
π EXAMPLE π
TODO
(it's giving unfinished homework but we move β¨)
β SEE ALSO β
π SIGN-OFF π
and that's the whole page, bestie!! this lil masterpiece is from the LIBRECAST era, dated 2023-06-20, and it's page MTREE_BUILD(3) of the Librecast Programmer's Manual. go build that merkle tree, you absolute legend π§ππΈ
π¦ where this page comes from
- debian trixie: liblibrecast-dev 0.9.1-1 Β· GPL-2.0-only OR GPL-3.0-only
- nixos 26.05: librecast 0.11.2
- nixpkgs unstable: librecast 0.11.2
- ubuntu noble: liblibrecast-dev 0.8.0-1.1build1 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu questing: liblibrecast-dev 0.9.1-1
- ubuntu resolute: liblibrecast-dev 0.11.2-2 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu stonking: liblibrecast-dev 0.11.2-2build1 Β· GPL-2.0-only OR GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms