Fixing a little error in the Randist documentation
[Math-GSL.git] / Errno.i
blob897649aea63d60b989c87def6629d6c54d36428a
1 %module "Math::GSL::Errno"
2 %{
3 #include "gsl/gsl_errno.h"
4 #include "gsl/gsl_types.h"
5 %}
6 %include "gsl/gsl_errno.h"
7 %include "gsl/gsl_types.h"
9 %perlcode %{
10 @EXPORT_OK = qw/
11 gsl_error gsl_stream_printf gsl_strerror gsl_set_error_handler
12 gsl_set_error_handler_off gsl_set_stream_handler gsl_set_stream
13 $GSL_SUCCESS $GSL_FAILURE $GSL_CONTINUE $GSL_EDOM
14 $GSL_ERANGE $GSL_EFAULT $GSL_EINVAL $GSL_EFAILED
15 $GSL_EFACTOR $GSL_ESANITY $GSL_ENOMEM $GSL_EBADFUNC
16 $GSL_ERUNAWAY $GSL_EMAXITER $GSL_EZERODIV $GSL_EBADTOL
17 $GSL_ETOL $GSL_EUNDRFLW $GSL_EOVRFLW $GSL_ELOSS
18 $GSL_EROUND $GSL_EBADLEN $GSL_ENOTSQR $GSL_ESING
19 $GSL_EDIVERGE $GSL_EUNSUP $GSL_EUNIMPL $GSL_ECACHE
20 $GSL_ETABLE $GSL_ENOPROG $GSL_ENOPROGJ $GSL_ETOLF
21 $GSL_ETOLX $GSL_ETOLG $GSL_EOF
23 %EXPORT_TAGS = ( all => [ @EXPORT_OK ] );
25 =head1 NAME
27 Math::GSL::Errno - Error Handling
29 =cut
31 =head1 SYNOPSIS
33 use Math::GSL::Errno qw/:all/;
34 gsl_set_error_handler_off();
36 print gsl_strerror($GSL_EDOM) . "\n";
38 =head1 STATUS CODES
40 =over 4
42 =item * $GSL_SUCCESS
44 =item * $GSL_FAILURE
46 =item * $GSL_CONTINUE
48 =item * $GSL_EDOM - Domain error; used by mathematical functions when an argument value does not fall into the domain over which the function is defined (like EDOM in the C library)
50 =item * $GSL_ERANGE - Range error; used by mathematical functions when the result value is not representable because of overflow or underflow (like ERANGE in the C library)
52 =item * $GSL_EFAULT
54 =item * $GSL_EINVAL - Invalid argument. This is used to indicate various kinds of problems with passing the wrong argument to a library function (like EINVAL in the C library).Invalid argument. This is used to indicate various kinds of problems with passing the wrong argument to a library function (like EINVAL in the C library).
56 =item * $GSL_EFAILED
58 =item * $GSL_EFACTOR
60 =item * $GSL_ESANITY
62 =item * $GSL_ENOMEM - No memory available. The system cannot allocate more virtual memory because its capacity is full (like ENOMEM in the C library). This error is reported when a GSL routine encounters problems when trying to allocate memory with malloc.
64 =item * $GSL_EBADFUNC
66 =item * $GSL_ERUNAWAY
68 =item * $GSL_EMAXITER
70 =item * $GSL_EZERODIV
72 =item * $GSL_EBADTOL
74 =item * $GSL_ETOL
76 =item * $GSL_EUNDRFLW
78 =item * $GSL_EOVRFLW
80 =item * $GSL_ELOSS
82 =item * $GSL_EROUND
84 =item * $GSL_EBADLEN
86 =item * $GSL_ENOTSQR
88 =item * $GSL_ESING
90 =item * $GSL_EDIVERGE
92 =item * $GSL_EUNSUP
94 =item * $GSL_EUNIMPL
96 =item * $GSL_ECACHE
98 =item * $GSL_ETABLE
100 =item * $GSL_ENOPROG
102 =item * $GSL_ENOPROGJ
104 =item * $GSL_ETOLF
106 =item * $GSL_ETOLX
108 =item * $GSL_ETOLG
110 =item * $GSL_EOF
112 =back
114 =head1 FUNCTIONS
116 =over
118 =item * gsl_error
120 =item * gsl_stream_printf
122 =item * gsl_strerror($gsl_errno) - This function returns a pointer to a string describing the error code gsl_errno. For example, print ("error: gsl_strerror ($status)\n"); would print an error message like error: output range error for a status value of GSL_ERANGE.
124 =item * gsl_set_error_handler
126 =item * gsl_set_error_handler_off() - This function turns off the error handler by defining an error handler which does nothing. This will cause the program to continue after any error, so the return values from any library routines must be checked. This is the recommended behavior for production programs. The previous handler is returned (so that you can restore it later).
128 =item * gsl_set_stream_handler
130 =item * gsl_set_stream
132 =back
134 =cut