~ubuntu-branches/debian/jessie/glib2.0/jessie

« back to all changes in this revision

Viewing changes to docs/reference/glib/html/glib-Base64-Encoding.html

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2009-02-15 13:00:43 UTC
  • mto: (1.4.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 70.
  • Revision ID: james.westby@ubuntu.com-20090215130043-6snh45flhit8oalb
Tags: upstream-2.18.4
Import upstream version 2.18.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
2
<html>
3
3
<head>
4
 
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
 
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
5
<title>Base64 Encoding</title>
6
 
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
7
 
<link rel="start" href="index.html" title="GLib Reference Manual">
 
6
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
 
7
<link rel="home" href="index.html" title="GLib Reference Manual">
8
8
<link rel="up" href="glib-utilities.html" title="GLib Utilities">
9
9
<link rel="prev" href="glib-Unicode-Manipulation.html" title="Unicode Manipulation">
10
10
<link rel="next" href="glib-Data-Checksums.html" title="Data Checksums">
11
 
<meta name="generator" content="GTK-Doc V1.9 (XML mode)">
 
11
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
13
<link rel="chapter" href="glib.html" title="GLib Overview">
14
14
<link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals">
26
26
<link rel="index" href="ix08.html" title="Index of new symbols in 2.12">
27
27
<link rel="index" href="ix09.html" title="Index of new symbols in 2.14">
28
28
<link rel="index" href="ix10.html" title="Index of new symbols in 2.16">
 
29
<link rel="index" href="ix11.html" title="Index of new symbols in 2.18">
29
30
</head>
30
31
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
31
32
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
36
37
<th width="100%" align="center">GLib Reference Manual</th>
37
38
<td><a accesskey="n" href="glib-Data-Checksums.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
38
39
</tr>
39
 
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3081705" class="shortcut">Top</a>
40
 
                  &#160;|&#160;
41
 
                  <a href="#id3081943" class="shortcut">Description</a></nobr></td></tr>
 
40
<tr><td colspan="5" class="shortcuts">
 
41
<a href="#glib-Base64-Encoding.synopsis" class="shortcut">Top</a>
 
42
                 | 
 
43
                <a href="#glib-Base64-Encoding.description" class="shortcut">Description</a>
 
44
</td></tr>
42
45
</table>
43
46
<div class="refentry" lang="en">
44
47
<a name="glib-Base64-Encoding"></a><div class="titlepage"></div>
45
48
<div class="refnamediv"><table width="100%"><tr>
46
49
<td valign="top">
47
 
<h2>
48
 
<a name="id3081705"></a><span class="refentrytitle">Base64 Encoding</span>
49
 
</h2>
50
 
<p>Base64 Encoding &#8212; encodes and decodes data in Base64 format</p>
 
50
<h2><span class="refentrytitle"><a name="glib-Base64-Encoding.top_of_page"></a>Base64 Encoding</span></h2>
 
51
<p>Base64 Encoding — encodes and decodes data in Base64 format</p>
51
52
</td>
52
53
<td valign="top" align="right"></td>
53
54
</tr></table></div>
54
55
<div class="refsynopsisdiv">
55
 
<h2>Synopsis</h2>
 
56
<a name="glib-Base64-Encoding.synopsis"></a><h2>Synopsis</h2>
56
57
<pre class="synopsis">
57
58
 
58
59
#include &lt;glib.h&gt;
59
60
 
60
 
 
61
 
<a class="link" href="glib-Basic-Types.html#gsize">gsize</a>               <a class="link" href="glib-Base64-Encoding.html#g-base64-encode-step">g_base64_encode_step</a>                (const <a class="link" href="glib-Basic-Types.html#guchar">guchar</a> *in,
62
 
                                                         <a class="link" href="glib-Basic-Types.html#gsize">gsize</a> len,
63
 
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> break_lines,
64
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *out,
65
 
                                                         <a class="link" href="glib-Basic-Types.html#gint">gint</a> *state,
66
 
                                                         <a class="link" href="glib-Basic-Types.html#gint">gint</a> *save);
67
 
<a class="link" href="glib-Basic-Types.html#gsize">gsize</a>               <a class="link" href="glib-Base64-Encoding.html#g-base64-encode-close">g_base64_encode_close</a>               (<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> break_lines,
68
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *out,
69
 
                                                         <a class="link" href="glib-Basic-Types.html#gint">gint</a> *state,
70
 
                                                         <a class="link" href="glib-Basic-Types.html#gint">gint</a> *save);
71
 
<a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              <a class="link" href="glib-Base64-Encoding.html#g-base64-encode">g_base64_encode</a>                     (const <a class="link" href="glib-Basic-Types.html#guchar">guchar</a> *data,
72
 
                                                         <a class="link" href="glib-Basic-Types.html#gsize">gsize</a> len);
73
 
<a class="link" href="glib-Basic-Types.html#gsize">gsize</a>               <a class="link" href="glib-Base64-Encoding.html#g-base64-decode-step">g_base64_decode_step</a>                (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *in,
74
 
                                                         <a class="link" href="glib-Basic-Types.html#gsize">gsize</a> len,
75
 
                                                         <a class="link" href="glib-Basic-Types.html#guchar">guchar</a> *out,
76
 
                                                         <a class="link" href="glib-Basic-Types.html#gint">gint</a> *state,
77
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> *save);
78
 
<a class="link" href="glib-Basic-Types.html#guchar">guchar</a>*             <a class="link" href="glib-Base64-Encoding.html#g-base64-decode">g_base64_decode</a>                     (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *text,
79
 
                                                         <a class="link" href="glib-Basic-Types.html#gsize">gsize</a> *out_len);
 
61
<a class="link" href="glib-Basic-Types.html#gsize" title="gsize">gsize</a>               <a class="link" href="glib-Base64-Encoding.html#g-base64-encode-step" title="g_base64_encode_step ()">g_base64_encode_step</a>                (const <a class="link" href="glib-Basic-Types.html#guchar" title="guchar">guchar</a> *in,
 
62
                                                         <a class="link" href="glib-Basic-Types.html#gsize" title="gsize">gsize</a> len,
 
63
                                                         <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> break_lines,
 
64
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *out,
 
65
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> *state,
 
66
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> *save);
 
67
<a class="link" href="glib-Basic-Types.html#gsize" title="gsize">gsize</a>               <a class="link" href="glib-Base64-Encoding.html#g-base64-encode-close" title="g_base64_encode_close ()">g_base64_encode_close</a>               (<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> break_lines,
 
68
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *out,
 
69
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> *state,
 
70
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> *save);
 
71
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a>*              <a class="link" href="glib-Base64-Encoding.html#g-base64-encode" title="g_base64_encode ()">g_base64_encode</a>                     (const <a class="link" href="glib-Basic-Types.html#guchar" title="guchar">guchar</a> *data,
 
72
                                                         <a class="link" href="glib-Basic-Types.html#gsize" title="gsize">gsize</a> len);
 
73
<a class="link" href="glib-Basic-Types.html#gsize" title="gsize">gsize</a>               <a class="link" href="glib-Base64-Encoding.html#g-base64-decode-step" title="g_base64_decode_step ()">g_base64_decode_step</a>                (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *in,
 
74
                                                         <a class="link" href="glib-Basic-Types.html#gsize" title="gsize">gsize</a> len,
 
75
                                                         <a class="link" href="glib-Basic-Types.html#guchar" title="guchar">guchar</a> *out,
 
76
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> *state,
 
77
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> *save);
 
78
<a class="link" href="glib-Basic-Types.html#guchar" title="guchar">guchar</a> *            <a class="link" href="glib-Base64-Encoding.html#g-base64-decode" title="g_base64_decode ()">g_base64_decode</a>                     (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *text,
 
79
                                                         <a class="link" href="glib-Basic-Types.html#gsize" title="gsize">gsize</a> *out_len);
80
80
</pre>
81
81
</div>
82
82
<div class="refsect1" lang="en">
83
 
<a name="id3081943"></a><h2>Description</h2>
 
83
<a name="glib-Base64-Encoding.description"></a><h2>Description</h2>
84
84
<p>
85
85
Base64 is an encoding that allows to encode a sequence of arbitrary
86
86
bytes as a sequence of printable ASCII characters. For the definition
87
 
of Base64, see <a class="ulink" href="http://www.ietf.org/rfc/rfc1421.txt" target="_top">RFC 
 
87
of Base64, see <a class="ulink" href="http://www.ietf.org/rfc/rfc1421.txt" target="_top">RFC
88
88
1421</a> or <a class="ulink" href="http://www.ietf.org/rfc/rfc2045.txt" target="_top">RFC
89
89
2045</a>. Base64 is most commonly used as a MIME transfer encoding
90
90
for email.
91
91
</p>
92
92
<p>
93
 
GLib supports incremental encoding using <a class="link" href="glib-Base64-Encoding.html#g-base64-encode-step"><code class="function">g_base64_encode_step()</code></a> and
94
 
<a class="link" href="glib-Base64-Encoding.html#g-base64-encode-close"><code class="function">g_base64_encode_close()</code></a>. Incremental decoding can be done with
95
 
<a class="link" href="glib-Base64-Encoding.html#g-base64-decode-step"><code class="function">g_base64_decode_step()</code></a>. To encode or decode data in one go, use 
96
 
<a class="link" href="glib-Base64-Encoding.html#g-base64-encode"><code class="function">g_base64_encode()</code></a> or <a class="link" href="glib-Base64-Encoding.html#g-base64-decode"><code class="function">g_base64_decode()</code></a>. 
 
93
GLib supports incremental encoding using <a class="link" href="glib-Base64-Encoding.html#g-base64-encode-step" title="g_base64_encode_step ()"><code class="function">g_base64_encode_step()</code></a> and
 
94
<a class="link" href="glib-Base64-Encoding.html#g-base64-encode-close" title="g_base64_encode_close ()"><code class="function">g_base64_encode_close()</code></a>. Incremental decoding can be done with
 
95
<a class="link" href="glib-Base64-Encoding.html#g-base64-decode-step" title="g_base64_decode_step ()"><code class="function">g_base64_decode_step()</code></a>. To encode or decode data in one go, use
 
96
<a class="link" href="glib-Base64-Encoding.html#g-base64-encode" title="g_base64_encode ()"><code class="function">g_base64_encode()</code></a> or <a class="link" href="glib-Base64-Encoding.html#g-base64-decode" title="g_base64_decode ()"><code class="function">g_base64_decode()</code></a>.
97
97
</p>
98
98
<p>
99
99
Support for Base64 encoding has been added in GLib 2.12.
100
100
</p>
101
101
</div>
102
102
<div class="refsect1" lang="en">
103
 
<a name="id3082037"></a><h2>Details</h2>
 
103
<a name="glib-Base64-Encoding.details"></a><h2>Details</h2>
104
104
<div class="refsect2" lang="en">
105
 
<a name="id3082047"></a><h3>
106
 
<a name="g-base64-encode-step"></a>g_base64_encode_step ()</h3>
107
 
<a class="indexterm" name="id3082063"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gsize">gsize</a>               g_base64_encode_step                (const <a class="link" href="glib-Basic-Types.html#guchar">guchar</a> *in,
108
 
                                                         <a class="link" href="glib-Basic-Types.html#gsize">gsize</a> len,
109
 
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> break_lines,
110
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *out,
111
 
                                                         <a class="link" href="glib-Basic-Types.html#gint">gint</a> *state,
112
 
                                                         <a class="link" href="glib-Basic-Types.html#gint">gint</a> *save);</pre>
 
