/usr/share/doc/wcslib-doc/html/diagnostics.html is in wcslib-doc 4.24-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.8"/>
<title>WCSLIB: Diagnostic output</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">WCSLIB
 <span id="projectnumber">4.23.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.8 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li class="current"><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="index.html">WCSLIB 4.24 and PGSBOX 4.24</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">Diagnostic output </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>All <a class="el" href="overview.html">WCSLIB</a> functions return a status value, each of which is associated with a fixed error message which may be used for diagnostic output. For example </p><pre class="fragment"> int status;
struct wcsprm wcs;
...
if ((status = wcsset(&wcs)) {
fprintf(stderr, "ERROR %d from wcsset(): %s.\n", status, wcs_errmsg[status]);
return status;
}
</pre><p> This might produce output like </p><pre class="fragment">ERROR 5 from wcsset(): Invalid parameter value.
</pre><p> The error messages are provided as global variables with names of the form <em>cel_errmsg</em>, <em>prj_errmsg</em>, etc. by including the relevant header file.</p>
<p>As of version 4.8, courtesy of Michael Droettboom <a class="el" href="software.html">(pywcs)</a>, WCSLIB has a second error messaging system which provides more detailed information about errors, including the function, source file, and line number where the error occurred. For example, </p><pre class="fragment"> struct wcsprm wcs;
/* Enable wcserr and send messages to stderr. */
wcserr_enable(1);
wcsprintf_set(stderr);
...
if (wcsset(&wcs) {
wcsperr(&wcs);
return wcs.err->status;
}
</pre><p> In this example, if an error was generated in one of the <a class="el" href="prj_8h.html#ad43dbc765c63162d0af2b9285b8a434f" title="Generic setup routine for the prjprm struct. ">prjset()</a> functions, <a class="el" href="wcs_8h.html#a8fe5dcd9927240dc0348b850ee662367" title="Print error messages from a wcsprm struct. ">wcsperr()</a> would print an error traceback starting with <a class="el" href="wcs_8h.html#ae5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct. ">wcsset()</a>, then <a class="el" href="cel_8h.html#ab0f67d1727750616f71c7bfcb3a037b6" title="Setup routine for the celprm struct. ">celset()</a>, and finally the particular projection-setting function that generated the error. For each of them it would print the status return value, function name, source file, line number, and an error message which may be more specific and informative than the general error messages reported in the first example. For example, in response to a deliberately generated error, the <code>twcs</code> test program, which tests wcserr among other things, produces a traceback similar to this: </p><pre class="fragment">ERROR 5 in wcsset() at line 1564 of file wcs.c:
Invalid parameter value.
ERROR 2 in celset() at line 196 of file cel.c:
Invalid projection parameters.
ERROR 2 in bonset() at line 5727 of file prj.c:
Invalid parameters for Bonne's projection.
</pre><p>Each of the <a class="el" href="structs.html">structs</a> in <a class="el" href="overview.html">WCSLIB</a> includes a pointer, called <em>err</em>, to a wcserr struct. When an error occurs, a struct is allocated and error information stored in it. The wcserr pointers and the <a class="el" href="memory.html">memory</a> allocated for them are managed by the routines that manage the various structs such as <a class="el" href="wcs_8h.html#a2afc8255fde0965dddaa374463666d45" title="Default constructor for the wcsprm struct. ">wcsini()</a> and <a class="el" href="wcs_8h.html#a4ab38bc642c4656f62c43acf84a849f1" title="Destructor for the wcsprm struct. ">wcsfree()</a>.</p>
<p>wcserr messaging is an opt-in system enabled via <a class="el" href="wcserr_8h.html#a1691b8bd184d40ca6fda255be078fa53" title="Enable/disable error messaging. ">wcserr_enable()</a>, as in the example above. If enabled, when an error occurs it is the user's responsibility to free the memory allocated for the error message using <a class="el" href="wcs_8h.html#a4ab38bc642c4656f62c43acf84a849f1" title="Destructor for the wcsprm struct. ">wcsfree()</a>, <a class="el" href="cel_8h.html#a39bb7bf8e545c200191d51884ecfb89b" title="Destructor for the celprm struct. ">celfree()</a>, <a class="el" href="prj_8h.html#a50db1538981df162709b81be0b2961ab" title="Destructor for the prjprm struct. ">prjfree()</a>, etc. Failure to do so before the struct goes out of scope will result in memory leaks (if execution continues beyond the error). </p>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Sep 19 2014 01:25:24 for WCSLIB by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.8
</small></address>
</body>
</html>
|