summaryrefstree
path: root/usr/share/gtk-doc/html/gio/GConverter.html
blob: b6832adc33bacf9452b0395a0a23f25c81b38db6 (plain)
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
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GConverter</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="GIO Reference Manual">
<link rel="up" href="conversion.html" title="Data conversion">
<link rel="prev" href="conversion.html" title="Data conversion">
<link rel="next" href="GCharsetConverter.html" title="GCharsetConverter">
<meta name="generator" content="GTK-Doc V1.19 (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="conversion.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="conversion.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></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">GIO Reference Manual</th>
<td><a accesskey="n" href="GCharsetConverter.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#GConverter.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#GConverter.description" class="shortcut">Description</a>
                   | 
                  <a href="#GConverter.object-hierarchy" class="shortcut">Object Hierarchy</a>
                   | 
                  <a href="#GConverter.prerequisites" class="shortcut">Prerequisites</a>
                   | 
                  <a href="#GConverter.implementations" class="shortcut">Known Implementations</a>
</td></tr>
</table>
<div class="refentry">
<a name="GConverter"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GConverter.top_of_page"></a>GConverter</span></h2>
<p>GConverter — Data conversion interface</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="GConverter.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gio/gio.h&gt;

                    <a class="link" href="GConverter.html#GConverter-struct" title="GConverter">GConverter</a>;