105
<a name="g-base64-encode-step"></a><h3>g_base64_encode_step ()</h3>
 
106
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gsize" title="gsize">gsize</a>               g_base64_encode_step                (const <a class="link" href="glib-Basic-Types.html#guchar" title="guchar">guchar</a> *in,
 
107
                                                         <a class="link" href="glib-Basic-Types.html#gsize" title="gsize">gsize</a> len,
 
108
                                                         <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> break_lines,
 
109
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *out,
 
110
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> *state,
 
111
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> *save);</pre>
113
112
<p>
114
113
Incrementally encode a sequence of binary data into it's Base-64 stringified
115
114
representation. By calling this function multiple times you can convert 
117
116
</p>
118
117
<p>
119
118
When all of the data has been converted you must call 
120
 
<a class="link" href="glib-Base64-Encoding.html#g-base64-encode-close"><code class="function">g_base64_encode_close()</code></a> to flush the saved state.
 
119
<a class="link" href="glib-Base64-Encoding.html#g-base64-encode-close" title="g_base64_encode_close ()"><code class="function">g_base64_encode_close()</code></a> to flush the saved state.
121
120
</p>
122
121
<p>
123
122
The output buffer must be large enough to fit all the data that will
130
129
It breaks the lines at 72 columns instead of putting all of the text on 
131
130
the same line. This avoids problems with long lines in the email system.</p>
132
131
<p>
133
 
 
134
132
</p>
135
133
<div class="variablelist"><table border="0">
136
134
<col align="left" valign="top">
137
135
<tbody>
138
136
<tr>
139
 
