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>gmime-encodings</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GMime 2.6 Reference Manual">
8 <link rel="up" href="core.html" title="Part III. GMime Core Reference">
9 <link rel="prev" href="gmime-gmime-iconv-utils.html" title="gmime-iconv-utils">
10 <link rel="next" href="gmime-gmime-utils.html" title="gmime-utils">
11 <meta name="generator" content="GTK-Doc V1.18 (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="2">
17 <td><a accesskey="p" href="gmime-gmime-iconv-utils.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="core.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">GMime 2.6 Reference Manual</th>
21 <td><a accesskey="n" href="gmime-gmime-utils.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#gmime-gmime-encodings.synopsis" class="shortcut">Top</a>
26 <a href="#gmime-gmime-encodings.description" class="shortcut">Description</a>
29 <div class="refentry">
30 <a name="gmime-gmime-encodings"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
33 <h2><span class="refentrytitle"><a name="gmime-gmime-encodings.top_of_page"></a>gmime-encodings</span></h2>
34 <p>gmime-encodings — MIME encoding functions</p>
36 <td valign="top" align="right"></td>
38 <div class="refsynopsisdiv">
39 <a name="gmime-gmime-encodings.synopsis"></a><h2>Synopsis</h2>
40 <pre class="synopsis">enum <a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding">GMimeContentEncoding</a>;
41 <a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="returnvalue">GMimeContentEncoding</span></a> <a class="link" href="gmime-gmime-encodings.html#g-mime-content-encoding-from-string" title="g_mime_content_encoding_from_string ()">g_mime_content_encoding_from_string</a>
42 (<em class="parameter"><code>const <span class="type">char</span> *str</code></em>);
43 const <span class="returnvalue">char</span> * <a class="link" href="gmime-gmime-encodings.html#g-mime-content-encoding-to-string" title="g_mime_content_encoding_to_string ()">g_mime_content_encoding_to_string</a> (<em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="type">GMimeContentEncoding</span></a> encoding</code></em>);
44 enum <a class="link" href="gmime-gmime-encodings.html#GMimeEncodingConstraint" title="enum GMimeEncodingConstraint">GMimeEncodingConstraint</a>;
45 <a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="GMimeEncoding">GMimeEncoding</a>;
46 <span class="returnvalue">void</span> <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-init-encode" title="g_mime_encoding_init_encode ()">g_mime_encoding_init_encode</a> (<em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="GMimeEncoding"><span class="type">GMimeEncoding</span></a> *state</code></em>,
47 <em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="type">GMimeContentEncoding</span></a> encoding</code></em>);
48 <span class="returnvalue">void</span> <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-init-decode" title="g_mime_encoding_init_decode ()">g_mime_encoding_init_decode</a> (<em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="GMimeEncoding"><span class="type">GMimeEncoding</span></a> *state</code></em>,
49 <em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="type">GMimeContentEncoding</span></a> encoding</code></em>);
50 <span class="returnvalue">void</span> <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-reset" title="g_mime_encoding_reset ()">g_mime_encoding_reset</a> (<em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="GMimeEncoding"><span class="type">GMimeEncoding</span></a> *state</code></em>);
51 <span class="returnvalue">size_t</span> <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-outlen" title="g_mime_encoding_outlen ()">g_mime_encoding_outlen</a> (<em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="GMimeEncoding"><span class="type">GMimeEncoding</span></a> *state</code></em>,
52 <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>);
53 <span class="returnvalue">size_t</span> <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-step" title="g_mime_encoding_step ()">g_mime_encoding_step</a> (<em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="GMimeEncoding"><span class="type">GMimeEncoding</span></a> *state</code></em>,
54 <em class="parameter"><code>const <span class="type">char</span> *inbuf</code></em>,
55 <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
56 <em class="parameter"><code><span class="type">char</span> *outbuf</code></em>);
57 <span class="returnvalue">size_t</span> <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-flush" title="g_mime_encoding_flush ()">g_mime_encoding_flush</a> (<em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="GMimeEncoding"><span class="type">GMimeEncoding</span></a> *state</code></em>,
58 <em class="parameter"><code>const <span class="type">char</span> *inbuf</code></em>,
59 <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
60 <em class="parameter"><code><span class="type">char</span> *outbuf</code></em>);
61 #define <a class="link" href="gmime-gmime-encodings.html#GMIME-BASE64-ENCODE-LEN:CAPS" title="GMIME_BASE64_ENCODE_LEN()">GMIME_BASE64_ENCODE_LEN</a> (x)
62 <span class="returnvalue">size_t</span> <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-base64-decode-step" title="g_mime_encoding_base64_decode_step ()">g_mime_encoding_base64_decode_step</a> (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
63 <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
64 <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
65 <em class="parameter"><code><span class="type">int</span> *state</code></em>,
66 <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);
67 <span class="returnvalue">size_t</span> <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-base64-encode-step" title="g_mime_encoding_base64_encode_step ()">g_mime_encoding_base64_encode_step</a> (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
68 <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
69 <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
70 <em class="parameter"><code><span class="type">int</span> *state</code></em>,
71 <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);
72 <span class="returnvalue">size_t</span> <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-base64-encode-close" title="g_mime_encoding_base64_encode_close ()">g_mime_encoding_base64_encode_close</a> (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
73 <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
74 <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
75 <em class="parameter"><code><span class="type">int</span> *state</code></em>,
76 <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);
77 #define <a class="link" href="gmime-gmime-encodings.html#GMIME-UUDECODE-STATE-INIT:CAPS" title="GMIME_UUDECODE_STATE_INIT">GMIME_UUDECODE_STATE_INIT</a>
78 #define <a class="link" href="gmime-gmime-encodings.html#GMIME-UUDECODE-STATE-BEGIN:CAPS" title="GMIME_UUDECODE_STATE_BEGIN">GMIME_UUDECODE_STATE_BEGIN</a>
79 #define <a class="link" href="gmime-gmime-encodings.html#GMIME-UUDECODE-STATE-END:CAPS" title="GMIME_UUDECODE_STATE_END">GMIME_UUDECODE_STATE_END</a>
80 #define <a class="link" href="gmime-gmime-encodings.html#GMIME-UUENCODE-LEN:CAPS" title="GMIME_UUENCODE_LEN()">GMIME_UUENCODE_LEN</a> (x)
81 <span class="returnvalue">size_t</span> <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-uudecode-step" title="g_mime_encoding_uudecode_step ()">g_mime_encoding_uudecode_step</a> (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
82 <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
83 <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
84 <em class="parameter"><code><span class="type">int</span> *state</code></em>,
85 <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);
86 <span class="returnvalue">size_t</span> <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-uuencode-step" title="g_mime_encoding_uuencode_step ()">g_mime_encoding_uuencode_step</a> (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
87 <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
88 <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
89 <em class="parameter"><code>unsigned <span class="type">char</span> *uubuf</code></em>,
90 <em class="parameter"><code><span class="type">int</span> *state</code></em>,
91 <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);
92 <span class="returnvalue">size_t</span> <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-uuencode-close" title="g_mime_encoding_uuencode_close ()">g_mime_encoding_uuencode_close</a> (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
93 <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
94 <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
95 <em class="parameter"><code>unsigned <span class="type">char</span> *uubuf</code></em>,
96 <em class="parameter"><code><span class="type">int</span> *state</code></em>,
97 <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);
98 #define <a class="link" href="gmime-gmime-encodings.html#GMIME-QP-ENCODE-LEN:CAPS" title="GMIME_QP_ENCODE_LEN()">GMIME_QP_ENCODE_LEN</a> (x)
99 <span class="returnvalue">size_t</span> <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-quoted-decode-step" title="g_mime_encoding_quoted_decode_step ()">g_mime_encoding_quoted_decode_step</a> (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
100 <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
101 <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
102 <em class="parameter"><code><span class="type">int</span> *state</code></em>,
103 <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);
104 <span class="returnvalue">size_t</span> <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-quoted-encode-step" title="g_mime_encoding_quoted_encode_step ()">g_mime_encoding_quoted_encode_step</a> (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
105 <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
106 <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
107 <em class="parameter"><code><span class="type">int</span> *state</code></em>,
108 <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);
109 <span class="returnvalue">size_t</span> <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-quoted-encode-close" title="g_mime_encoding_quoted_encode_close ()">g_mime_encoding_quoted_encode_close</a> (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
110 <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
111 <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
112 <em class="parameter"><code><span class="type">int</span> *state</code></em>,
113 <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);
116 <div class="refsect1">
117 <a name="gmime-gmime-encodings.description"></a><h2>Description</h2>
119 Utility functions to encode or decode MIME
120 Content-Transfer-Encodings.
123 <div class="refsect1">
124 <a name="gmime-gmime-encodings.details"></a><h2>Details</h2>
125 <div class="refsect2">
126 <a name="GMimeContentEncoding"></a><h3>enum GMimeContentEncoding</h3>
127 <pre class="programlisting">typedef enum {
128 GMIME_CONTENT_ENCODING_DEFAULT,
129 GMIME_CONTENT_ENCODING_7BIT,
130 GMIME_CONTENT_ENCODING_8BIT,
131 GMIME_CONTENT_ENCODING_BINARY,
132 GMIME_CONTENT_ENCODING_BASE64,
133 GMIME_CONTENT_ENCODING_QUOTEDPRINTABLE,
134 GMIME_CONTENT_ENCODING_UUENCODE
135 } GMimeContentEncoding;
138 A Content-Transfer-Encoding enumeration.
140 <div class="variablelist"><table border="0">
141 <col align="left" valign="top">
144 <td><p><a name="GMIME-CONTENT-ENCODING-DEFAULT:CAPS"></a><span class="term"><code class="literal">GMIME_CONTENT_ENCODING_DEFAULT</code></span></p></td>
145 <td>Default transfer encoding.
149 <td><p><a name="GMIME-CONTENT-ENCODING-7BIT:CAPS"></a><span class="term"><code class="literal">GMIME_CONTENT_ENCODING_7BIT</code></span></p></td>
150 <td>7bit text transfer encoding.
154 <td><p><a name="GMIME-CONTENT-ENCODING-8BIT:CAPS"></a><span class="term"><code class="literal">GMIME_CONTENT_ENCODING_8BIT</code></span></p></td>
155 <td>8bit text transfer encoding.
159 <td><p><a name="GMIME-CONTENT-ENCODING-BINARY:CAPS"></a><span class="term"><code class="literal">GMIME_CONTENT_ENCODING_BINARY</code></span></p></td>
160 <td>Binary transfer encoding.
164 <td><p><a name="GMIME-CONTENT-ENCODING-BASE64:CAPS"></a><span class="term"><code class="literal">GMIME_CONTENT_ENCODING_BASE64</code></span></p></td>
165 <td>Base64 transfer encoding.
169 <td><p><a name="GMIME-CONTENT-ENCODING-QUOTEDPRINTABLE:CAPS"></a><span class="term"><code class="literal">GMIME_CONTENT_ENCODING_QUOTEDPRINTABLE</code></span></p></td>
170 <td>Quoted-printable transfer encoding.
174 <td><p><a name="GMIME-CONTENT-ENCODING-UUENCODE:CAPS"></a><span class="term"><code class="literal">GMIME_CONTENT_ENCODING_UUENCODE</code></span></p></td>
175 <td>Uuencode transfer encoding.
182 <div class="refsect2">
183 <a name="g-mime-content-encoding-from-string"></a><h3>g_mime_content_encoding_from_string ()</h3>
184 <pre class="programlisting"><a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="returnvalue">GMimeContentEncoding</span></a> g_mime_content_encoding_from_string
185 (<em class="parameter"><code>const <span class="type">char</span> *str</code></em>);</pre>
187 Gets the appropriate <a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="type">GMimeContentEncoding</span></a> enumeration value based
190 <div class="variablelist"><table border="0">
191 <col align="left" valign="top">
194 <td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td>
195 <td>a string representing a Content-Transfer-Encoding value</td>
198 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
199 <td>the <a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="type">GMimeContentEncoding</span></a> specified by <em class="parameter"><code>str</code></em> or
200 <a class="link" href="gmime-gmime-encodings.html#GMIME-CONTENT-ENCODING-DEFAULT:CAPS"><span class="type">GMIME_CONTENT_ENCODING_DEFAULT</span></a> on error.</td>
206 <div class="refsect2">
207 <a name="g-mime-content-encoding-to-string"></a><h3>g_mime_content_encoding_to_string ()</h3>
208 <pre class="programlisting">const <span class="returnvalue">char</span> * g_mime_content_encoding_to_string (<em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="type">GMimeContentEncoding</span></a> encoding</code></em>);</pre>
210 Gets the string value of the content encoding.
212 <div class="variablelist"><table border="0">
213 <col align="left" valign="top">
216 <td><p><span class="term"><em class="parameter"><code>encoding</code></em> :</span></p></td>
217 <td>a <a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="type">GMimeContentEncoding</span></a>
221 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
222 <td>the encoding type as a string or <code class="literal">NULL</code> on error. Available
223 values for the encoding are: <a class="link" href="gmime-gmime-encodings.html#GMIME-CONTENT-ENCODING-DEFAULT:CAPS"><span class="type">GMIME_CONTENT_ENCODING_DEFAULT</span></a>,
224 <a class="link" href="gmime-gmime-encodings.html#GMIME-CONTENT-ENCODING-7BIT:CAPS"><span class="type">GMIME_CONTENT_ENCODING_7BIT</span></a>, <a class="link" href="gmime-gmime-encodings.html#GMIME-CONTENT-ENCODING-8BIT:CAPS"><span class="type">GMIME_CONTENT_ENCODING_8BIT</span></a>,
225 <a class="link" href="gmime-gmime-encodings.html#GMIME-CONTENT-ENCODING-BINARY:CAPS"><span class="type">GMIME_CONTENT_ENCODING_BINARY</span></a>, <a class="link" href="gmime-gmime-encodings.html#GMIME-CONTENT-ENCODING-BASE64:CAPS"><span class="type">GMIME_CONTENT_ENCODING_BASE64</span></a>,
226 <a class="link" href="gmime-gmime-encodings.html#GMIME-CONTENT-ENCODING-QUOTEDPRINTABLE:CAPS"><span class="type">GMIME_CONTENT_ENCODING_QUOTEDPRINTABLE</span></a> and
227 <a class="link" href="gmime-gmime-encodings.html#GMIME-CONTENT-ENCODING-UUENCODE:CAPS"><span class="type">GMIME_CONTENT_ENCODING_UUENCODE</span></a>.</td>
233 <div class="refsect2">
234 <a name="GMimeEncodingConstraint"></a><h3>enum GMimeEncodingConstraint</h3>
235 <pre class="programlisting">typedef enum {
236 GMIME_ENCODING_CONSTRAINT_7BIT,
237 GMIME_ENCODING_CONSTRAINT_8BIT,
238 GMIME_ENCODING_CONSTRAINT_BINARY
239 } GMimeEncodingConstraint;
242 Used with functions like <a class="link" href="GMimeFilterBest.html#g-mime-filter-best-encoding" title="g_mime_filter_best_encoding ()"><code class="function">g_mime_filter_best_encoding()</code></a> and
243 <a class="link" href="GMimeObject.html#g-mime-object-encode" title="g_mime_object_encode ()"><code class="function">g_mime_object_encode()</code></a> as the 'constraint' argument. These values
244 provide a means of letting the filter know what the encoding
245 constraints are for the stream.
247 <div class="variablelist"><table border="0">
248 <col align="left" valign="top">
251 <td><p><a name="GMIME-ENCODING-CONSTRAINT-7BIT:CAPS"></a><span class="term"><code class="literal">GMIME_ENCODING_CONSTRAINT_7BIT</code></span></p></td>
252 <td>The stream data must fit within the 7bit ASCII range.
256 <td><p><a name="GMIME-ENCODING-CONSTRAINT-8BIT:CAPS"></a><span class="term"><code class="literal">GMIME_ENCODING_CONSTRAINT_8BIT</code></span></p></td>
257 <td>The stream data may have bytes with the high bit set, but no null bytes.
261 <td><p><a name="GMIME-ENCODING-CONSTRAINT-BINARY:CAPS"></a><span class="term"><code class="literal">GMIME_ENCODING_CONSTRAINT_BINARY</code></span></p></td>
262 <td>The stream may contain any binary data.
269 <div class="refsect2">
270 <a name="GMimeEncoding"></a><h3>GMimeEncoding</h3>
271 <pre class="programlisting">typedef struct {
272 GMimeContentEncoding encoding;
273 unsigned char uubuf[60];
280 A context used for encoding or decoding data.
282 <div class="variablelist"><table border="0">
283 <col align="left" valign="top">
286 <td><p><span class="term"><a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="type">GMimeContentEncoding</span></a> <em class="structfield"><code><a name="GMimeEncoding.encoding"></a>encoding</code></em>;</span></p></td>
287 <td>the type of encoding</td>
290 <td><p><span class="term">unsigned <span class="type">char</span> <em class="structfield"><code><a name="GMimeEncoding.uubuf"></a>uubuf</code></em>[60];</span></p></td>
291 <td>a temporary buffer needed when uuencoding data</td>
294 <td><p><span class="term"><span class="type">gboolean</span> <em class="structfield"><code><a name="GMimeEncoding.encode"></a>encode</code></em>;</span></p></td>
296 <code class="literal">TRUE</code> if encoding or <code class="literal">FALSE</code> if decoding</td>
299 <td><p><span class="term"><span class="type">guint32</span> <em class="structfield"><code><a name="GMimeEncoding.save"></a>save</code></em>;</span></p></td>
300 <td>saved bytes from the previous step</td>
303 <td><p><span class="term"><span class="type">int</span> <em class="structfield"><code><a name="GMimeEncoding.state"></a>state</code></em>;</span></p></td>
304 <td>current encder/decoder state</td>
310 <div class="refsect2">
311 <a name="g-mime-encoding-init-encode"></a><h3>g_mime_encoding_init_encode ()</h3>
312 <pre class="programlisting"><span class="returnvalue">void</span> g_mime_encoding_init_encode (<em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="GMimeEncoding"><span class="type">GMimeEncoding</span></a> *state</code></em>,
313 <em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="type">GMimeContentEncoding</span></a> encoding</code></em>);</pre>
315 Initializes a <a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="GMimeEncoding"><span class="type">GMimeEncoding</span></a> state machine for encoding to
316 <em class="parameter"><code>encoding</code></em>.
318 <div class="variablelist"><table border="0">
319 <col align="left" valign="top">
322 <td><p><span class="term"><em class="parameter"><code>state</code></em> :</span></p></td>
323 <td>a <a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="GMimeEncoding"><span class="type">GMimeEncoding</span></a> to initialize</td>
326 <td><p><span class="term"><em class="parameter"><code>encoding</code></em> :</span></p></td>
327 <td>a <a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="type">GMimeContentEncoding</span></a> to use</td>
333 <div class="refsect2">
334 <a name="g-mime-encoding-init-decode"></a><h3>g_mime_encoding_init_decode ()</h3>
335 <pre class="programlisting"><span class="returnvalue">void</span> g_mime_encoding_init_decode (<em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="GMimeEncoding"><span class="type">GMimeEncoding</span></a> *state</code></em>,
336 <em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="type">GMimeContentEncoding</span></a> encoding</code></em>);</pre>
338 Initializes a <a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="GMimeEncoding"><span class="type">GMimeEncoding</span></a> state machine for decoding from
339 <em class="parameter"><code>encoding</code></em>.
341 <div class="variablelist"><table border="0">
342 <col align="left" valign="top">
345 <td><p><span class="term"><em class="parameter"><code>state</code></em> :</span></p></td>
346 <td>a <a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="GMimeEncoding"><span class="type">GMimeEncoding</span></a> to initialize</td>
349 <td><p><span class="term"><em class="parameter"><code>encoding</code></em> :</span></p></td>
350 <td>a <a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="type">GMimeContentEncoding</span></a> to use</td>
356 <div class="refsect2">
357 <a name="g-mime-encoding-reset"></a><h3>g_mime_encoding_reset ()</h3>
358 <pre class="programlisting"><span class="returnvalue">void</span> g_mime_encoding_reset (<em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="GMimeEncoding"><span class="type">GMimeEncoding</span></a> *state</code></em>);</pre>
360 Resets the state of the <a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="GMimeEncoding"><span class="type">GMimeEncoding</span></a>.
362 <div class="variablelist"><table border="0">
363 <col align="left" valign="top">
365 <td><p><span class="term"><em class="parameter"><code>state</code></em> :</span></p></td>
366 <td>a <a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="GMimeEncoding"><span class="type">GMimeEncoding</span></a> to reset</td>
371 <div class="refsect2">
372 <a name="g-mime-encoding-outlen"></a><h3>g_mime_encoding_outlen ()</h3>
373 <pre class="programlisting"><span class="returnvalue">size_t</span> g_mime_encoding_outlen (<em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="GMimeEncoding"><span class="type">GMimeEncoding</span></a> *state</code></em>,
374 <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>);</pre>
376 Given the input length, <em class="parameter"><code>inlen</code></em>, calculate the needed output length
377 to perform an encoding or decoding step.
379 <div class="variablelist"><table border="0">
380 <col align="left" valign="top">
383 <td><p><span class="term"><em class="parameter"><code>state</code></em> :</span></p></td>
384 <td>a <a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="GMimeEncoding"><span class="type">GMimeEncoding</span></a>
388 <td><p><span class="term"><em class="parameter"><code>inlen</code></em> :</span></p></td>
389 <td>an input length</td>
392 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
393 <td>the maximum number of bytes needed to encode or decode a
394 buffer of <em class="parameter"><code>inlen</code></em> bytes.</td>
400 <div class="refsect2">
401 <a name="g-mime-encoding-step"></a><h3>g_mime_encoding_step ()</h3>
402 <pre class="programlisting"><span class="returnvalue">size_t</span> g_mime_encoding_step (<em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="GMimeEncoding"><span class="type">GMimeEncoding</span></a> *state</code></em>,
403 <em class="parameter"><code>const <span class="type">char</span> *inbuf</code></em>,
404 <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
405 <em class="parameter"><code><span class="type">char</span> *outbuf</code></em>);</pre>
407 Incrementally encodes or decodes (depending on <em class="parameter"><code>state</code></em>) an input
408 stream by 'stepping' through a block of input at a time.
411 You should make sure <em class="parameter"><code>outbuf</code></em> is large enough by calling
412 <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-outlen" title="g_mime_encoding_outlen ()"><code class="function">g_mime_encoding_outlen()</code></a> to find out how large <em class="parameter"><code>outbuf</code></em> might need
415 <div class="variablelist"><table border="0">
416 <col align="left" valign="top">
419 <td><p><span class="term"><em class="parameter"><code>state</code></em> :</span></p></td>
420 <td>a <a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="GMimeEncoding"><span class="type">GMimeEncoding</span></a>
424 <td><p><span class="term"><em class="parameter"><code>inbuf</code></em> :</span></p></td>
425 <td>an input buffer to encode or decode</td>
428 <td><p><span class="term"><em class="parameter"><code>inlen</code></em> :</span></p></td>
429 <td>input buffer length</td>
432 <td><p><span class="term"><em class="parameter"><code>outbuf</code></em> :</span></p></td>
433 <td>an output buffer</td>
436 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
437 <td>the number of bytes written to <em class="parameter"><code>outbuf</code></em>.</td>
443 <div class="refsect2">
444 <a name="g-mime-encoding-flush"></a><h3>g_mime_encoding_flush ()</h3>
445 <pre class="programlisting"><span class="returnvalue">size_t</span> g_mime_encoding_flush (<em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="GMimeEncoding"><span class="type">GMimeEncoding</span></a> *state</code></em>,
446 <em class="parameter"><code>const <span class="type">char</span> *inbuf</code></em>,
447 <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
448 <em class="parameter"><code><span class="type">char</span> *outbuf</code></em>);</pre>
450 Completes the incremental encode or decode of the input stream (see
451 <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-step" title="g_mime_encoding_step ()"><code class="function">g_mime_encoding_step()</code></a> for details).
453 <div class="variablelist"><table border="0">
454 <col align="left" valign="top">
457 <td><p><span class="term"><em class="parameter"><code>state</code></em> :</span></p></td>
458 <td>a <a class="link" href="gmime-gmime-encodings.html#GMimeEncoding" title="GMimeEncoding"><span class="type">GMimeEncoding</span></a>
462 <td><p><span class="term"><em class="parameter"><code>inbuf</code></em> :</span></p></td>
463 <td>an input buffer to encode or decode</td>
466 <td><p><span class="term"><em class="parameter"><code>inlen</code></em> :</span></p></td>
467 <td>input buffer length</td>
470 <td><p><span class="term"><em class="parameter"><code>outbuf</code></em> :</span></p></td>
471 <td>an output buffer</td>
474 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
475 <td>the number of bytes written to <em class="parameter"><code>outbuf</code></em>.</td>
481 <div class="refsect2">
482 <a name="GMIME-BASE64-ENCODE-LEN:CAPS"></a><h3>GMIME_BASE64_ENCODE_LEN()</h3>
483 <pre class="programlisting">#define GMIME_BASE64_ENCODE_LEN(x) ((size_t) (((((x) + 2) / 57) * 77) + 77))
486 Calculates the maximum number of bytes needed to base64 encode the
487 full input buffer of length <em class="parameter"><code>x</code></em>.
489 <div class="variablelist"><table border="0">
490 <col align="left" valign="top">
493 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
494 <td>Length of the input data to encode</td>
497 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
498 <td>the number of output bytes needed to base64 encode an input
499 buffer of size <em class="parameter"><code>x</code></em>.</td>
505 <div class="refsect2">
506 <a name="g-mime-encoding-base64-decode-step"></a><h3>g_mime_encoding_base64_decode_step ()</h3>
507 <pre class="programlisting"><span class="returnvalue">size_t</span> g_mime_encoding_base64_decode_step (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
508 <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
509 <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
510 <em class="parameter"><code><span class="type">int</span> *state</code></em>,
511 <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);</pre>
513 Decodes a chunk of base64 encoded data.
515 <div class="variablelist"><table border="0">
516 <col align="left" valign="top">
519 <td><p><span class="term"><em class="parameter"><code>inbuf</code></em> :</span></p></td>
520 <td>input buffer</td>
523 <td><p><span class="term"><em class="parameter"><code>inlen</code></em> :</span></p></td>
524 <td>input buffer length</td>
527 <td><p><span class="term"><em class="parameter"><code>outbuf</code></em> :</span></p></td>
528 <td>output buffer</td>
531 <td><p><span class="term"><em class="parameter"><code>state</code></em> :</span></p></td>
532 <td>holds the number of bits that are stored in <em class="parameter"><code>save</code></em>
536 <td><p><span class="term"><em class="parameter"><code>save</code></em> :</span></p></td>
537 <td>leftover bits that have not yet been decoded</td>
540 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
541 <td>the number of bytes decoded (which have been dumped in
542 <em class="parameter"><code>outbuf</code></em>).</td>
548 <div class="refsect2">
549 <a name="g-mime-encoding-base64-encode-step"></a><h3>g_mime_encoding_base64_encode_step ()</h3>
550 <pre class="programlisting"><span class="returnvalue">size_t</span> g_mime_encoding_base64_encode_step (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
551 <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
552 <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
553 <em class="parameter"><code><span class="type">int</span> *state</code></em>,
554 <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);</pre>
556 Base64 encodes a chunk of data. Performs an 'encode step', only
557 encodes blocks of 3 characters to the output at a time, saves
558 left-over state in state and save (initialise to 0 on first
561 <div class="variablelist"><table border="0">
562 <col align="left" valign="top">
565 <td><p><span class="term"><em class="parameter"><code>inbuf</code></em> :</span></p></td>
566 <td>input buffer</td>
569 <td><p><span class="term"><em class="parameter"><code>inlen</code></em> :</span></p></td>
570 <td>input buffer length</td>
573 <td><p><span class="term"><em class="parameter"><code>outbuf</code></em> :</span></p></td>
574 <td>output buffer</td>
577 <td><p><span class="term"><em class="parameter"><code>state</code></em> :</span></p></td>
578 <td>holds the number of bits that are stored in <em class="parameter"><code>save</code></em>
582 <td><p><span class="term"><em class="parameter"><code>save</code></em> :</span></p></td>
583 <td>leftover bits that have not yet been encoded</td>
586 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
587 <td>the number of bytes encoded.</td>
593 <div class="refsect2">
594 <a name="g-mime-encoding-base64-encode-close"></a><h3>g_mime_encoding_base64_encode_close ()</h3>
595 <pre class="programlisting"><span class="returnvalue">size_t</span> g_mime_encoding_base64_encode_close (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
596 <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
597 <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
598 <em class="parameter"><code><span class="type">int</span> *state</code></em>,
599 <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);</pre>
601 Base64 encodes the input stream to the output stream. Call this
602 when finished encoding data with <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-base64-encode-step" title="g_mime_encoding_base64_encode_step ()"><code class="function">g_mime_encoding_base64_encode_step()</code></a>
603 to flush off the last little bit.
605 <div class="variablelist"><table border="0">
606 <col align="left" valign="top">
609 <td><p><span class="term"><em class="parameter"><code>inbuf</code></em> :</span></p></td>
610 <td>input buffer</td>
613 <td><p><span class="term"><em class="parameter"><code>inlen</code></em> :</span></p></td>
614 <td>input buffer length</td>
617 <td><p><span class="term"><em class="parameter"><code>outbuf</code></em> :</span></p></td>
618 <td>output buffer</td>
621 <td><p><span class="term"><em class="parameter"><code>state</code></em> :</span></p></td>
622 <td>holds the number of bits that are stored in <em class="parameter"><code>save</code></em>
626 <td><p><span class="term"><em class="parameter"><code>save</code></em> :</span></p></td>
627 <td>leftover bits that have not yet been encoded</td>
630 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
631 <td>the number of bytes encoded.</td>
637 <div class="refsect2">
638 <a name="GMIME-UUDECODE-STATE-INIT:CAPS"></a><h3>GMIME_UUDECODE_STATE_INIT</h3>
639 <pre class="programlisting">#define GMIME_UUDECODE_STATE_INIT (0)
642 Initial state for the <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-uudecode-step" title="g_mime_encoding_uudecode_step ()"><code class="function">g_mime_encoding_uudecode_step()</code></a> function.
646 <div class="refsect2">
647 <a name="GMIME-UUDECODE-STATE-BEGIN:CAPS"></a><h3>GMIME_UUDECODE_STATE_BEGIN</h3>
648 <pre class="programlisting">#define GMIME_UUDECODE_STATE_BEGIN (1 << 16)
651 State for the <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-uudecode-step" title="g_mime_encoding_uudecode_step ()"><code class="function">g_mime_encoding_uudecode_step()</code></a> function, denoting that
652 the 'begin' line has been found.
656 <div class="refsect2">
657 <a name="GMIME-UUDECODE-STATE-END:CAPS"></a><h3>GMIME_UUDECODE_STATE_END</h3>
658 <pre class="programlisting">#define GMIME_UUDECODE_STATE_END (1 << 17)
661 State for the <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-uudecode-step" title="g_mime_encoding_uudecode_step ()"><code class="function">g_mime_encoding_uudecode_step()</code></a> function, denoting that
662 the end of the UU encoded block has been found.
666 <div class="refsect2">
667 <a name="GMIME-UUENCODE-LEN:CAPS"></a><h3>GMIME_UUENCODE_LEN()</h3>
668 <pre class="programlisting">#define GMIME_UUENCODE_LEN(x) ((size_t) (((((x) + 2) / 45) * 62) + 64))
671 Calculates the maximum number of bytes needed to uuencode the full
672 input buffer of length <em class="parameter"><code>x</code></em>.
674 <div class="variablelist"><table border="0">
675 <col align="left" valign="top">
678 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
679 <td>Length of the input data to encode</td>
682 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
683 <td>the number of output bytes needed to uuencode an input
684 buffer of size <em class="parameter"><code>x</code></em>.</td>
690 <div class="refsect2">
691 <a name="g-mime-encoding-uudecode-step"></a><h3>g_mime_encoding_uudecode_step ()</h3>
692 <pre class="programlisting"><span class="returnvalue">size_t</span> g_mime_encoding_uudecode_step (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
693 <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
694 <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
695 <em class="parameter"><code><span class="type">int</span> *state</code></em>,
696 <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);</pre>
698 Uudecodes a chunk of data. Performs a 'decode step' on a chunk of
699 uuencoded data. Assumes the "begin mode filename" line has
702 <div class="variablelist"><table border="0">
703 <col align="left" valign="top">
706 <td><p><span class="term"><em class="parameter"><code>inbuf</code></em> :</span></p></td>
707 <td>input buffer</td>
710 <td><p><span class="term"><em class="parameter"><code>inlen</code></em> :</span></p></td>
711 <td>input buffer length</td>
714 <td><p><span class="term"><em class="parameter"><code>outbuf</code></em> :</span></p></td>
715 <td>output buffer</td>
718 <td><p><span class="term"><em class="parameter"><code>state</code></em> :</span></p></td>
719 <td>holds the number of bits that are stored in <em class="parameter"><code>save</code></em>
723 <td><p><span class="term"><em class="parameter"><code>save</code></em> :</span></p></td>
724 <td>leftover bits that have not yet been decoded</td>
727 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
728 <td>the number of bytes decoded.</td>
734 <div class="refsect2">
735 <a name="g-mime-encoding-uuencode-step"></a><h3>g_mime_encoding_uuencode_step ()</h3>
736 <pre class="programlisting"><span class="returnvalue">size_t</span> g_mime_encoding_uuencode_step (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
737 <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
738 <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
739 <em class="parameter"><code>unsigned <span class="type">char</span> *uubuf</code></em>,
740 <em class="parameter"><code><span class="type">int</span> *state</code></em>,
741 <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);</pre>
743 Uuencodes a chunk of data. Performs an 'encode step', only encodes
744 blocks of 45 characters to the output at a time, saves left-over
745 state in <em class="parameter"><code>uubuf</code></em>, <em class="parameter"><code>state</code></em> and <em class="parameter"><code>save</code></em> (initialize to 0 on first
748 <div class="variablelist"><table border="0">
749 <col align="left" valign="top">
752 <td><p><span class="term"><em class="parameter"><code>inbuf</code></em> :</span></p></td>
753 <td>input buffer</td>
756 <td><p><span class="term"><em class="parameter"><code>inlen</code></em> :</span></p></td>
757 <td>input buffer length</td>
760 <td><p><span class="term"><em class="parameter"><code>outbuf</code></em> :</span></p></td>
761 <td>output stream</td>
764 <td><p><span class="term"><em class="parameter"><code>uubuf</code></em> :</span></p></td>
765 <td>temporary buffer of 60 bytes</td>
768 <td><p><span class="term"><em class="parameter"><code>state</code></em> :</span></p></td>
769 <td>holds the number of bits that are stored in <em class="parameter"><code>save</code></em>
773 <td><p><span class="term"><em class="parameter"><code>save</code></em> :</span></p></td>
774 <td>leftover bits that have not yet been encoded</td>
777 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
778 <td>the number of bytes encoded.</td>
784 <div class="refsect2">
785 <a name="g-mime-encoding-uuencode-close"></a><h3>g_mime_encoding_uuencode_close ()</h3>
786 <pre class="programlisting"><span class="returnvalue">size_t</span> g_mime_encoding_uuencode_close (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
787 <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
788 <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
789 <em class="parameter"><code>unsigned <span class="type">char</span> *uubuf</code></em>,
790 <em class="parameter"><code><span class="type">int</span> *state</code></em>,
791 <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);</pre>
793 Uuencodes a chunk of data. Call this when finished encoding data
794 with <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-uuencode-step" title="g_mime_encoding_uuencode_step ()"><code class="function">g_mime_encoding_uuencode_step()</code></a> to flush off the last little bit.
796 <div class="variablelist"><table border="0">
797 <col align="left" valign="top">
800 <td><p><span class="term"><em class="parameter"><code>inbuf</code></em> :</span></p></td>
801 <td>input buffer</td>
804 <td><p><span class="term"><em class="parameter"><code>inlen</code></em> :</span></p></td>
805 <td>input buffer length</td>
808 <td><p><span class="term"><em class="parameter"><code>outbuf</code></em> :</span></p></td>
809 <td>output buffer</td>
812 <td><p><span class="term"><em class="parameter"><code>uubuf</code></em> :</span></p></td>
813 <td>temporary buffer of 60 bytes</td>
816 <td><p><span class="term"><em class="parameter"><code>state</code></em> :</span></p></td>
817 <td>holds the number of bits that are stored in <em class="parameter"><code>save</code></em>
821 <td><p><span class="term"><em class="parameter"><code>save</code></em> :</span></p></td>
822 <td>leftover bits that have not yet been encoded</td>
825 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
826 <td>the number of bytes encoded.</td>
832 <div class="refsect2">
833 <a name="GMIME-QP-ENCODE-LEN:CAPS"></a><h3>GMIME_QP_ENCODE_LEN()</h3>
834 <pre class="programlisting">#define GMIME_QP_ENCODE_LEN(x) ((size_t) ((((x) / 24) * 74) + 74))
837 Calculates the maximum number of bytes needed to encode the full
838 input buffer of length <em class="parameter"><code>x</code></em> using the quoted-printable encoding.
840 <div class="variablelist"><table border="0">
841 <col align="left" valign="top">
844 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
845 <td>Length of the input data to encode</td>
848 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
849 <td>the number of output bytes needed to encode an input buffer
850 of size <em class="parameter"><code>x</code></em> using the quoted-printable encoding.</td>
856 <div class="refsect2">
857 <a name="g-mime-encoding-quoted-decode-step"></a><h3>g_mime_encoding_quoted_decode_step ()</h3>
858 <pre class="programlisting"><span class="returnvalue">size_t</span> g_mime_encoding_quoted_decode_step (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
859 <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
860 <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
861 <em class="parameter"><code><span class="type">int</span> *state</code></em>,
862 <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);</pre>
864 Decodes a block of quoted-printable encoded data. Performs a
865 'decode step' on a chunk of QP encoded data.
867 <div class="variablelist"><table border="0">
868 <col align="left" valign="top">
871 <td><p><span class="term"><em class="parameter"><code>inbuf</code></em> :</span></p></td>
872 <td>input buffer</td>
875 <td><p><span class="term"><em class="parameter"><code>inlen</code></em> :</span></p></td>
876 <td>input buffer length</td>
879 <td><p><span class="term"><em class="parameter"><code>outbuf</code></em> :</span></p></td>
880 <td>output buffer</td>
883 <td><p><span class="term"><em class="parameter"><code>state</code></em> :</span></p></td>
884 <td>holds the number of bits that are stored in <em class="parameter"><code>save</code></em>
888 <td><p><span class="term"><em class="parameter"><code>save</code></em> :</span></p></td>
889 <td>leftover bits that have not yet been decoded</td>
892 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
893 <td>the number of bytes decoded.</td>
899 <div class="refsect2">
900 <a name="g-mime-encoding-quoted-encode-step"></a><h3>g_mime_encoding_quoted_encode_step ()</h3>
901 <pre class="programlisting"><span class="returnvalue">size_t</span> g_mime_encoding_quoted_encode_step (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
902 <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
903 <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
904 <em class="parameter"><code><span class="type">int</span> *state</code></em>,
905 <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);</pre>
907 Quoted-printable encodes a block of text. Performs an 'encode
908 step', saves left-over state in state and save (initialise to -1 on
911 <div class="variablelist"><table border="0">
912 <col align="left" valign="top">
915 <td><p><span class="term"><em class="parameter"><code>inbuf</code></em> :</span></p></td>
916 <td>input buffer</td>
919 <td><p><span class="term"><em class="parameter"><code>inlen</code></em> :</span></p></td>
920 <td>input buffer length</td>
923 <td><p><span class="term"><em class="parameter"><code>outbuf</code></em> :</span></p></td>
924 <td>output buffer</td>
927 <td><p><span class="term"><em class="parameter"><code>state</code></em> :</span></p></td>
928 <td>holds the number of bits that are stored in <em class="parameter"><code>save</code></em>
932 <td><p><span class="term"><em class="parameter"><code>save</code></em> :</span></p></td>
933 <td>leftover bits that have not yet been encoded</td>
936 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
937 <td>the number of bytes encoded.</td>
943 <div class="refsect2">
944 <a name="g-mime-encoding-quoted-encode-close"></a><h3>g_mime_encoding_quoted_encode_close ()</h3>
945 <pre class="programlisting"><span class="returnvalue">size_t</span> g_mime_encoding_quoted_encode_close (<em class="parameter"><code>const unsigned <span class="type">char</span> *inbuf</code></em>,
946 <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>,
947 <em class="parameter"><code>unsigned <span class="type">char</span> *outbuf</code></em>,
948 <em class="parameter"><code><span class="type">int</span> *state</code></em>,
949 <em class="parameter"><code><span class="type">guint32</span> *save</code></em>);</pre>
951 Quoted-printable encodes a block of text. Call this when finished
952 encoding data with <a class="link" href="gmime-gmime-encodings.html#g-mime-encoding-quoted-encode-step" title="g_mime_encoding_quoted_encode_step ()"><code class="function">g_mime_encoding_quoted_encode_step()</code></a> to flush off
955 <div class="variablelist"><table border="0">
956 <col align="left" valign="top">
959 <td><p><span class="term"><em class="parameter"><code>inbuf</code></em> :</span></p></td>
960 <td>input buffer</td>
963 <td><p><span class="term"><em class="parameter"><code>inlen</code></em> :</span></p></td>
964 <td>input buffer length</td>
967 <td><p><span class="term"><em class="parameter"><code>outbuf</code></em> :</span></p></td>
968 <td>output buffer</td>
971 <td><p><span class="term"><em class="parameter"><code>state</code></em> :</span></p></td>
972 <td>holds the number of bits that are stored in <em class="parameter"><code>save</code></em>
976 <td><p><span class="term"><em class="parameter"><code>save</code></em> :</span></p></td>
977 <td>leftover bits that have not yet been encoded</td>
980 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
981 <td>the number of bytes encoded.</td>
990 Generated by GTK-Doc V1.18</div>