libzahl

big integer library
git clone git://git.suckless.org/libzahl
Log | Files | Refs | README | LICENSE

zerror.3 (1947B)


      1 .TH ZERROR 3 libzahl
      2 .SH NAME
      3 zerror - Get the error that caused a jump to the jmp_buf passed to zsetup
      4 .SH SYNOPSIS
      5 .nf
      6 #include <zahl.h>
      7 
      8 enum zerror zerror(const char **\fIdesc\fP);
      9 .fi
     10 .SH DESCRIPTION
     11 .B zerror
     12 shall return the error that caused a libzahl
     13 function to perform a long jump to the point
     14 specified to
     15 .BR zsetup (3).
     16 If
     17 .I desc
     18 is not
     19 .BR 0 ,
     20 a textual description is set stored in
     21 .IR *desc .
     22 This string may be changed by a subsequent
     23 call to
     24 .BR strerror (3),
     25 .BR perror (3),
     26 .BR zperror (3),
     27 and similar functions.
     28 .P
     29 Currently available
     30 .B "enum zerror"
     31 values are:
     32 .P
     33 .TP
     34 .B ZERROR_ERRNO_SET
     35 The error is stored in
     36 .IR errno .
     37 (The error may not be stored in
     38 .I errno
     39 until this function is called.)
     40 .TP
     41 .B ZERROR_0_POW_0
     42 An attempt to calculate the zeroth power of zero was made.
     43 This is on indeterminate form and cannot be calculated.
     44 The closest matching
     45 .I errno
     46 value is
     47 .BR EDOM .
     48 .TP
     49 .B ZERROR_0_DIV_0
     50 An attempt to divide zero by zero was made.
     51 This is on indeterminate form and cannot be calculated.
     52 The closest matching
     53 .I errno
     54 value is
     55 .BR EDOM .
     56 .TP
     57 .B ZERROR_DIV_0
     58 An attempt to divide a non-zero value by zero was made.
     59 This is undefined and cannot be calculated.
     60 This occurs if a divisor or a modulator is zero, or if
     61 zero is raised to a negative number.
     62 The closest matching
     63 .I errno
     64 value is
     65 .BR EDOM .
     66 .TP
     67 .B ZERROR_NEGATIVE
     68 A function argument that must not be negative was negative.
     69 The closest matching
     70 .I errno
     71 values is
     72 .B EDOM
     73 and
     74 .BR EINVAL .
     75 .TP
     76 .B ZERROR_INVALID_RADIX
     77 A radix less than 2 was selected, which is invalid because,
     78 radix 0 is impossible as there would be no digits, and radix
     79 1 is impossible because only the value 0 can be represented
     80 in radix 1. The closest matching
     81 .I errno
     82 values is
     83 .BR EINVAL .
     84 .SH RETURN VALUE
     85 .B zerror
     86 returns the error that caused libzahl a function to fail.
     87 .SH NOTES
     88 .I errno
     89 is only set if
     90 .B ZERROR_ERRNO_SET
     91 is returned.
     92 .SH SEE ALSO
     93 .BR zperror (3)