<td><p><span class="term"><em class="parameter"><code>in</code></em>&#160;:</span></p></td>
 
137
<td><p><span class="term"><em class="parameter"><code>in</code></em> :</span></p></td>
140
138
<td> the binary data to encode
141
139
</td>
142
140
</tr>
143
141
<tr>
144
 
<td><p><span class="term"><em class="parameter"><code>len</code></em>&#160;:</span></p></td>
 
142
<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
145
143
<td> the length of <em class="parameter"><code>in</code></em>
146
144
</td>
147
145
</tr>
148
146
<tr>
149
 
<td><p><span class="term"><em class="parameter"><code>break_lines</code></em>&#160;:</span></p></td>
 
147
<td><p><span class="term"><em class="parameter"><code>break_lines</code></em> :</span></p></td>
150
148
<td> whether to break long lines
151
149
</td>
152
150
</tr>
153
151
<tr>
154
 
<td><p><span class="term"><em class="parameter"><code>out</code></em>&#160;:</span></p></td>
 
152
<td><p><span class="term"><em class="parameter"><code>out</code></em> :</span></p></td>
155
153
<td> pointer to destination buffer
156
154
</td>
157
155
</tr>
158
156
<tr>
159
 
<td><p><span class="term"><em class="parameter"><code>state</code></em>&#160;:</span></p></td>
160
 
