1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>gsignond API Reference Manual: Utility functions</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
7 <link rel="home" href="index.html" title="gsignond API Reference Manual">
8 <link rel="up" href="ch07.html" title="Miscellaneous">
9 <link rel="prev" href="gsignond-Logging.html" title="Logging">
10 <link rel="next" href="object-tree.html" title="Object Hierarchy">
11 <meta name="generator" content="GTK-Doc V1.20 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="10"><tr valign="middle">
16 <td width="100%" align="left" class="shortcuts">
17 <a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
18 <a href="#gsignond-Utility-functions.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span>
19 <a href="#gsignond-Utility-functions.object-hierarchy" class="shortcut">Object Hierarchy</a></span>
21 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
22 <td><a accesskey="u" href="ch07.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
23 <td><a accesskey="p" href="gsignond-Logging.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
24 <td><a accesskey="n" href="object-tree.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
26 <div class="refentry">
27 <a name="gsignond-Utility-functions"></a><div class="titlepage"></div>
28 <div class="refnamediv"><table width="100%"><tr>
30 <h2><span class="refentrytitle"><a name="gsignond-Utility-functions.top_of_page"></a>Utility functions</span></h2>
31 <p>Utility functions — miscellaneous utility functions</p>
33 <td class="gallery_image" valign="top" align="right"></td>
35 <div class="refsect1">
36 <a name="gsignond-Utility-functions.functions"></a><h2>Functions</h2>
37 <div class="informaltable"><table width="100%" border="0">
39 <col width="150px" class="functions_return">
40 <col class="functions_name">
44 <td class="function_type">
45 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
47 <td class="function_name">
48 <a class="link" href="gsignond-Utility-functions.html#gsignond-wipe-file" title="gsignond_wipe_file ()">gsignond_wipe_file</a> <span class="c_punctuation">()</span>
52 <td class="function_type">
53 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
55 <td class="function_name">
56 <a class="link" href="gsignond-Utility-functions.html#gsignond-wipe-directory" title="gsignond_wipe_directory ()">gsignond_wipe_directory</a> <span class="c_punctuation">()</span>
60 <td class="function_type">
61 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
63 <td class="function_name">
64 <a class="link" href="gsignond-Utility-functions.html#gsignond-generate-nonce" title="gsignond_generate_nonce ()">gsignond_generate_nonce</a> <span class="c_punctuation">()</span>
68 <td class="function_type">
69 <a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *
71 <td class="function_name">
72 <a class="link" href="gsignond-Utility-functions.html#gsignond-sequence-to-variant" title="gsignond_sequence_to_variant ()">gsignond_sequence_to_variant</a> <span class="c_punctuation">()</span>
76 <td class="function_type">
77 <a href="http://library.gnome.org/devel/glib/unstable/glib-Sequences.html#GSequence"><span class="returnvalue">GSequence</span></a> *
79 <td class="function_name">
80 <a class="link" href="gsignond-Utility-functions.html#gsignond-variant-to-sequence" title="gsignond_variant_to_sequence ()">gsignond_variant_to_sequence</a> <span class="c_punctuation">()</span>
84 <td class="function_type">
85 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> **
87 <td class="function_name">
88 <a class="link" href="gsignond-Utility-functions.html#gsignond-sequence-to-array" title="gsignond_sequence_to_array ()">gsignond_sequence_to_array</a> <span class="c_punctuation">()</span>
92 <td class="function_type">
93 <a href="http://library.gnome.org/devel/glib/unstable/glib-Sequences.html#GSequence"><span class="returnvalue">GSequence</span></a> *
95 <td class="function_name">
96 <a class="link" href="gsignond-Utility-functions.html#gsignond-array-to-sequence" title="gsignond_array_to_sequence ()">gsignond_array_to_sequence</a> <span class="c_punctuation">()</span>
100 <td class="function_type">
101 <a href="http://library.gnome.org/devel/glib/unstable/glib-Sequences.html#GSequence"><span class="returnvalue">GSequence</span></a> *
103 <td class="function_name">
104 <a class="link" href="gsignond-Utility-functions.html#gsignond-copy-array-to-sequence" title="gsignond_copy_array_to_sequence ()">gsignond_copy_array_to_sequence</a> <span class="c_punctuation">()</span>
108 <td class="function_type">
109 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
111 <td class="function_name">
112 <a class="link" href="gsignond-Utility-functions.html#gsignond-is-host-in-domain" title="gsignond_is_host_in_domain ()">gsignond_is_host_in_domain</a> <span class="c_punctuation">()</span>
118 <div class="refsect1">
119 <a name="gsignond-Utility-functions.object-hierarchy"></a><h2>Object Hierarchy</h2>
123 <div class="refsect1">
124 <a name="gsignond-Utility-functions.includes"></a><h2>Includes</h2>
125 <pre class="synopsis">#include <gsignond/gsignond-utils.h>
128 <div class="refsect1">
129 <a name="gsignond-Utility-functions.description"></a><h2>Description</h2>
130 <p>Miscellaneous utility functions are described below.</p>
132 <div class="refsect1">
133 <a name="gsignond-Utility-functions.functions_details"></a><h2>Functions</h2>
134 <div class="refsect2">
135 <a name="gsignond-wipe-file"></a><h3>gsignond_wipe_file ()</h3>
136 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
137 gsignond_wipe_file (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>);</pre>
138 <p>This function securely wipes the contents of the file, by overwriting it with
139 0's, then 1's, then random data. The file is then removed.</p>
140 <div class="refsect3">
141 <a name="id-1.8.4.7.2.5"></a><h4>Parameters</h4>
142 <div class="informaltable"><table width="100%" border="0">
144 <col width="150px" class="parameters_name">
145 <col class="parameters_description">
146 <col width="200px" class="parameters_annotations">
149 <td class="parameter_name"><p>filename</p></td>
150 <td class="parameter_description"><p>filename to wipe</p></td>
151 <td class="parameter_annotations"> </td>
155 <div class="refsect3">
156 <a name="id-1.8.4.7.2.6"></a><h4>Returns</h4>
157 <p> TRUE if wiping and removal was successful.</p>
162 <div class="refsect2">
163 <a name="gsignond-wipe-directory"></a><h3>gsignond_wipe_directory ()</h3>
164 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
165 gsignond_wipe_directory (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dirname</code></em>);</pre>
166 <p>This function securely wipes the contents of the directory by calling
167 <a class="link" href="gsignond-Utility-functions.html#gsignond-wipe-file" title="gsignond_wipe_file ()"><code class="function">gsignond_wipe_file()</code></a> on each file. It also removes links and empty directories but
168 does not recursively wipe them.</p>
169 <div class="refsect3">
170 <a name="id-1.8.4.7.3.5"></a><h4>Parameters</h4>
171 <div class="informaltable"><table width="100%" border="0">
173 <col width="150px" class="parameters_name">
174 <col class="parameters_description">
175 <col width="200px" class="parameters_annotations">
178 <td class="parameter_name"><p>dirname</p></td>
179 <td class="parameter_description"><p>directory to wipe</p></td>
180 <td class="parameter_annotations"> </td>
184 <div class="refsect3">
185 <a name="id-1.8.4.7.3.6"></a><h4>Returns</h4>
186 <p> TRUE if wiping and removal was successful.</p>
191 <div class="refsect2">
192 <a name="gsignond-generate-nonce"></a><h3>gsignond_generate_nonce ()</h3>
193 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
194 gsignond_generate_nonce ();</pre>
195 <p>This function generates a random secure nonce using SHA1 HMAC.</p>
196 <div class="refsect3">
197 <a name="id-1.8.4.7.4.5"></a><h4>Returns</h4>
198 <p> the nonce in lowercase hexadecimal format, 40 bytes long. </p>
199 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
203 <div class="refsect2">
204 <a name="gsignond-sequence-to-variant"></a><h3>gsignond_sequence_to_variant ()</h3>
205 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *
206 gsignond_sequence_to_variant (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Sequences.html#GSequence"><span class="type">GSequence</span></a> *seq</code></em>);</pre>
207 <p>Convert a string sequence to a variant.</p>
208 <div class="refsect3">
209 <a name="id-1.8.4.7.5.5"></a><h4>Parameters</h4>
210 <div class="informaltable"><table width="100%" border="0">
212 <col width="150px" class="parameters_name">
213 <col class="parameters_description">
214 <col width="200px" class="parameters_annotations">
217 <td class="parameter_name"><p>seq</p></td>
218 <td class="parameter_description"><p>Sequence of strings to convert</p></td>
219 <td class="parameter_annotations"> </td>
223 <div class="refsect3">
224 <a name="id-1.8.4.7.5.6"></a><h4>Returns</h4>
225 <p> <a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> of type "as". </p>
226 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
230 <div class="refsect2">
231 <a name="gsignond-variant-to-sequence"></a><h3>gsignond_variant_to_sequence ()</h3>
232 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Sequences.html#GSequence"><span class="returnvalue">GSequence</span></a> *
233 gsignond_variant_to_sequence (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> *var</code></em>);</pre>
234 <p>Convert variant containing string array to sequence.</p>
235 <div class="refsect3">
236 <a name="id-1.8.4.7.6.5"></a><h4>Parameters</h4>
237 <div class="informaltable"><table width="100%" border="0">
239 <col width="150px" class="parameters_name">
240 <col class="parameters_description">
241 <col width="200px" class="parameters_annotations">
244 <td class="parameter_name"><p>var</p></td>
245 <td class="parameter_description"><p>Variant of "as" to convert</p></td>
246 <td class="parameter_annotations"> </td>
250 <div class="refsect3">
251 <a name="id-1.8.4.7.6.6"></a><h4>Returns</h4>
252 <p> <a href="http://library.gnome.org/devel/glib/unstable/glib-Sequences.html#GSequence"><span class="type">GSequence</span></a> of strings. </p>
253 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
257 <div class="refsect2">
258 <a name="gsignond-sequence-to-array"></a><h3>gsignond_sequence_to_array ()</h3>
259 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> **
260 gsignond_sequence_to_array (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Sequences.html#GSequence"><span class="type">GSequence</span></a> *seq</code></em>);</pre>
261 <p>Convert sequence of strings to null-terminated string array.</p>
262 <div class="refsect3">
263 <a name="id-1.8.4.7.7.5"></a><h4>Parameters</h4>
264 <div class="informaltable"><table width="100%" border="0">
266 <col width="150px" class="parameters_name">
267 <col class="parameters_description">
268 <col width="200px" class="parameters_annotations">
271 <td class="parameter_name"><p>seq</p></td>
272 <td class="parameter_description"><p>Sequence of strings to convert</p></td>
273 <td class="parameter_annotations"> </td>
277 <div class="refsect3">
278 <a name="id-1.8.4.7.7.6"></a><h4>Returns</h4>
279 <p> Null-terminated array of strings. </p>
280 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
284 <div class="refsect2">
285 <a name="gsignond-array-to-sequence"></a><h3>gsignond_array_to_sequence ()</h3>
286 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Sequences.html#GSequence"><span class="returnvalue">GSequence</span></a> *
287 gsignond_array_to_sequence (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **items</code></em>);</pre>
288 <p>Convert null-terminated array of strings to a sequence.</p>
289 <div class="refsect3">
290 <a name="id-1.8.4.7.8.5"></a><h4>Parameters</h4>
291 <div class="informaltable"><table width="100%" border="0">
293 <col width="150px" class="parameters_name">
294 <col class="parameters_description">
295 <col width="200px" class="parameters_annotations">
298 <td class="parameter_name"><p>items</p></td>
299 <td class="parameter_description"><p> Null-terminated array of strings to convert. </p></td>
300 <td class="parameter_annotations"><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td>
304 <div class="refsect3">
305 <a name="id-1.8.4.7.8.6"></a><h4>Returns</h4>
306 <p> <a href="http://library.gnome.org/devel/glib/unstable/glib-Sequences.html#GSequence"><span class="type">GSequence</span></a> of strings. </p>
307 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
311 <div class="refsect2">
312 <a name="gsignond-copy-array-to-sequence"></a><h3>gsignond_copy_array_to_sequence ()</h3>
313 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Sequences.html#GSequence"><span class="returnvalue">GSequence</span></a> *
314 gsignond_copy_array_to_sequence (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **items</code></em>);</pre>
315 <p>Copy null-terminated array of strings to a sequence.</p>
316 <div class="refsect3">
317 <a name="id-1.8.4.7.9.5"></a><h4>Parameters</h4>
318 <div class="informaltable"><table width="100%" border="0">
320 <col width="150px" class="parameters_name">
321 <col class="parameters_description">
322 <col width="200px" class="parameters_annotations">
325 <td class="parameter_name"><p>items</p></td>
326 <td class="parameter_description"><p>Null-terminated array of strings to copy</p></td>
327 <td class="parameter_annotations"> </td>
331 <div class="refsect3">
332 <a name="id-1.8.4.7.9.6"></a><h4>Returns</h4>
333 <p> <a href="http://library.gnome.org/devel/glib/unstable/glib-Sequences.html#GSequence"><span class="type">GSequence</span></a> of strings. </p>
334 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
338 <div class="refsect2">
339 <a name="gsignond-is-host-in-domain"></a><h3>gsignond_is_host_in_domain ()</h3>
340 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
341 gsignond_is_host_in_domain (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *host</code></em>,
342 <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *domain</code></em>);</pre>
343 <p>Checks if <em class="parameter"><code>host</code></em>
344 belongs to <em class="parameter"><code>domain</code></em>
346 <div class="refsect3">
347 <a name="id-1.8.4.7.10.5"></a><h4>Parameters</h4>
348 <div class="informaltable"><table width="100%" border="0">
350 <col width="150px" class="parameters_name">
351 <col class="parameters_description">
352 <col width="200px" class="parameters_annotations">
356 <td class="parameter_name"><p>domain</p></td>
357 <td class="parameter_description"><p>a domain name</p></td>
358 <td class="parameter_annotations"> </td>
361 <td class="parameter_name"><p>host</p></td>
362 <td class="parameter_description"><p>a host name</p></td>
363 <td class="parameter_annotations"> </td>
368 <div class="refsect3">
369 <a name="id-1.8.4.7.10.6"></a><h4>Returns</h4>
375 <div class="refsect1">
376 <a name="gsignond-Utility-functions.other_details"></a><h2>Types and Values</h2>
381 Generated by GTK-Doc V1.20</div>