From a1a1d9ed137c8e404e7f0bd41804099ef18b9267 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 29 Feb 2016 15:34:38 +0100 Subject: Add a number of man pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- man/zsetup.3 | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 man/zsetup.3 (limited to 'man/zsetup.3') diff --git a/man/zsetup.3 b/man/zsetup.3 new file mode 100644 index 0000000..df81556 --- /dev/null +++ b/man/zsetup.3 @@ -0,0 +1,59 @@ +.TH ZSETUP 3 libzahl +.SH NAME +zsetup - Prepare libzahl for use +.SH SYNOPSIS +.nf +#include + +void zsetup(jmp_buf \fIenv\fP); +.fi +.SH DESCRIPTION +.B zsetup +initializes all memory that is used internally by +libzahl. +.B zsetup +is also used to specify where to return in case +an error occurs. +You must call this function before using libzahl. +.P +.B zsetup +can be used multiple times, the +.I env +from the last call is in effect. +.SH EXAMPLE +.nf +#include +#include + +int +main(void) +{ + jmp_buf env; + + if (setjmp(env)) { + perror(0); + zunsetup(); + return 1; + } + zsetup(env); + + /* Use libzahl ... */ + + zunsetup(); + return 0; +} +.fi +.SH RATIONALE +To increase the performance of libzahl, it uses +dedicated memory for temporary storage. +.PP +libzahl performs checks internally, this is +necessary. It would decrease the performance +of the program that uses libzahl, if it had +to check that libzahl's functions returned +successfully, it would also produce cluttered +code. Instead libzahl goes directly to the +part of the program that handles the error. +.SH SEE ALSO +.BR zunsetup (3), +.BR zinit (3) -- cgit v1.2.3-70-g09d2