<td> Saved state between steps, initialize to 0
161
 
</td>
162
 
</tr>
163
 
<tr>
164
 
<td><p><span class="term"><em class="parameter"><code>save</code></em>&#160;:</span></p></td>
165
 
<td> Saved state between steps, initialize to 0
166
 
</td>
167
 
</tr>
168
 
<tr>
169
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
 
157
<td><p><span class="term"><em class="parameter"><code>state</code></em> :</span></p></td>
 
158
<td> Saved state between steps, initialize to 0
 
159
</td>
 
160
</tr>
 
161
<tr>
 
162
<td><p><span class="term"><em class="parameter"><code>save</code></em> :</span></p></td>
 
163
<td> Saved state between steps, initialize to 0
 
164
</td>
 
165
</tr>
 
166
<tr>
 
167
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
170
168
<td> The number of bytes of output that was written
171
169
 
172
170
</td>
173
171
</tr>
174
172
</tbody>
175
173
</table></div>
176
 
<p class="since">Since  2.12
177
 
</p>
 
174
<p class="since">Since 2.12</p>
178
175
</div>
179
176
<hr>
180
177
<div class="refsect2" lang="en">
181
 
<a name="id3082302"></a><h3>
182
 
<a name="g-base64-encode-close"></a>g_base64_encode_close ()</h3>
183
 
<a class="indexterm" name="id3082318"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gsize">gsize</a>               g_base64_encode_close               (<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> break_lines,
184
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *out,
185
 
                                                         <a class="link" href="glib-Basic-Types.html#gint">gint</a> *state,
