26fcca1e60bbb9b9f67abe89f8a5435637610687
[profile/ivi/gsignond.git] / docs / html / gsignond-Utility-functions.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>Utility functions</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="gsignond API Reference Manual">
8 <link rel="up" href="ch06.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.19.1 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
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">
17 <a href="#" class="shortcut">Top</a>
18                    | 
19                   <a href="#gsignond-Utility-functions.description" class="shortcut">Description</a>
20 </td>
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="ch06.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>
25 </tr></table>
26 <div class="refentry">
27 <a name="gsignond-Utility-functions"></a><div class="titlepage"></div>
28 <div class="refnamediv"><table width="100%"><tr>
29 <td valign="top">
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>
32 </td>
33 <td valign="top" align="right"></td>
34 </tr></table></div>
35 <div class="refsynopsisdiv">
36 <a name="gsignond-Utility-functions.synopsis"></a><h2>Synopsis</h2>
37 <pre class="synopsis">
38 #include &lt;gsignond/gsignond-utils.h&gt;
39
40 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *             <a class="link" href="gsignond-Utility-functions.html#gsignond-generate-nonce" title="gsignond_generate_nonce ()">gsignond_generate_nonce</a>             ();
41 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gsignond-Utility-functions.html#gsignond-wipe-directory" title="gsignond_wipe_directory ()">gsignond_wipe_directory</a>             (<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>);
42 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gsignond-Utility-functions.html#gsignond-wipe-file" title="gsignond_wipe_file ()">gsignond_wipe_file</a>                  (<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>);
43 </pre>
44 </div>
45 <div class="refsect1">
46 <a name="gsignond-Utility-functions.description"></a><h2>Description</h2>
47 <p>
48 Miscellaneous utility functions are described below.
49 </p>
50 </div>
51 <div class="refsect1">
52 <a name="gsignond-Utility-functions.details"></a><h2>Details</h2>
53 <div class="refsect2">
54 <a name="gsignond-generate-nonce"></a><h3>gsignond_generate_nonce ()</h3>
55 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *             gsignond_generate_nonce             ();</pre>
56 <p>
57 This function generates a random secure nonce using SHA1 HMAC.
58 </p>
59 <div class="variablelist"><table border="0">
60 <col align="left" valign="top">
61 <tbody><tr>
62 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
63 <td>the nonce in lowercase hexadecimal format, 40 bytes long. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
64 </td>
65 </tr></tbody>
66 </table></div>
67 </div>
68 <hr>
69 <div class="refsect2">
70 <a name="gsignond-wipe-directory"></a><h3>gsignond_wipe_directory ()</h3>
71 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            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>
72 <p>
73 This function securely wipes the contents of the directory by calling
74 <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 
75 does not recursively wipe them.
76 </p>
77 <div class="variablelist"><table border="0">
78 <col align="left" valign="top">
79 <tbody>
80 <tr>
81 <td><p><span class="term"><em class="parameter"><code>dirname</code></em> :</span></p></td>
82 <td>directory to wipe</td>
83 </tr>
84 <tr>
85 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
86 <td>TRUE if wiping and removal was successful.</td>
87 </tr>
88 </tbody>
89 </table></div>
90 </div>
91 <hr>
92 <div class="refsect2">
93 <a name="gsignond-wipe-file"></a><h3>gsignond_wipe_file ()</h3>
94 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            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>
95 <p>
96 This function securely wipes the contents of the file, by overwriting it with
97 0's, then 1's, then random data. The file is then removed.
98 </p>
99 <div class="variablelist"><table border="0">
100 <col align="left" valign="top">
101 <tbody>
102 <tr>
103 <td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td>
104 <td>filename to wipe</td>
105 </tr>
106 <tr>
107 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
108 <td>TRUE if wiping and removal was successful.</td>
109 </tr>
110 </tbody>
111 </table></div>
112 </div>
113 </div>
114 </div>
115 <div class="footer">
116 <hr>
117           Generated by GTK-Doc V1.19.1</div>
118 </body>
119 </html>