File: Error-Codes.html

package info (click to toggle)
gsl-ref-html 1.10-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,496 kB
  • ctags: 2,955
  • sloc: makefile: 33
file content (104 lines) | stat: -rw-r--r-- 4,969 bytes parent folder | download
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<html lang="en">
<head>
<title>Error Codes - GNU Scientific Library -- Reference Manual</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="GNU Scientific Library -- Reference Manual">
<meta name="generator" content="makeinfo 4.8">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Error-Handling.html" title="Error Handling">
<link rel="prev" href="Error-Reporting.html" title="Error Reporting">
<link rel="next" href="Error-Handlers.html" title="Error Handlers">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 The GSL Team.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``GNU General Public License'' and ``Free Software
Needs Free Documentation'', the Front-Cover text being ``A GNU Manual'',
and with the Back-Cover Text being (a) (see below).  A copy of the
license is included in the section entitled ``GNU Free Documentation
License''.

(a) The Back-Cover Text is: ``You have freedom to copy and modify this
GNU Manual, like GNU software.''-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<p>
<a name="Error-Codes"></a>
Next:&nbsp;<a rel="next" accesskey="n" href="Error-Handlers.html">Error Handlers</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Error-Reporting.html">Error Reporting</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Error-Handling.html">Error Handling</a>
<hr>
</div>

<h3 class="section">3.2 Error Codes</h3>

<p><a name="index-error-codes_002c-reserved-47"></a>The error code numbers returned by library functions are defined in
the file <samp><span class="file">gsl_errno.h</span></samp>.  They all have the prefix <code>GSL_</code> and
expand to non-zero constant integer values. Error codes above 1024 are
reserved for applications, and are not used by the library.  Many of
the error codes use the same base name as the corresponding error code
in the C library.  Here are some of the most common error codes,

   <p><a name="index-error-codes-48"></a>

<div class="defun">
&mdash; Macro: int <b>GSL_EDOM</b><var><a name="index-GSL_005fEDOM-49"></a></var><br>
<blockquote><p>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)
</p></blockquote></div>

<div class="defun">
&mdash; Macro: int <b>GSL_ERANGE</b><var><a name="index-GSL_005fERANGE-50"></a></var><br>
<blockquote><p>Range error; used by mathematical functions when the result value is not
representable because of overflow or underflow (like ERANGE in the C
library)
</p></blockquote></div>

<div class="defun">
&mdash; Macro: int <b>GSL_ENOMEM</b><var><a name="index-GSL_005fENOMEM-51"></a></var><br>
<blockquote><p>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 <code>malloc</code>. 
</p></blockquote></div>

<div class="defun">
&mdash; Macro: int <b>GSL_EINVAL</b><var><a name="index-GSL_005fEINVAL-52"></a></var><br>
<blockquote><p>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). 
</p></blockquote></div>

   <p>The error codes can be converted into an error message using the
function <code>gsl_strerror</code>.

<div class="defun">
&mdash; Function: const char * <b>gsl_strerror</b> (<var>const int gsl_errno</var>)<var><a name="index-gsl_005fstrerror-53"></a></var><br>
<blockquote><p>This function returns a pointer to a string describing the error code
<var>gsl_errno</var>. For example,

     <pre class="example">          printf ("error: %s\n", gsl_strerror (status));
</pre>
        <p class="noindent">would print an error message like <code>error: output range error</code> for a
status value of <code>GSL_ERANGE</code>. 
</p></blockquote></div>

<hr>The GNU Scientific Library - a free numerical library licensed under the GNU GPL<br>Back to the <a href="/software/gsl/">GNU Scientific Library Homepage</a></body></html>