186
 
                                                         <a class="link" href="glib-Basic-Types.html#gint">gint</a> *save);</pre>
187
 
<p>
188
 
Flush the status from a sequence of calls to <a class="link" href="glib-Base64-Encoding.html#g-base64-encode-step"><code class="function">g_base64_encode_step()</code></a>.</p>
189
 
<p>
190
 
 
 
178
<a name="g-base64-encode-close"></a><h3>g_base64_encode_close ()</h3>
 
179
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gsize" title="gsize">gsize</a>               g_base64_encode_close               (<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> break_lines,
 
180
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *out,
 
181
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> *state,
 
182
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> *save);</pre>
 
183
<p>
 
184
Flush the status from a sequence of calls to <a class="link" href="glib-Base64-Encoding.html#g-base64-encode-step" title="g_base64_encode_step ()"><code class="function">g_base64_encode_step()</code></a>.</p>
 
185
<p>
191
186
</p>
192
187
<div class="variablelist"><table border="0">
193
188
<col align="left" valign="top">
194
189
<tbody>
195
190
<tr>
196
 
<td><p><span class="term"><em class="parameter"><code>break_lines</code></em>&#160;:</span></p></td>
 
191
<td><p><span class="term"><em class="parameter"><code>break_lines</code></em> :</span></p></td>
197
192
<td> whether to break long lines
198
193
</td>
199
194
</tr>
200
195
<tr>
201
 
<td><p><span class="term"><em class="parameter"><code>out</code></em>&#160;:</span></p></td>
 
196
<td><p><span class="term"><em class="parameter"><code>out</code></em> :</span></p></td>
202
197
<td> pointer to destination buffer
203
198
</td>
204
199
</tr>
205
200
<tr>
206
 
<td><p><span class="term"><em class="parameter"><code>state</code></em>&#160;:</span></p></td>
207
 
<td> Saved state from <a class="link" href="glib-Base64-Encoding.html#g-base64-encode-step"><code class="function">g_base64_encode_step()</code></a>
208
 
</td>
209
 
</tr>
210
 
<tr>
211
 
<td><p><span class="term"><em class="parameter"><code>save</code></em>&#160;:</span></p></td>
212
 
<td> Saved state from <a class="link" href="glib-Base64-Encoding.html#g-base64-encode-step"><code class="function">g_base64_encode_step()</code></a>
213
 
</td>
214
 
</tr>
215
 
<tr>
216
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
 
201
<td><p><span class="term"><em class="parameter"><code>state</code></em> :</span></p></td>
 
202
<td> Saved state from <a class="link" href="glib-Base64-Encoding.html#g-base64-encode-step" title="g_base64_encode_step ()"><code class="function">g_base64_encode_step()</code></a>
 
203
</td>
 
204
</tr>
 
205
<tr>
 
206
<td><p><span class="term"><em class="parameter"><code>save</code></em> :</span></p></td>
 
207
<td> Saved state from <a class="link" href="glib-Base64-Encoding.html#g-base64-encode-step" title="g_base64_encode_step ()"><code class="function">g_base64_encode_step()</code></a>
 
208
</td>
 
209
</tr>
 
210
<tr>
 
211
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
217
212
<td> The number of bytes of output that was written
218
213
 
219
214
</td>
220
215
</tr>
221
216
</tbody>
222
217
</table></div>
223
 
<p class="since">Since  2.12
224
 
</p>
 
218
<p class="since">Since 2.12</p>
225
219
</div>
226
220
<hr>
227
221
<div class="refsect2" lang="en">
228
 
<a name="id3082485"></a><h3>
229
 
<a name="g-base64-encode"></a>g_base64_encode ()</h3>
230
 
<a class="indexterm" name="id3082500"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_base64_encode                     (const <a class="link" href="glib-Basic-Types.html#guchar">guchar</a> *data,
231
 
                                                         <a class="link" href="glib-Basic-Types.html#gsize">gsize</a> len);</pre>
 
222
<a name="g-base64-encode"></a><h3>g_base64_encode ()</h3>
 
