zsetup.3 - libzahl - big integer library
(HTM) git clone git://git.suckless.org/libzahl
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
zsetup.3 (1141B)
---
1 .TH ZSETUP 3 libzahl
2 .SH NAME
3 zsetup - Prepare libzahl for use
4 .SH SYNOPSIS
5 .nf
6 #include <zahl.h>
7
8 void zsetup(jmp_buf \fIenv\fP);
9 .fi
10 .SH DESCRIPTION
11 .B zsetup
12 initializes all memory that is used internally by
13 libzahl.
14 .B zsetup
15 is also used to specify where to return in case
16 an error occurs.
17 You must call this function before using libzahl.
18 .P
19 .B zsetup
20 can be used multiple times, the
21 .I env
22 from the last call is in effect.
23 .SH EXAMPLE
24 .nf
25 #include <zahl.h>
26 #include <setjmp.h>
27
28 int
29 main(void)
30 {
31 jmp_buf env;
32
33 if (setjmp(env)) {
34 perror(0);
35 zunsetup();
36 return 1;
37 }
38 zsetup(env);
39
40 /* Use libzahl ... */
41
42 zunsetup();
43 return 0;
44 }
45 .fi
46 .SH RATIONALE
47 To increase the performance of libzahl, it uses
48 dedicated memory for temporary storage.
49 .PP
50 libzahl performs checks internally, this is
51 necessary. It would decrease the performance
52 of the program that uses libzahl, if it had
53 to check that libzahl's functions returned
54 successfully, it would also produce cluttered
55 code. Instead libzahl goes directly to the
56 part of the program that handles the error.
57 .SH SEE ALSO
58 .BR zunsetup (3),
59 .BR zinit (3),
60 .BR zerror (3),
61 .BR zperror (3)