summaryrefslogtreecommitdiff
path: root/doc/sgml/gmime-filter-yenc.sgml
blob: f52cac3c6c862997c8632960ba79874cd0b24ff1 (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
<refentry id="gmime-gmime-filter-yenc">
<refmeta>
<refentrytitle>gmime-filter-yenc</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GMIME Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>gmime-filter-yenc</refname><refpurpose></refpurpose>
</refnamediv>

<refsynopsisdiv><title>Synopsis</title>
<synopsis>



#define     <link linkend="GMIME-YENCODE-CRC-INIT-CAPS">GMIME_YENCODE_CRC_INIT</link>
#define     <link linkend="GMIME-YENCODE-CRC-FINAL-CAPS">GMIME_YENCODE_CRC_FINAL</link>         (crc)
<link linkend="size-t">size_t</link>      <link linkend="g-mime-ydecode-step">g_mime_ydecode_step</link>             (unsigned char *in,
                                             <link linkend="size-t">size_t</link> inlen,
                                             unsigned char *out,
                                             int *state,
                                             <link linkend="guint32">guint32</link> *pcrc,
                                             <link linkend="guint32">guint32</link> *crc);
<link linkend="size-t">size_t</link>      <link linkend="g-mime-yencode-step">g_mime_yencode_step</link>             (unsigned char *in,
                                             <link linkend="size-t">size_t</link> inlen,
                                             unsigned char *out,
                                             int *state,
                                             <link linkend="guint32">guint32</link> *pcrc,
                                             <link linkend="guint32">guint32</link> *crc);
<link linkend="size-t">size_t</link>      <link linkend="g-mime-yencode-close">g_mime_yencode_close</link>            (unsigned char *in,
                                             <link linkend="size-t">size_t</link> inlen,
                                             unsigned char *out,
                                             int *state,
                                             <link linkend="guint32">guint32</link> *pcrc,
                                             <link linkend="guint32">guint32</link> *crc);
enum        <link linkend="GMimeFilterYencDirection">GMimeFilterYencDirection</link>;
#define     <link linkend="GMIME-YENCODE-STATE-INIT-CAPS">GMIME_YENCODE_STATE_INIT</link>
#define     <link linkend="GMIME-YDECODE-STATE-INIT-CAPS">GMIME_YDECODE_STATE_INIT</link>
#define     <link linkend="GMIME-YDECODE-STATE-EOLN-CAPS">GMIME_YDECODE_STATE_EOLN</link>
#define     <link linkend="GMIME-YDECODE-STATE-ESCAPE-CAPS">GMIME_YDECODE_STATE_ESCAPE</link>
#define     <link linkend="GMIME-YDECODE-STATE-BEGIN-CAPS">GMIME_YDECODE_STATE_BEGIN</link>
#define     <link linkend="GMIME-YDECODE-STATE-PART-CAPS">GMIME_YDECODE_STATE_PART</link>
#define     <link linkend="GMIME-YDECODE-STATE-DECODE-CAPS">GMIME_YDECODE_STATE_DECODE</link>
#define     <link linkend="GMIME-YDECODE-STATE-END-CAPS">GMIME_YDECODE_STATE_END</link>
<link linkend="GMimeFilter">GMimeFilter</link>* <link linkend="g-mime-filter-yenc-new">g_mime_filter_yenc_new</link>         (<link linkend="GMimeFilterYencDirection">GMimeFilterYencDirection</link> direction);
void        <link linkend="g-mime-filter-yenc-set-state">g_mime_filter_yenc_set_state</link>    (<link linkend="GMimeFilterYenc">GMimeFilterYenc</link> *yenc,
                                             int state);
void        <link linkend="g-mime-filter-yenc-set-crc">g_mime_filter_yenc_set_crc</link>      (<link linkend="GMimeFilterYenc">GMimeFilterYenc</link> *yenc,
                                             <link linkend="guint32">guint32</link> crc);
<link linkend="guint32">guint32</link>     <link linkend="g-mime-filter-yenc-get-crc">g_mime_filter_yenc_get_crc</link>      (<link linkend="GMimeFilterYenc">GMimeFilterYenc</link> *yenc);
<link linkend="guint32">guint32</link>     <link linkend="g-mime-filter-yenc-get-pcrc">g_mime_filter_yenc_get_pcrc</link>     (<link linkend="GMimeFilterYenc">GMimeFilterYenc</link> *yenc);
</synopsis>
</refsynopsisdiv>





<refsect1>
<title>Description</title>
<para>

</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="GMIME-YENCODE-CRC-INIT-CAPS">GMIME_YENCODE_CRC_INIT</title>
<programlisting>#define GMIME_YENCODE_CRC_INIT       (~0)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="GMIME-YENCODE-CRC-FINAL-CAPS">GMIME_YENCODE_CRC_FINAL()</title>
<programlisting>#define GMIME_YENCODE_CRC_FINAL(crc) (~crc)
</programlisting>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>crc</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-mime-ydecode-step">g_mime_ydecode_step ()</title>
<programlisting><link linkend="size-t">size_t</link>      g_mime_ydecode_step             (unsigned char *in,
                                             <link linkend="size-t">size_t</link> inlen,
                                             unsigned char *out,
                                             int *state,
                                             <link linkend="guint32">guint32</link> *pcrc,
                                             <link linkend="guint32">guint32</link> *crc);</programlisting>
<para>
Performs a 'decode step' on a chunk of yEncoded data of length
<parameter>inlen</parameter> pointed to by <parameter>in</parameter> and writes to <parameter>out</parameter>. Assumes the =ybegin
and =ypart lines have already been stripped off.
</para>
<para>
To get the crc32 value of the part, use GMIME_YENCODE_CRC_FINAL
(<parameter>pcrc</parameter>). If there are more parts, you should reuse <parameter>crc</parameter> without
re-initializing. Once all parts have been decoded, you may get the
combined crc32 value of all the parts using GMIME_YENCODE_CRC_FINAL
(<parameter>crc</parameter>).</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>in</parameter>&nbsp;:</entry>
<entry> input buffer
</entry></row>
<row><entry align="right"><parameter>inlen</parameter>&nbsp;:</entry>
<entry> input buffer length
</entry></row>
<row><entry align="right"><parameter>out</parameter>&nbsp;:</entry>
<entry> output buffer
</entry></row>
<row><entry align="right"><parameter>state</parameter>&nbsp;:</entry>
<entry> ydecode state
</entry></row>
<row><entry align="right"><parameter>pcrc</parameter>&nbsp;:</entry>
<entry> part crc state
</entry></row>
<row><entry align="right"><parameter>crc</parameter>&nbsp;:</entry>
<entry> crc state
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the number of bytes decoded.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-mime-yencode-step">g_mime_yencode_step ()</title>
<programlisting><link linkend="size-t">size_t</link>      g_mime_yencode_step             (unsigned char *in,
                                             <link linkend="size-t">size_t</link> inlen,
                                             unsigned char *out,
                                             int *state,
                                             <link linkend="guint32">guint32</link> *pcrc,
                                             <link linkend="guint32">guint32</link> *crc);</programlisting>
<para>
Performs an yEncode 'encode step' on a chunk of raw data of length
<parameter>inlen</parameter> pointed to by <parameter>in</parameter> and writes to <parameter>out</parameter>.
</para>
<para>
<parameter>state</parameter> should be initialized to GMIME_YENCODE_STATE_INIT before
beginning making the first call to this function. Subsequent calls
should reuse <parameter>state</parameter>.
</para>
<para>
Along the same lines, <parameter>pcrc</parameter> and <parameter>crc</parameter> should be initialized to
GMIME_YENCODE_CRC_INIT before using.</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>in</parameter>&nbsp;:</entry>
<entry> input buffer
</entry></row>
<row><entry align="right"><parameter>inlen</parameter>&nbsp;:</entry>
<entry> input buffer length
</entry></row>
<row><entry align="right"><parameter>out</parameter>&nbsp;:</entry>
<entry> output buffer
</entry></row>
<row><entry align="right"><parameter>state</parameter>&nbsp;:</entry>
<entry> yencode state
</entry></row>
<row><entry align="right"><parameter>pcrc</parameter>&nbsp;:</entry>
<entry> part crc state
</entry></row>
<row><entry align="right"><parameter>crc</parameter>&nbsp;:</entry>
<entry> crc state
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the number of bytes encoded.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-mime-yencode-close">g_mime_yencode_close ()</title>
<programlisting><link linkend="size-t">size_t</link>      g_mime_yencode_close            (unsigned char *in,
                                             <link linkend="size-t">size_t</link> inlen,
                                             unsigned char *out,
                                             int *state,
                                             <link linkend="guint32">guint32</link> *pcrc,
                                             <link linkend="guint32">guint32</link> *crc);</programlisting>
<para>
Call this function when finished encoding data with
g_mime_yencode_step to flush off the remaining state.
</para>
<para>
GMIME_YENCODE_CRC_FINAL (<parameter>pcrc</parameter>) will give you the crc32 of the
encoded "part". If there are more "parts" to encode, you should
re-use <parameter>crc</parameter> when encoding the next "parts" and then use
GMIME_YENCODE_CRC_FINAL (<parameter>crc</parameter>) to get the combined crc32 value of
all the parts.</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>in</parameter>&nbsp;:</entry>
<entry> input buffer
</entry></row>
<row><entry align="right"><parameter>inlen</parameter>&nbsp;:</entry>
<entry> input buffer length
</entry></row>
<row><entry align="right"><parameter>out</parameter>&nbsp;:</entry>
<entry> output buffer
</entry></row>
<row><entry align="right"><parameter>state</parameter>&nbsp;:</entry>
<entry> yencode state
</entry></row>
<row><entry align="right"><parameter>pcrc</parameter>&nbsp;:</entry>
<entry> part crc state
</entry></row>
<row><entry align="right"><parameter>crc</parameter>&nbsp;:</entry>
<entry> crc state
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the number of bytes encoded.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GMimeFilterYencDirection">enum GMimeFilterYencDirection</title>
<programlisting>typedef enum {
	GMIME_FILTER_YENC_DIRECTION_ENCODE,
	GMIME_FILTER_YENC_DIRECTION_DECODE,
} GMimeFilterYencDirection;
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="GMIME-YENCODE-STATE-INIT-CAPS">GMIME_YENCODE_STATE_INIT</title>
<programlisting>#define GMIME_YENCODE_STATE_INIT     (0)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="GMIME-YDECODE-STATE-INIT-CAPS">GMIME_YDECODE_STATE_INIT</title>
<programlisting>#define GMIME_YDECODE_STATE_INIT     (0)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="GMIME-YDECODE-STATE-EOLN-CAPS">GMIME_YDECODE_STATE_EOLN</title>
<programlisting>#define GMIME_YDECODE_STATE_EOLN     (1 &lt;&lt; 8)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="GMIME-YDECODE-STATE-ESCAPE-CAPS">GMIME_YDECODE_STATE_ESCAPE</title>
<programlisting>#define GMIME_YDECODE_STATE_ESCAPE   (1 &lt;&lt; 9)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="GMIME-YDECODE-STATE-BEGIN-CAPS">GMIME_YDECODE_STATE_BEGIN</title>
<programlisting>#define GMIME_YDECODE_STATE_BEGIN    (1 &lt;&lt; 12)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="GMIME-YDECODE-STATE-PART-CAPS">GMIME_YDECODE_STATE_PART</title>
<programlisting>#define GMIME_YDECODE_STATE_PART     (1 &lt;&lt; 13)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="GMIME-YDECODE-STATE-DECODE-CAPS">GMIME_YDECODE_STATE_DECODE</title>
<programlisting>#define GMIME_YDECODE_STATE_DECODE   (1 &lt;&lt; 14)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="GMIME-YDECODE-STATE-END-CAPS">GMIME_YDECODE_STATE_END</title>
<programlisting>#define GMIME_YDECODE_STATE_END      (1 &lt;&lt; 15)
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="g-mime-filter-yenc-new">g_mime_filter_yenc_new ()</title>
<programlisting><link linkend="GMimeFilter">GMimeFilter</link>* g_mime_filter_yenc_new         (<link linkend="GMimeFilterYencDirection">GMimeFilterYencDirection</link> direction);</programlisting>
<para>
Creates a new yEnc filter.</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>direction</parameter>&nbsp;:</entry>
<entry> encode direction
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>a new yEnc filter.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-mime-filter-yenc-set-state">g_mime_filter_yenc_set_state ()</title>
<programlisting>void        g_mime_filter_yenc_set_state    (<link linkend="GMimeFilterYenc">GMimeFilterYenc</link> *yenc,
                                             int state);</programlisting>
<para>
Sets the current state of the yencoder/ydecoder</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>yenc</parameter>&nbsp;:</entry>
<entry> yEnc filter
</entry></row>
<row><entry align="right"><parameter>state</parameter>&nbsp;:</entry>
<entry> encode/decode state
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-mime-filter-yenc-set-crc">g_mime_filter_yenc_set_crc ()</title>
<programlisting>void        g_mime_filter_yenc_set_crc      (<link linkend="GMimeFilterYenc">GMimeFilterYenc</link> *yenc,
                                             <link linkend="guint32">guint32</link> crc);</programlisting>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>yenc</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>crc</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-mime-filter-yenc-get-crc">g_mime_filter_yenc_get_crc ()</title>
<programlisting><link linkend="guint32">guint32</link>     g_mime_filter_yenc_get_crc      (<link linkend="GMimeFilterYenc">GMimeFilterYenc</link> *yenc);</programlisting>
<para>
Get the computed crc or (guint32) -1 on fail.</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>yenc</parameter>&nbsp;:</entry>
<entry> yEnc filter
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the computed crc or (guint32) -1 on fail.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-mime-filter-yenc-get-pcrc">g_mime_filter_yenc_get_pcrc ()</title>
<programlisting><link linkend="guint32">guint32</link>     g_mime_filter_yenc_get_pcrc     (<link linkend="GMimeFilterYenc">GMimeFilterYenc</link> *yenc);</programlisting>
<para>
Get the computed part crc or (guint32) -1 on fail.</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>yenc</parameter>&nbsp;:</entry>
<entry> yEnc filter
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the computed part crc or (guint32) -1 on fail.
</entry></row>
</tbody></tgroup></informaltable></refsect2>

</refsect1>




</refentry>