223
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a>*              g_base64_encode                     (const <a class="link" href="glib-Basic-Types.html#guchar" title="guchar">guchar</a> *data,
 
224
                                                         <a class="link" href="glib-Basic-Types.html#gsize" title="gsize">gsize</a> len);</pre>
232
225
<p>
233
226
Encode a sequence of binary data into its Base-64 stringified
234
227
representation.</p>
235
228
<p>
236
 
 
237
229
</p>
238
230
<div class="variablelist"><table border="0">
239
231
<col align="left" valign="top">
240
232
<tbody>
241
233
<tr>
242
 
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
 
234
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
243
235
<td> the binary data to encode
244
236
</td>
245
237
</tr>
246
238
<tr>
247
 
<td><p><span class="term"><em class="parameter"><code>len</code></em>&#160;:</span></p></td>
 
239
<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
248
240
<td> the length of <em class="parameter"><code>data</code></em>
249
241
</td>
250
242
</tr>
251
243
<tr>
252
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
 
244
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
253
245
<td> a newly allocated, zero-terminated Base-64 encoded
254
246
              string representing <em class="parameter"><code>data</code></em>. The returned string must 
255
 
              be freed with <a class="link" href="glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a>.
 
247
              be freed with <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a>.
256
248
 
257
249
</td>
258
250
</tr>
259
251
</tbody>
260
252
</table></div>
261
 
<p class="since">Since  2.12
262
 
</p>
 
253
<p class="since">Since 2.12</p>
263
254
</div>
264
255
<hr>
265
256
<div class="refsect2" lang="en">
266
 
<a name="id3082614"></a><h3>
267
 
<a name="g-base64-decode-step"></a>g_base64_decode_step ()</h3>
268
 
<a class="indexterm" name="id3082629"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gsize">gsize</a>               g_base64_decode_step                (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *in,
269
 
                                                         <a class="link" href="glib-Basic-Types.html#gsize">gsize</a> len,
270
 
                                                         <a class="link" href="glib-Basic-Types.html#guchar">guchar</a> *out,
271
 
                                                         <a class="link" href="glib-Basic-Types.html#gint">gint</a> *state,
272
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> *save);</pre>
 
257
<a name="g-base64-decode-step"></a><h3>g_base64_decode_step ()</h3>
 
258
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gsize" title="gsize">gsize</a>               g_base64_decode_step                (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *in,
 
259
                                                         <a class="link" href="glib-Basic-Types.html#gsize" title="gsize">gsize</a> len,
 
260
                                                         <a class="link" href="glib-Basic-Types.html#guchar" title="guchar">guchar</a> *out,
 
261
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> *state,
 
262
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> *save);</pre>
273
263
<p>
274
264
Incrementally decode a sequence of binary data from its Base-64 stringified
275
265
representation. By calling this function multiple times you can convert 
280
270
be written to it. Since base64 encodes 3 bytes in 4 chars you need
281
271
at least: <em class="parameter"><code>len</code></em> * 3 / 4 bytes.</p>
282
272
<p>
283
 
 
284
273
</p>
285
274
<div class="variablelist"><table border="0">
286
275
<col align="left" valign="top">
287
276
<tbody>
288
277
<tr>
289
 
<td><p><span class="term"><em class="parameter"><code>in</code></em>&#160;:</span></p></td>
 
278
<td><p><span class="term"><em class="parameter"><code>in</code></em> :</span></p></td>
290
279
<td> binary input data
291
280
</td>
292
281
</tr>
293
282
<tr>
294
 
<td><p><span class="term"><em class="parameter"><code>len</code></em>&#160;:</span></p></td>
 
283
<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
295
284
<td> max length of <em class="parameter"><code>in</code></em> data to decode
296
285
</td>
297
286
</tr>
298
287
<tr>
299
 
<td><p><span class="term"><em class="parameter"><code>out</code></em>&#160;:</span></p></td>
 
288
<td><p><span class="term"><em class="parameter"><code>out</code></em> :</span></p></td>
300
289
<td> output buffer
301
290
</td>
302
291
</tr>
303
292
<tr>
304
 
