/usr/share/gtk-doc/html/libgwyapp/libgwyapp-Validate.html is in libgwyddion20-doc 2.26-1ubuntu1.
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 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Validate</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="Gwyddion Application Library Reference Manual">
<link rel="up" href="index.html" title="Gwyddion Application Library Reference Manual">
<link rel="prev" href="libgwyapp-file-module-utils.html" title="file module utils">
<link rel="next" href="libgwyapp-wait.html" title="wait">
<meta name="generator" content="GTK-Doc V1.8 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="libgwyapp-file-module-utils.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td> </td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Gwyddion Application Library Reference Manual</th>
<td><a accesskey="n" href="libgwyapp-wait.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#libgwyapp-Validate.synopsis" class="shortcut">Top</a>
|
<a href="#libgwyapp-Validate.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="libgwyapp-Validate"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libgwyapp-Validate.top_of_page"></a>Validate</span></h2>
<p>Validate — Check data sanity and consistency</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="libgwyapp-Validate.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include <app/gwyapp.h>
enum <a class="link" href="libgwyapp-Validate.html#GwyDataError" title="enum GwyDataError">GwyDataError</a>;
enum <a class="link" href="libgwyapp-Validate.html#GwyDataValidateFlags" title="enum GwyDataValidateFlags">GwyDataValidateFlags</a>;
<a class="link" href="libgwyapp-Validate.html#GwyDataValidationFailure" title="GwyDataValidationFailure">GwyDataValidationFailure</a>;
const <a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="libgwyapp-Validate.html#gwy-data-error-desrcibe" title="gwy_data_error_desrcibe ()">gwy_data_error_desrcibe</a> (<em class="parameter"><code><a class="link" href="libgwyapp-Validate.html#GwyDataError" title="enum GwyDataError"><span class="type">GwyDataError</span></a> error</code></em>);
<a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> * <a class="link" href="libgwyapp-Validate.html#gwy-data-validate" title="gwy_data_validate ()">gwy_data_validate</a> (<em class="parameter"><code><a href="./../libgwyddion/libgwyddion/GwyContainer.html"><span class="type">GwyContainer</span></a> *data</code></em>,
<em class="parameter"><code><a class="link" href="libgwyapp-Validate.html#GwyDataValidateFlags" title="enum GwyDataValidateFlags"><span class="type">GwyDataValidateFlags</span></a> flags</code></em>);
<span class="returnvalue">void</span> <a class="link" href="libgwyapp-Validate.html#gwy-data-validation-failure-list-free" title="gwy_data_validation_failure_list_free ()">gwy_data_validation_failure_list_free</a>
(<em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *list</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="libgwyapp-Validate.description"></a><h2>Description</h2>
<p>
A <a href="./../libgwyddion/libgwyddion/GwyContainer.html"><span class="type">GwyContainer</span></a> can be used to represent all sorts of data. However,
Gwyddion, the application, follows certain conventions in data organization.
Function <a class="link" href="libgwyapp-Validate.html#gwy-data-validate" title="gwy_data_validate ()"><code class="function">gwy_data_validate()</code></a> checks whether the data actually follows them.
This includes but is not limited to representability of keys in ASCII,
conformance to the key naming convention, types of objects and other items
corresponding to expectation, string values being valid UTF-8 and no stray
secondary data.
</p>
</div>
<div class="refsect1">
<a name="libgwyapp-Validate.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GwyDataError"></a><h3>enum GwyDataError</h3>
<pre class="programlisting">typedef enum {
GWY_DATA_ERROR_KEY_FORMAT = 1,
GWY_DATA_ERROR_KEY_CHARACTERS,
GWY_DATA_ERROR_KEY_UNKNOWN,
GWY_DATA_ERROR_KEY_ID,
GWY_DATA_ERROR_ITEM_TYPE,
GWY_DATA_ERROR_NON_UTF8_STRING,
GWY_DATA_ERROR_REF_COUNT,
GWY_DATA_ERROR_STRAY_SECONDARY_DATA,
} GwyDataError;
</pre>
<p>
Type of data validation errors.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="GWY-DATA-ERROR-KEY-FORMAT:CAPS"></a><span class="term"><code class="literal">GWY_DATA_ERROR_KEY_FORMAT</code></span></p></td>
<td>Key format is invalid (e.g. does not start
with <a href="./../libgwyddion/libgwyddion/GwyContainer.html#GWY-CONTAINER-PATHSEP:CAPS"><code class="literal">GWY_CONTAINER_PATHSEP</code></a>).
</td>
</tr>
<tr>
<td><p><a name="GWY-DATA-ERROR-KEY-CHARACTERS:CAPS"></a><span class="term"><code class="literal">GWY_DATA_ERROR_KEY_CHARACTERS</code></span></p></td>
<td>Key contains unprintable characters or
characters not representable in ASCII.
</td>
</tr>
<tr>
<td><p><a name="GWY-DATA-ERROR-KEY-UNKNOWN:CAPS"></a><span class="term"><code class="literal">GWY_DATA_ERROR_KEY_UNKNOWN</code></span></p></td>
<td>Key does not correspond to any data item known
to this version of Gwyddion.
</td>
</tr>
<tr>
<td><p><a name="GWY-DATA-ERROR-KEY-ID:CAPS"></a><span class="term"><code class="literal">GWY_DATA_ERROR_KEY_ID</code></span></p></td>
<td>Key corresponds to a data item with bogus id number.
</td>
</tr>
<tr>
<td><p><a name="GWY-DATA-ERROR-ITEM-TYPE:CAPS"></a><span class="term"><code class="literal">GWY_DATA_ERROR_ITEM_TYPE</code></span></p></td>
<td>Wrong item type (for instance an integer at key
<code class="literal">"/0/data"</code>).
</td>
</tr>
<tr>
<td><p><a name="GWY-DATA-ERROR-NON-UTF8-STRING:CAPS"></a><span class="term"><code class="literal">GWY_DATA_ERROR_NON_UTF8_STRING</code></span></p></td>
<td>String value is not valid UTF-8.
</td>
</tr>
<tr>
<td><p><a name="GWY-DATA-ERROR-REF-COUNT:CAPS"></a><span class="term"><code class="literal">GWY_DATA_ERROR_REF_COUNT</code></span></p></td>
<td>Reference count is higher than 1.
</td>
</tr>
<tr>
<td><p><a name="GWY-DATA-ERROR-STRAY-SECONDARY-DATA:CAPS"></a><span class="term"><code class="literal">GWY_DATA_ERROR_STRAY_SECONDARY_DATA</code></span></p></td>
<td>Secondary data item (e.g. mask,
selection or visibility) without a
corresponding valid primary data item.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.9</p>
</div>
<hr>
<div class="refsect2">
<a name="GwyDataValidateFlags"></a><h3>enum GwyDataValidateFlags</h3>
<pre class="programlisting">typedef enum {
GWY_DATA_VALIDATE_UNKNOWN = 1 << 0,
GWY_DATA_VALIDATE_REF_COUNT = 1 << 1,
GWY_DATA_VALIDATE_ALL = 0x0003,
GWY_DATA_VALIDATE_CORRECT = 1 << 16,
GWY_DATA_VALIDATE_NO_REPORT = 1 << 17,
} GwyDataValidateFlags;
</pre>
<p>
Flags controlling <a class="link" href="libgwyapp-Validate.html#gwy-data-validate" title="gwy_data_validate ()"><code class="function">gwy_data_validate()</code></a> behaviour.
</p>
<p>
Note passing <em class="parameter"><code>GWY_DATA_VALIDATE_NO_REPORT</code></em> is allowed only if
<em class="parameter"><code>GWY_DATA_VALIDATE_CORRECT</code></em> is present too.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="GWY-DATA-VALIDATE-UNKNOWN:CAPS"></a><span class="term"><code class="literal">GWY_DATA_VALIDATE_UNKNOWN</code></span></p></td>
<td>Report all unknown keys as
<a class="link" href="libgwyapp-Validate.html#GWY-DATA-ERROR-KEY-UNKNOWN:CAPS"><code class="literal">GWY_DATA_ERROR_KEY_UNKNOWN</code></a> errors. Note while
a data item unknown to the current version of
Gwyddion can come from a newer version therefore
it can be in certain sense valid.
</td>
</tr>
<tr>
<td><p><a name="GWY-DATA-VALIDATE-REF-COUNT:CAPS"></a><span class="term"><code class="literal">GWY_DATA_VALIDATE_REF_COUNT</code></span></p></td>
<td>Report all object items with reference count
higher than 1 as <a class="link" href="libgwyapp-Validate.html#GWY-DATA-ERROR-REF-COUNT:CAPS"><code class="literal">GWY_DATA_ERROR_REF_COUNT</code></a>
errors. Obviously this makes sense only with
`fresh' data containers.
</td>
</tr>
<tr>
<td><p><a name="GWY-DATA-VALIDATE-ALL:CAPS"></a><span class="term"><code class="literal">GWY_DATA_VALIDATE_ALL</code></span></p></td>
<td>All above flags combined.
</td>
</tr>
<tr>
<td><p><a name="GWY-DATA-VALIDATE-CORRECT:CAPS"></a><span class="term"><code class="literal">GWY_DATA_VALIDATE_CORRECT</code></span></p></td>
<td>Attempt to correct problems.
</td>
</tr>
<tr>
<td><p><a name="GWY-DATA-VALIDATE-NO-REPORT:CAPS"></a><span class="term"><code class="literal">GWY_DATA_VALIDATE_NO_REPORT</code></span></p></td>
<td>Do not report problems.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.9</p>
</div>
<hr>
<div class="refsect2">
<a name="GwyDataValidationFailure"></a><h3>GwyDataValidationFailure</h3>
<pre class="programlisting">typedef struct {
GwyDataError error;
GQuark key;
gchar *details;
} GwyDataValidationFailure;
</pre>
<p>
Information about one data validate error.
</p>
<p>
Note the structure may contain more private fields.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a class="link" href="libgwyapp-Validate.html#GwyDataError" title="enum GwyDataError"><span class="type">GwyDataError</span></a> <em class="structfield"><code><a name="GwyDataValidationFailure.error"></a>error</code></em>;</span></p></td>
<td>Error type.</td>
</tr>
<tr>
<td><p><span class="term"><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> <em class="structfield"><code><a name="GwyDataValidationFailure.key"></a>key</code></em>;</span></p></td>
<td>Key of the problematic data item.</td>
</tr>
<tr>
<td><p><span class="term"><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="GwyDataValidationFailure.details"></a>details</code></em>;</span></p></td>
<td>Error details, may be <a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for some types of <em class="parameter"><code>error</code></em>. This is
a dynamically allocated string owned by the caller, however, he
normally frees the complete errors lists with
<a class="link" href="libgwyapp-Validate.html#gwy-data-validation-failure-list-free" title="gwy_data_validation_failure_list_free ()"><code class="function">gwy_data_validation_failure_list_free()</code></a> which frees these fields
too.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.9</p>
</div>
<hr>
<div class="refsect2">
<a name="gwy-data-error-desrcibe"></a><h3>gwy_data_error_desrcibe ()</h3>
<pre class="programlisting">const <a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * gwy_data_error_desrcibe (<em class="parameter"><code><a class="link" href="libgwyapp-Validate.html#GwyDataError" title="enum GwyDataError"><span class="type">GwyDataError</span></a> error</code></em>);</pre>
<p>
Describes a data validation error type.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>Data validation error type.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>Error description as an untranslated string owned by the
library.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.9</p>
</div>
<hr>
<div class="refsect2">
<a name="gwy-data-validate"></a><h3>gwy_data_validate ()</h3>
<pre class="programlisting"><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> * gwy_data_validate (<em class="parameter"><code><a href="./../libgwyddion/libgwyddion/GwyContainer.html"><span class="type">GwyContainer</span></a> *data</code></em>,
<em class="parameter"><code><a class="link" href="libgwyapp-Validate.html#GwyDataValidateFlags" title="enum GwyDataValidateFlags"><span class="type">GwyDataValidateFlags</span></a> flags</code></em>);</pre>
<p>
Checks the contents of a data file.
</p>
<p>
If <a class="link" href="libgwyapp-Validate.html#GWY-DATA-VALIDATE-CORRECT:CAPS"><code class="literal">GWY_DATA_VALIDATE_CORRECT</code></a> is given in <em class="parameter"><code>flags</code></em>, correctable problems are
corrected. At present correctable problems are those that can be fixed
by removal of the offending data.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>Data container. It should not be managed by the data browser (yet)
if flags contain <a class="link" href="libgwyapp-Validate.html#GWY-DATA-VALIDATE-CORRECT:CAPS"><code class="literal">GWY_DATA_VALIDATE_CORRECT</code></a> (because things can
in principle break during the correction) or
<a class="link" href="libgwyapp-Validate.html#GWY-DATA-VALIDATE-REF-COUNT:CAPS"><code class="literal">GWY_DATA_VALIDATE_REF_COUNT</code></a> (because the application took some
references).</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
<td>Validation flags. Some influence what is checked, some determine
what to do when problems are found.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>List of errors found, free
with <a class="link" href="libgwyapp-Validate.html#gwy-data-validation-failure-list-free" title="gwy_data_validation_failure_list_free ()"><code class="function">gwy_data_validation_failure_list_free()</code></a>.
The list is independent on whether <a class="link" href="libgwyapp-Validate.html#GWY-DATA-VALIDATE-CORRECT:CAPS"><code class="literal">GWY_DATA_VALIDATE_CORRECT</code></a> is
given in flags, even though the offending items may be no longer
exist in the container after correction. If
<a class="link" href="libgwyapp-Validate.html#GWY-DATA-VALIDATE-NO-REPORT:CAPS"><code class="literal">GWY_DATA_VALIDATE_NO_REPORT</code></a> is present in flags, <a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is always
returned.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.9</p>
</div>
<hr>
<div class="refsect2">
<a name="gwy-data-validation-failure-list-free"></a><h3>gwy_data_validation_failure_list_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> gwy_data_validation_failure_list_free
(<em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *list</code></em>);</pre>
<p>
Frees a data validation failure list.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>list</code></em> :</span></p></td>
<td>Failure list returned by <a class="link" href="libgwyapp-Validate.html#gwy-data-validate" title="gwy_data_validate ()"><code class="function">gwy_data_validate()</code></a>.</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.9</p>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.8</div>
</body>
</html>
|