re06.html 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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>&lt;GChecksum&gt;: </title>
  6. <meta name="generator" content="DocBook XSL Stylesheets V1.79.2">
  7. <link rel="home" href="index.html" title="">
  8. <link rel="up" href="ch01.html" title="GLib">
  9. <link rel="prev" href="re05.html" title="&lt;GBytes&gt;">
  10. <link rel="next" href="re07.html" title="&lt;%GLibChecksumType&gt;">
  11. <meta name="generator" content="GTK-Doc V1.33.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="5"><tr valign="middle">
  16. <td width="100%" align="left" class="shortcuts"></td>
  17. <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
  18. <td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
  19. <td><a accesskey="p" href="re05.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
  20. <td><a accesskey="n" href="re07.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
  21. </tr></table>
  22. <div class="refentry">
  23. <a name="id-1.1.7"></a><div class="titlepage"></div>
  24. <div class="refnamediv">
  25. <h2>&lt;GChecksum&gt;</h2>
  26. <p>&lt;GChecksum&gt;</p>
  27. </div>
  28. <div class="refsect1">
  29. <a name="id-1.1.7.2"></a><h2>Description</h2>
  30. <p>An opaque structure representing a checksumming operation.
  31. </p>
  32. <p>To create a new GChecksum, use <code class="function">g_checksum_new()</code>. To free
  33. a GChecksum, use <code class="function">g_checksum_free()</code>.</p>
  34. </div>
  35. <div class="refsect1">
  36. <a name="id-1.1.7.3"></a><h2>Functions</h2>
  37. <div class="refsect2">
  38. <a name="id-1.1.7.3.2"></a><h3>copy</h3>
  39. <div class="informalexample"><pre class="programlisting">(define-values (%return) (checksum:copy self))
  40. </pre></div>
  41. <p>Copies a <span class="type">GChecksum</span>. If <em class="parameter"><code>checksum</code></em> has been closed, by calling
  42. <code class="function">g_checksum_get_string()</code> or <code class="function">g_checksum_get_digest()</code>, the copied
  43. checksum will be closed as well.</p>
  44. <div class="refsect3">
  45. <a name="id-1.1.7.3.2.4"></a><h4>Parameters</h4>
  46. <div class="informaltable"><table><tr>
  47. <td class="parameter_name"><p>checksum</p></td>
  48. <td class="parameter_description">
  49. <p>the <span class="type">GChecksum</span> to copy</p>
  50. <p>Passed as <code class="code">self</code></p>
  51. </td>
  52. </tr></table></div>
  53. </div>
  54. </div>
  55. <div class="refsect2">
  56. <a name="id-1.1.7.3.3"></a><h3>free</h3>
  57. <div class="informalexample"><pre class="programlisting">(define-values () (checksum:free self))
  58. </pre></div>
  59. <p>Frees the memory allocated for <em class="parameter"><code>checksum</code></em>.</p>
  60. <div class="refsect3">
  61. <a name="id-1.1.7.3.3.4"></a><h4>Parameters</h4>
  62. <div class="informaltable"><table><tr>
  63. <td class="parameter_name"><p>checksum</p></td>
  64. <td class="parameter_description">
  65. <p>a <span class="type">GChecksum</span></p>
  66. <p>Passed as <code class="code">self</code></p>
  67. </td>
  68. </tr></table></div>
  69. </div>
  70. </div>
  71. <div class="refsect2">
  72. <a name="id-1.1.7.3.4"></a><h3>get-string</h3>
  73. <div class="informalexample"><pre class="programlisting">(define-values (%return) (checksum:get-string self))
  74. </pre></div>
  75. <p>Gets the digest as a hexadecimal string.
  76. </p>
  77. <p>Once this function has been called the <span class="type">GChecksum</span> can no longer be
  78. updated with <code class="function">g_checksum_update()</code>.
  79. </p>
  80. <p>The hexadecimal characters will be lower case.</p>
  81. <div class="refsect3">
  82. <a name="id-1.1.7.3.4.6"></a><h4>Parameters</h4>
  83. <div class="informaltable"><table><tr>
  84. <td class="parameter_name"><p>checksum</p></td>
  85. <td class="parameter_description">
  86. <p>a <span class="type">GChecksum</span></p>
  87. <p>Passed as <code class="code">self</code></p>
  88. </td>
  89. </tr></table></div>
  90. </div>
  91. </div>
  92. <div class="refsect2">
  93. <a name="id-1.1.7.3.5"></a><h3>reset</h3>
  94. <div class="informalexample"><pre class="programlisting">(define-values () (checksum:reset self))
  95. </pre></div>
  96. <p>Resets the state of the <em class="parameter"><code>checksum</code></em> back to its initial state.</p>
  97. <div class="refsect3">
  98. <a name="id-1.1.7.3.5.4"></a><h4>Parameters</h4>
  99. <div class="informaltable"><table><tr>
  100. <td class="parameter_name"><p>checksum</p></td>
  101. <td class="parameter_description">
  102. <p>the <span class="type">GChecksum</span> to reset</p>
  103. <p>Passed as <code class="code">self</code></p>
  104. </td>
  105. </tr></table></div>
  106. </div>
  107. </div>
  108. <div class="refsect2">
  109. <a name="id-1.1.7.3.6"></a><h3>update</h3>
  110. <div class="informalexample"><pre class="programlisting">(define-values () (checksum:update self data))
  111. </pre></div>
  112. <p>Feeds <em class="parameter"><code>data</code></em> into an existing <span class="type">GChecksum</span>. The checksum must still be
  113. open, that is <code class="function">g_checksum_get_string()</code> or <code class="function">g_checksum_get_digest()</code> must
  114. not have been called on <em class="parameter"><code>checksum</code></em>.</p>
  115. <div class="refsect3">
  116. <a name="id-1.1.7.3.6.4"></a><h4>Parameters</h4>
  117. <div class="informaltable"><table>
  118. <tr>
  119. <td class="parameter_name"><p>checksum</p></td>
  120. <td class="parameter_description">
  121. <p>a <span class="type">GChecksum</span></p>
  122. <p>Passed as <code class="code">self</code></p>
  123. </td>
  124. </tr>
  125. <tr>
  126. <td class="parameter_name"><p>data</p></td>
  127. <td class="parameter_description">
  128. <p>buffer used to compute the checksum</p>
  129. <p>Passed as <code class="code">data</code></p>
  130. </td>
  131. </tr>
  132. <tr>
  133. <td class="parameter_name"><p>length</p></td>
  134. <td class="parameter_description">
  135. <p>size of the buffer, or -1 if it is a null-terminated string.</p>
  136. <p>Inferred from <code class="code">data</code></p>
  137. </td>
  138. </tr>
  139. </table></div>
  140. </div>
  141. </div>
  142. <div class="refsect2">
  143. <a name="id-1.1.7.3.7"></a><h3>checksum:new</h3>
  144. <div class="informalexample"><pre class="programlisting">(define-values (%return) (checksum:new checksum-type))
  145. </pre></div>
  146. <p>Undocumented</p>
  147. <div class="refsect3">
  148. <a name="id-1.1.7.3.7.4"></a><h4>Parameters</h4>
  149. <div class="informaltable"><table><tr>
  150. <td class="parameter_name"><p>checksum_type</p></td>
  151. <td class="parameter_description">
  152. <p></p>
  153. <p>Passed as <code class="code">checksum-type</code></p>
  154. </td>
  155. </tr></table></div>
  156. </div>
  157. </div>
  158. <div class="refsect2">
  159. <a name="id-1.1.7.3.8"></a><h3>checksum:type-get-length</h3>
  160. <div class="informalexample"><pre class="programlisting">(define-values (%return) (checksum:type-get-length checksum-type))
  161. </pre></div>
  162. <p>Gets the length in bytes of digests of type <em class="parameter"><code>checksum_type</code></em></p>
  163. <div class="refsect3">
  164. <a name="id-1.1.7.3.8.4"></a><h4>Parameters</h4>
  165. <div class="informaltable"><table><tr>
  166. <td class="parameter_name"><p>checksum_type</p></td>
  167. <td class="parameter_description">
  168. <p>a <span class="type">GChecksumType</span></p>
  169. <p>Passed as <code class="code">checksum-type</code></p>
  170. </td>
  171. </tr></table></div>
  172. </div>
  173. </div>
  174. </div>
  175. </div>
  176. <div class="footer">
  177. <hr>Generated by GTK-Doc V1.33.1</div>
  178. </body>
  179. </html>