File: mtree_init.3

package info (click to toggle)
librecast 0.11.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,760 kB
  • sloc: ansic: 31,144; asm: 28,570; sh: 3,164; makefile: 713; python: 70
file content (45 lines) | stat: -rw-r--r-- 1,008 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
.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 <librecast/mtree.h>
.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)