<td><p><span class="term"><em class="parameter"><code>state</code></em>&#160;:</span></p></td>
305
 
<td> Saved state between steps, initialize to 0
306
 
</td>
307
 
</tr>
308
 
<tr>
309
 
<td><p><span class="term"><em class="parameter"><code>save</code></em>&#160;:</span></p></td>
310
 
<td> Saved state between steps, initialize to 0
311
 
</td>
312
 
</tr>
313
 
<tr>
314
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
 
293
<td><p><span class="term"><em class="parameter"><code>state</code></em> :</span></p></td>
 
294
<td> Saved state between steps, initialize to 0
 
295
</td>
 
296
</tr>
 
297
<tr>
 
298
<td><p><span class="term"><em class="parameter"><code>save</code></em> :</span></p></td>
 
299
<td> Saved state between steps, initialize to 0
 
300
</td>
 
301
</tr>
 
302
<tr>
 
303
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
315
304
<td> The number of bytes of output that was written
316
305
 
317
306
</td>
318
307
</tr>
319
308
</tbody>
320
309
</table></div>
321
 
<p class="since">Since  2.12
322
 
</p>
 
310
<p class="since">Since 2.12</p>
323
311
</div>
324
312
<hr>
325
313
<div class="refsect2" lang="en">
326
 
<a name="id3082806"></a><h3>
327
 
<a name="g-base64-decode"></a>g_base64_decode ()</h3>
328
 
<a class="indexterm" name="id3082821"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#guchar">guchar</a>*             g_base64_decode                     (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *text,
329
 
                                                         <a class="link" href="glib-Basic-Types.html#gsize">gsize</a> *out_len);</pre>
 
314
<a name="g-base64-decode"></a><h3>g_base64_decode ()</h3>
 
315
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#guchar" title="guchar">guchar</a> *            g_base64_decode                     (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *text,
 
316
                                                         <a class="link" href="glib-Basic-Types.html#gsize" title="gsize">gsize</a> *out_len);</pre>
330
317
<p>
331
318
Decode a sequence of Base-64 encoded text into binary data</p>
332
319
<p>
333
 
 
334
320
</p>
335
321
<div class="variablelist"><table border="0">
336
322
<col align="left" valign="top">
337
323
<tbody>
338
324
<tr>
339
 
<td><p><span class="term"><em class="parameter"><code>text</code></em>&#160;:</span></p></td>
 
325
<td><p><span class="term"><em class="parameter"><code>text</code></em> :</span></p></td>
340
326
<td> zero-terminated string with base64 text to decode
341
327
</td>
342
328
</tr>
343
329
<tr>
344
 
<td><p><span class="term"><em class="parameter"><code>out_len</code></em>&#160;:</span></p></td>
 
330
<td><p><span class="term"><em class="parameter"><code>out_len</code></em> :</span></p></td>
345
331
<td> The length of the decoded data is written here
346
332
</td>
347
333
</tr>
348
334
<tr>
349
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
 
335
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
350
336
<td> a newly allocated buffer containing the binary data
351
337
              that <em class="parameter"><code>text</code></em> represents. The returned buffer must
352
 
              be freed with <a class="link" href="glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a>.
 
338
              be freed with <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a>.
353
339
 
354
340
</td>
355
341
</tr>
356
342
</tbody>
357
343
</table></div>
358
 
<p class="since">Since  2.12
359
 
</p>
360
 
</div>
361
 
</div>
362
 
<div class="refsect1" lang="en">
363
 
<a name="id3082931"></a><div class="refsect2" lang="en"><a name="id3082932"></a></div>
 
344
<p class="since">Since 2.12</p>
 
345
</div>
 
346
</div>
 
347
</div>
 
348
<div class="footer">
364
349
<hr>
365
 
<div class="refsect2" lang="en"><a name="id3082933"></a></div>
366
 
</div>
367
 
</div>
 
350
          Generated by GTK-Doc V1.11</div>
368
351
</body>
369
352
</html>