struct              <a class="link" href="GConverter.html#GConverterIface" title="struct GConverterIface">GConverterIface</a>;
enum                <a class="link" href="GConverter.html#GConverterResult" title="enum GConverterResult">GConverterResult</a>;
enum                <a class="link" href="GConverter.html#GConverterFlags" title="enum GConverterFlags">GConverterFlags</a>;
<a class="link" href="GConverter.html#GConverterResult" title="enum GConverterResult"><span class="returnvalue">GConverterResult</span></a>    <a class="link" href="GConverter.html#g-converter-convert" title="g_converter_convert ()">g_converter_convert</a>                 (<em class="parameter"><code><a class="link" href="GConverter.html" title="GConverter"><span class="type">GConverter</span></a> *converter</code></em>,
                                                         <em class="parameter"><code>const <span class="type">void</span> *inbuf</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> inbuf_size</code></em>,
                                                         <em class="parameter"><code><span class="type">void</span> *outbuf</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> outbuf_size</code></em>,
                                                         <em class="parameter"><code><a class="link" href="GConverter.html#GConverterFlags" title="enum GConverterFlags"><span class="type">GConverterFlags</span></a> flags</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *bytes_read</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *bytes_written</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="GConverter.html#g-converter-reset" title="g_converter_reset ()">g_converter_reset</a>                   (<em class="parameter"><code><a class="link" href="GConverter.html" title="GConverter"><span class="type">GConverter</span></a> *converter</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="GConverter.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  GInterface
   +----GConverter
</pre>
</div>
<div class="refsect1">
<a name="GConverter.prerequisites"></a><h2>Prerequisites</h2>
<p>
GConverter requires
 <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>.</p>
</div>
<div class="refsect1">
<a name="GConverter.implementations"></a><h2>Known Implementations</h2>
<p>
GConverter is implemented by
 <a class="link" href="GCharsetConverter.html" title="GCharsetConverter">GCharsetConverter</a>,  <a class="link" href="GZlibCompressor.html" title="GZlibCompressor">GZlibCompressor</a> and  <a class="link" href="GZlibDecompressor.html" title="GZlibDecompressor">GZlibDecompressor</a>.</p>
</div>
<div class="refsect1">
<a name="GConverter.description"></a><h2>Description</h2>
<p>
<a class="link" href="GConverter.html" title="GConverter"><span class="type">GConverter</span></a> is implemented by objects that convert
binary data in various ways. The conversion can be
stateful and may fail at any place.
</p>
<p>
Some example conversions are: character set conversion,
compression, decompression and regular expression
replace.
</p>
</div>
<div class="refsect1">
<a name="GConverter.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GConverter-struct"></a><h3>GConverter</h3>
<pre class="programlisting">typedef struct _GConverter GConverter;</pre>
<p>
Seek object for streaming operations.
</p>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="GConverterIface"></a><h3>struct GConverterIface</h3>
<pre class="programlisting">struct GConverterIface {
  GTypeInterface g_iface;

  /* Virtual Table */

  GConverterResult (* convert) (GConverter *converter,
				const void *inbuf,
				gsize       inbuf_size,
				void       *outbuf,
				gsize       outbuf_size,
				GConverterFlags flags,
				gsize      *bytes_read,
				gsize      *bytes_written,
				GError    **error);
  void  (* reset)   (GConverter *converter);
};
</pre>
<p>
Provides an interface for converting data from one type
to another type. The conversion can be stateful
and may fail at any place.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GTypeInterface"><span class="type">GTypeInterface</span></a> <em class="structfield"><code><a name="GConverterIface.g-iface"></a>g_iface</code></em>;</span></p></td>
<td>The parent interface.</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="GConverterIface.convert"></a>convert</code></em> ()</span></p></td>
<td>Converts data.</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="GConverterIface.reset"></a>reset</code></em> ()</span></p></td>
<td>Reverts the internal state of the converter to its initial state.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="GConverterResult"></a><h3>enum GConverterResult</h3>
<pre class="programlisting">typedef enum {
  G_CONVERTER_ERROR     = 0,  /*&lt; nick=error &gt;*/
  G_CONVERTER_CONVERTED = 1,  /*&lt; nick=converted &gt;*/
  G_CONVERTER_FINISHED  = 2,  /*&lt; nick=finished &gt;*/
  G_CONVERTER_FLUSHED   = 3   /*&lt; nick=flushed &gt;*/
} GConverterResult;
</pre>
<p>
Results returned from <a class="link" href="GConverter.html#g-converter-convert" title="g_converter_convert ()"><code class="function">g_converter_convert()</code></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><a name="G-CONVERTER-ERROR:CAPS"></a><span class="term"><code class="literal">G_CONVERTER_ERROR</code></span></p></td>
<td>There was an error during conversion.
</td>
</tr>
<tr>
<td><p><a name="G-CONVERTER-CONVERTED:CAPS"></a><span class="term"><code class="literal">G_CONVERTER_CONVERTED</code></span></p></td>
<td>Some data was consumed or produced
</td>
</tr>
<tr>
<td><p><a name="G-CONVERTER-FINISHED:CAPS"></a><span class="term"><code class="literal">G_CONVERTER_FINISHED</code></span></p></td>
<td>The conversion is finished
</td>
</tr>
<tr>
<td><p><a name="G-CONVERTER-FLUSHED:CAPS"></a><span class="term"><code class="literal">G_CONVERTER_FLUSHED</code></span></p></td>
<td>Flushing is finished
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="GConverterFlags"></a><h3>enum GConverterFlags</h3>
<pre class="programlisting">typedef enum {
  G_CONVERTER_NO_FLAGS     = 0,         /*&lt; nick=none &gt;*/
  G_CONVERTER_INPUT_AT_END = (1 &lt;&lt; 0),  /*&lt; nick=input-at-end &gt;*/
  G_CONVERTER_FLUSH        = (1 &lt;&lt; 1)   /*&lt; nick=flush &gt;*/
} GConverterFlags;
</pre>
<p>
Flags used when calling a <a class="link" href="GConverter.html#g-converter-convert" title="g_converter_convert ()"><code class="function">g_converter_convert()</code></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><a name="G-CONVERTER-NO-FLAGS:CAPS"></a><span class="term"><code class="literal">G_CONVERTER_NO_FLAGS</code></span></p></td>
<td>No flags.
</td>
</tr>
<tr>
<td><p><a name="G-CONVERTER-INPUT-AT-END:CAPS"></a><span class="term"><code class="literal">G_CONVERTER_INPUT_AT_END</code></span></p></td>
<td>At end of input data
</td>
</tr>
<tr>
<td><p><a name="G-CONVERTER-FLUSH:CAPS"></a><span class="term"><code class="literal">G_CONVERTER_FLUSH</code></span></p></td>
<td>Flush data
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="g-converter-convert"></a><h3>g_converter_convert ()</h3>
<pre class="programlisting"><a class="link" href="GConverter.html#GConverterResult" title="enum GConverterResult"><span class="returnvalue">GConverterResult</span></a>    g_converter_convert                 (<em class="parameter"><code><a class="link" href="GConverter.html" title="GConverter"><span class="type">GConverter</span></a> *converter</code></em>,
                                                         <em class="parameter"><code>const <span class="type">void</span> *inbuf</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> inbuf_size</code></em>,
                                                         <em class="parameter"><code><span class="type">void</span> *outbuf</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> outbuf_size</code></em>,
                                                         <em class="parameter"><code><a class="link" href="GConverter.html#GConverterFlags" title="enum GConverterFlags"><span class="type">GConverterFlags</span></a> flags</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *bytes_read</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *bytes_written</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
This is the main operation used when converting data. It is to be called
multiple times in a loop, and each time it will do some work, i.e.
producing some output (in <em class="parameter"><code>outbuf</code></em>) or consuming some input (from <em class="parameter"><code>inbuf</code></em>) or
both. If its not possible to do any work an error is returned.
</p>
<p>
Note that a single call may not consume all input (or any input at all).
Also a call may produce output even if given no input, due to state stored
in the converter producing output.
</p>
<p>
If any data was either produced or consumed, and then an error happens, then
only the successful conversion is reported and the error is returned on the
next call.
</p>
<p>
A full conversion loop involves calling this method repeatedly, each time
giving it new input and space output space. When there is no more input
data after the data in <em class="parameter"><code>inbuf</code></em>, the flag <a class="link" href="GConverter.html#G-CONVERTER-INPUT-AT-END:CAPS"><code class="literal">G_CONVERTER_INPUT_AT_END</code></a> must be set.
The loop will be (unless some error happens) returning <a class="link" href="GConverter.html#G-CONVERTER-CONVERTED:CAPS"><code class="literal">G_CONVERTER_CONVERTED</code></a>
each time until all data is consumed and all output is produced, then
<a class="link" href="GConverter.html#G-CONVERTER-FINISHED:CAPS"><code class="literal">G_CONVERTER_FINISHED</code></a> is returned instead. Note, that <a class="link" href="GConverter.html#G-CONVERTER-FINISHED:CAPS"><code class="literal">G_CONVERTER_FINISHED</code></a>
may be returned even if <a class="link" href="GConverter.html#G-CONVERTER-INPUT-AT-END:CAPS"><code class="literal">G_CONVERTER_INPUT_AT_END</code></a> is not set, for instance
in a decompression converter where the end of data is detectable from the
data (and there might even be other data after the end of the compressed data).
</p>
<p>
When some data has successfully been converted <em class="parameter"><code>bytes_read</code></em> and is set to
the number of bytes read from <em class="parameter"><code>inbuf</code></em>, and <em class="parameter"><code>bytes_written</code></em> is set to indicate
how many bytes was written to <em class="parameter"><code>outbuf</code></em>. If there are more data to output
or consume (i.e. unless the <a class="link" href="GConverter.html#G-CONVERTER-INPUT-AT-END:CAPS"><code class="literal">G_CONVERTER_INPUT_AT_END</code></a> is specified) then
<a class="link" href="GConverter.html#G-CONVERTER-CONVERTED:CAPS"><code class="literal">G_CONVERTER_CONVERTED</code></a> is returned, and if no more data is to be output
then <a class="link" href="GConverter.html#G-CONVERTER-FINISHED:CAPS"><code class="literal">G_CONVERTER_FINISHED</code></a> is returned.
</p>
<p>
On error <a class="link" href="GConverter.html#G-CONVERTER-ERROR:CAPS"><code class="literal">G_CONVERTER_ERROR</code></a> is returned and <em class="parameter"><code>error</code></em> is set accordingly.
Some errors need special handling:
</p>
<p>
<a class="link" href="gio-GIOError.html#G-IO-ERROR-NO-SPACE:CAPS"><code class="literal">G_IO_ERROR_NO_SPACE</code></a> is returned if there is not enough space
to write the resulting converted data, the application should
call the function again with a larger <em class="parameter"><code>outbuf</code></em> to continue.
</p>
<p>
<a class="link" href="gio-GIOError.html#G-IO-ERROR-PARTIAL-INPUT:CAPS"><code class="literal">G_IO_ERROR_PARTIAL_INPUT</code></a> is returned if there is not enough
input to fully determine what the conversion should produce,
and the <a class="link" href="GConverter.html#G-CONVERTER-INPUT-AT-END:CAPS"><code class="literal">G_CONVERTER_INPUT_AT_END</code></a> flag is not set. This happens for
example with an incomplete multibyte sequence when converting text,
or when a regexp matches up to the end of the input (and may match
further input). It may also happen when <em class="parameter"><code>inbuf_size</code></em> is zero and
there is no more data to produce.
</p>
<p>
When this happens the application should read more input and then
call the function again. If further input shows that there is no
more data call the function again with the same data but with
the <a class="link" href="GConverter.html#G-CONVERTER-INPUT-AT-END:CAPS"><code class="literal">G_CONVERTER_INPUT_AT_END</code></a> flag set. This may cause the conversion
to finish as e.g. in the regexp match case (or, to fail again with
<a class="link" href="gio-GIOError.html#G-IO-ERROR-PARTIAL-INPUT:CAPS"><code class="literal">G_IO_ERROR_PARTIAL_INPUT</code></a> in e.g. a charset conversion where the
input is actually partial).
</p>
<p>
After <a class="link" href="GConverter.html#g-converter-convert" title="g_converter_convert ()"><code class="function">g_converter_convert()</code></a> has returned <a class="link" href="GConverter.html#G-CONVERTER-FINISHED:CAPS"><code class="literal">G_CONVERTER_FINISHED</code></a> the
converter object is in an invalid state where its not allowed
to call <a class="link" href="GConverter.html#g-converter-convert" title="g_converter_convert ()"><code class="function">g_converter_convert()</code></a> anymore. At this time you can only
free the object or call <a class="link" href="GConverter.html#g-converter-reset" title="g_converter_reset ()"><code class="function">g_converter_reset()</code></a> to reset it to the
initial state.
</p>
<p>
If the flag <a class="link" href="GConverter.html#G-CONVERTER-FLUSH:CAPS"><code class="literal">G_CONVERTER_FLUSH</code></a> is set then conversion is modified
to try to write out all internal state to the output. The application
has to call the function multiple times with the flag set, and when
the available input has been consumed and all internal state has
been produced then <a class="link" href="GConverter.html#G-CONVERTER-FLUSHED:CAPS"><code class="literal">G_CONVERTER_FLUSHED</code></a> (or <a class="link" href="GConverter.html#G-CONVERTER-FINISHED:CAPS"><code class="literal">G_CONVERTER_FINISHED</code></a> if
really at the end) is returned instead of <a class="link" href="GConverter.html#G-CONVERTER-CONVERTED:CAPS"><code class="literal">G_CONVERTER_CONVERTED</code></a>.
This is somewhat similar to what happens at the end of the input stream,
but done in the middle of the data.
</p>
<p>
This has different meanings for different conversions. For instance
in a compression converter it would mean that we flush all the
compression state into output such that if you uncompress the
compressed data you get back all the input data. Doing this may
make the final file larger due to padding though. Another example
is a regexp conversion, where if you at the end of the flushed data
have a match, but there is also a potential longer match. In the
non-flushed case we would ask for more input, but when flushing we
treat this as the end of input and do the match.
</p>
<p>
Flushing is not always possible (like if a charset converter flushes
at a partial multibyte sequence). Converters are supposed to try
to produce as much output as possible and then return an error
(typically <a class="link" href="gio-GIOError.html#G-IO-ERROR-PARTIAL-INPUT:CAPS"><code class="literal">G_IO_ERROR_PARTIAL_INPUT</code></a>).
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>converter</code></em> :</span></p></td>
<td>a <a class="link" href="GConverter.html" title="GConverter"><span class="type">GConverter</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>inbuf</code></em> :</span></p></td>
<td>the buffer
containing the data to convert. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=inbuf_size][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> guint8]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>inbuf_size</code></em> :</span></p></td>
<td>the number of bytes in <em class="parameter"><code>inbuf</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>outbuf</code></em> :</span></p></td>
<td>a buffer to write converted data in.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>outbuf_size</code></em> :</span></p></td>
<td>the number of bytes in <em class="parameter"><code>outbuf</code></em>, must be at least one</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
<td>a <a class="link" href="GConverter.html#GConverterFlags" title="enum GConverterFlags"><span class="type">GConverterFlags</span></a> controlling the conversion details</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>bytes_read</code></em> :</span></p></td>
<td>will be set to the number of bytes read from <em class="parameter"><code>inbuf</code></em> on success. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>bytes_written</code></em> :</span></p></td>
<td>will be set to the number of bytes written to <em class="parameter"><code>outbuf</code></em> on success. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>location to store the error occurring, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a <a class="link" href="GConverter.html#GConverterResult" title="enum GConverterResult"><span class="type">GConverterResult</span></a>, <a class="link" href="GConverter.html#G-CONVERTER-ERROR:CAPS"><code class="literal">G_CONVERTER_ERROR</code></a> on error.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="g-converter-reset"></a><h3>g_converter_reset ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_converter_reset                   (<em class="parameter"><code><a class="link" href="GConverter.html" title="GConverter"><span class="type">GConverter</span></a> *converter</code></em>);</pre>
<p>
Resets all internal state in the converter, making it behave
as if it was just created. If the converter has any internal
state that would produce output then that output is lost.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>converter</code></em> :</span></p></td>
<td>a <a class="link" href="GConverter.html" title="GConverter"><span class="type">GConverter</span></a>.</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
</div>
<div class="refsect1">
<a name="GConverter.see-also"></a><h2>See Also</h2>
<a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a>, <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.19</div>
</body>
</html>