/usr/share/doc/libortp8-dev/html/b64_8c.html is in libortp-dev 3.3.2-4.1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>oRTP: src/b64.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">oRTP
 <span id="projectnumber">0.16.3</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Data Structures</a> |
<a href="#define-members">Defines</a> |
<a href="#typedef-members">Typedefs</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">src/b64.c File Reference</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include "ortp/b64.h"</code><br/>
<code>#include <assert.h></code><br/>
<code>#include <string.h></code><br/>
<code>#include "ortp/port.h"</code><br/>
</div><table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structb64ErrorString__t__.html">b64ErrorString_t_</a></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abb02ef9c156eb61724e43f329a04c9bd"></a><!-- doxytag: member="b64.c::B64_VER_C_B64_MAJOR" ref="abb02ef9c156eb61724e43f329a04c9bd" args="" -->
#define </td><td class="memItemRight" valign="bottom"><b>B64_VER_C_B64_MAJOR</b>   1</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3942b4aad9c6babe73035f988ee8f897"></a><!-- doxytag: member="b64.c::B64_VER_C_B64_MINOR" ref="a3942b4aad9c6babe73035f988ee8f897" args="" -->
#define </td><td class="memItemRight" valign="bottom"><b>B64_VER_C_B64_MINOR</b>   2</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad18448a1555a2b386ca78978eab02526"></a><!-- doxytag: member="b64.c::B64_VER_C_B64_REVISION" ref="ad18448a1555a2b386ca78978eab02526" args="" -->
#define </td><td class="memItemRight" valign="bottom"><b>B64_VER_C_B64_REVISION</b>   3</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2e70643ce49a47b41b640cab45e705e3"></a><!-- doxytag: member="b64.c::B64_VER_C_B64_EDIT" ref="a2e70643ce49a47b41b640cab45e705e3" args="" -->
#define </td><td class="memItemRight" valign="bottom"><b>B64_VER_C_B64_EDIT</b>   17</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad7a5728d96878819b0dacf5554bb4a6e"></a><!-- doxytag: member="b64.c::NUM_PLAIN_DATA_BYTES" ref="ad7a5728d96878819b0dacf5554bb4a6e" args="" -->
#define </td><td class="memItemRight" valign="bottom"><b>NUM_PLAIN_DATA_BYTES</b>   (3)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab04dac0a4446dc3fc45f4c42c5be2103"></a><!-- doxytag: member="b64.c::NUM_ENCODED_DATA_BYTES" ref="ab04dac0a4446dc3fc45f4c42c5be2103" args="" -->
#define </td><td class="memItemRight" valign="bottom"><b>NUM_ENCODED_DATA_BYTES</b>   (4)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0bf05373027b4f63e6a275eb4c3da931"></a><!-- doxytag: member="b64.c::NUM_ELEMENTS" ref="a0bf05373027b4f63e6a275eb4c3da931" args="(x)" -->
#define </td><td class="memItemRight" valign="bottom"><b>NUM_ELEMENTS</b>(x)   (sizeof(x) / sizeof(x[0]))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>SEVERITY_STR_DECL</b>(rc, desc)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>SEVERITY_STR_ENTRY</b>(rc)</td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aac1b6d81700849f88a1acf5d994eaa0b"></a><!-- doxytag: member="b64.c::b64ErrorString_t_" ref="aac1b6d81700849f88a1acf5d994eaa0b" args="" -->
typedef struct <a class="el" href="structb64ErrorString__t__.html">b64ErrorString_t_</a> </td><td class="memItemRight" valign="bottom"><b>b64ErrorString_t_</b></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="b64_8c.html#aa518340c8e76af0cf0753c15bebfc2af">b64_encode</a> (void const *src, size_t srcSize, char *dest, size_t destLen)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Encodes a block of binary data into Base-64. <a href="#aa518340c8e76af0cf0753c15bebfc2af"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="b64_8c.html#ab08b80124c4db4bf423feff5f7ffa5f2">b64_encode2</a> (void const *src, size_t srcSize, char *dest, size_t destLen, unsigned flags, int lineLen, B64_RC *rc)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Encodes a block of binary data into Base-64. <a href="#ab08b80124c4db4bf423feff5f7ffa5f2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="b64_8c.html#af0a580e1694f2addb2fec740214f959a">b64_decode</a> (char const *src, size_t srcLen, void *dest, size_t destSize)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Decodes a sequence of Base-64 into a block of binary data. <a href="#af0a580e1694f2addb2fec740214f959a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="b64_8c.html#a50a93e4f6a922c5314a9cb50befc2d13">b64_decode2</a> (char const *src, size_t srcLen, void *dest, size_t destSize, unsigned flags, char const **badChar, B64_RC *rc)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Decodes a sequence of Base-64 into a block of binary data. <a href="#a50a93e4f6a922c5314a9cb50befc2d13"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char const * </td><td class="memItemRight" valign="bottom"><a class="el" href="b64_8c.html#a84adc01b9c5028eee501d2fb2bef9a11">b64_getErrorString</a> (B64_RC code)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the textual description of the error. <a href="#a84adc01b9c5028eee501d2fb2bef9a11"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="b64_8c.html#a48c61d4785f8b1f8122a5a9f778a9f20">b64_getErrorStringLength</a> (B64_RC code)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the length of the textual description of the error. <a href="#a48c61d4785f8b1f8122a5a9f778a9f20"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Implementation file for the b64 library </p>
</div><hr/><h2>Define Documentation</h2>
<a class="anchor" id="aede330f4e9a5a2b3c2995f7afc2b4546"></a><!-- doxytag: member="b64.c::SEVERITY_STR_DECL" ref="aede330f4e9a5a2b3c2995f7afc2b4546" args="(rc, desc)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define SEVERITY_STR_DECL</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">rc, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">desc </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">\
static <span class="keyword">const</span> <span class="keywordtype">char</span> s_str##rc[] = desc; \
static <span class="keyword">const</span> <a class="code" href="structb64ErrorString__t__.html">b64ErrorString_t_</a> s_rct##rc = { rc, s_str##rc, NUM_ELEMENTS(s_str##rc) - 1 }
</pre></div>
</div>
</div>
<a class="anchor" id="a8af0337317f4ae55ed9c30c352e7416b"></a><!-- doxytag: member="b64.c::SEVERITY_STR_ENTRY" ref="a8af0337317f4ae55ed9c30c352e7416b" args="(rc)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define SEVERITY_STR_ENTRY</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">rc</td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">\
&s_rct##rc
</pre></div>
</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="af0a580e1694f2addb2fec740214f959a"></a><!-- doxytag: member="b64.c::b64_decode" ref="af0a580e1694f2addb2fec740214f959a" args="(char const *src, size_t srcLen, void *dest, size_t destSize)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t <a class="el" href="b64_8c.html#af0a580e1694f2addb2fec740214f959a">b64_decode</a> </td>
<td>(</td>
<td class="paramtype">char const * </td>
<td class="paramname"><em>src</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>srcLen</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"><em>dest</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>destSize</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Decodes a sequence of Base-64 into a block of binary data. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">src</td><td>Pointer to the Base-64 block to be decoded. May not be NULL, except when <code>dest</code> is NULL, in which case it is ignored. If <code>dest</code> is NULL, and <code>src</code> is <b>not</b> NULL, then the returned value is calculated exactly, otherwise a value is returned that is guaranteed to be large enough to hold the decoded block.</td></tr>
<tr><td class="paramname">srcLen</td><td>Length of block to be encoded. Must be an integral of 4, the Base-64 encoding quantum, otherwise the Base-64 block is assumed to be invalid </td></tr>
<tr><td class="paramname">dest</td><td>Pointer to the buffer into which the result is to be written. May be NULL, in which case the function returns the required length </td></tr>
<tr><td class="paramname">destSize</td><td>Length of the buffer into which the result is to be written. Must be at least as large as that indicated by the return value from <code>b64_decode(src, srcSize, NULL, 0)</code>, even in the case where the encoded form contains a number of characters that will be ignored, resulting in a lower total length of converted form.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if the size of the buffer was insufficient, or the length of the converted buffer was longer than <code>destSize</code> </dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>The function returns the required length if <code>dest</code> is NULL. The returned size might be larger than the actual required size, but will never be smaller.</dd>
<dd>
<a class="anchor" id="anchor__4_characters"></a>The behaviour of both <a class="el" href="b64_8c.html#ab08b80124c4db4bf423feff5f7ffa5f2">b64_encode2()</a> and <a class="el" href="b64_8c.html#a50a93e4f6a922c5314a9cb50befc2d13">b64_decode2()</a> are undefined if the line length is not a multiple of 4.</dd>
<dd>
Threading: The function is fully re-entrant.</dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd>b64::decode() </dd></dl>
</div>
</div>
<a class="anchor" id="a50a93e4f6a922c5314a9cb50befc2d13"></a><!-- doxytag: member="b64.c::b64_decode2" ref="a50a93e4f6a922c5314a9cb50befc2d13" args="(char const *src, size_t srcLen, void *dest, size_t destSize, unsigned flags, char const **badChar, B64_RC *rc)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t <a class="el" href="b64_8c.html#a50a93e4f6a922c5314a9cb50befc2d13">b64_decode2</a> </td>
<td>(</td>
<td class="paramtype">char const * </td>
<td class="paramname"><em>src</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>srcLen</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"><em>dest</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>destSize</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned </td>
<td class="paramname"><em>flags</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char const ** </td>
<td class="paramname"><em>badChar</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">B64_RC * </td>
<td class="paramname"><em>rc</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Decodes a sequence of Base-64 into a block of binary data. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">src</td><td>Pointer to the Base-64 block to be decoded. May not be NULL, except when <code>dest</code> is NULL, in which case it is ignored. If <code>dest</code> is NULL, and <code>src</code> is <b>not</b> NULL, then the returned value is calculated exactly, otherwise a value is returned that is guaranteed to be large enough to hold the decoded block.</td></tr>
<tr><td class="paramname">srcLen</td><td>Length of block to be encoded. Must be an integral of 4, the Base-64 encoding quantum, otherwise the Base-64 block is assumed to be invalid </td></tr>
<tr><td class="paramname">dest</td><td>Pointer to the buffer into which the result is to be written. May be NULL, in which case the function returns the required length </td></tr>
<tr><td class="paramname">destSize</td><td>Length of the buffer into which the result is to be written. Must be at least as large as that indicated by the return value from <code>b64_decode(src, srcSize, NULL, 0)</code>, even in the case where the encoded form contains a number of characters that will be ignored, resulting in a lower total length of converted form. </td></tr>
<tr><td class="paramname">flags</td><td>A combination of the B64_FLAGS enumeration, that moderate the behaviour of the function. </td></tr>
<tr><td class="paramname">rc</td><td>The return code representing the status of the operation. May be NULL. </td></tr>
<tr><td class="paramname">badChar</td><td>If the flags parameter does not contain B64_F_STOP_ON_NOTHING, this parameter specifies the address of a pointer that will be set to point to any character in the sequence that stops the parsing, as dictated by the flags parameter. May be NULL.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if the size of the buffer was insufficient, or the length of the converted buffer was longer than <code>destSize</code>, or a bad character stopped parsing.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>The function returns the required length if <code>dest</code> is NULL. The returned size might be larger than the actual required size, but will never be smaller.</dd>
<dd>
The behaviour of both <a class="el" href="b64_8c.html#ab08b80124c4db4bf423feff5f7ffa5f2">b64_encode2()</a> and <a class="el" href="b64_8c.html#a50a93e4f6a922c5314a9cb50befc2d13">b64_decode2()</a> are undefined if the line length is not a multiple of 4.</dd>
<dd>
Threading: The function is fully re-entrant.</dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd>b64::decode() </dd></dl>
</div>
</div>
<a class="anchor" id="aa518340c8e76af0cf0753c15bebfc2af"></a><!-- doxytag: member="b64.c::b64_encode" ref="aa518340c8e76af0cf0753c15bebfc2af" args="(void const *src, size_t srcSize, char *dest, size_t destLen)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t <a class="el" href="b64_8c.html#aa518340c8e76af0cf0753c15bebfc2af">b64_encode</a> </td>
<td>(</td>
<td class="paramtype">void const * </td>
<td class="paramname"><em>src</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>srcSize</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char * </td>
<td class="paramname"><em>dest</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>destLen</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Encodes a block of binary data into Base-64. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">src</td><td>Pointer to the block to be encoded. May not be NULL, except when <code>dest</code> is NULL, in which case it is ignored. </td></tr>
<tr><td class="paramname">srcSize</td><td>Length of block to be encoded </td></tr>
<tr><td class="paramname">dest</td><td>Pointer to the buffer into which the result is to be written. May be NULL, in which case the function returns the required length </td></tr>
<tr><td class="paramname">destLen</td><td>Length of the buffer into which the result is to be written. Must be at least as large as that indicated by the return value from <a class="el" href="b64_8c.html#aa518340c8e76af0cf0753c15bebfc2af">b64_encode(NULL, srcSize, NULL, 0)</a>.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if the size of the buffer was insufficient, or the length of the converted buffer was longer than <code>destLen</code> </dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>The function returns the required length if <code>dest</code> is NULL</dd>
<dd>
The function returns the required length if <code>dest</code> is NULL. The returned size might be larger than the actual required size, but will never be smaller.</dd>
<dd>
Threading: The function is fully re-entrant.</dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd>b64::encode() </dd></dl>
</div>
</div>
<a class="anchor" id="ab08b80124c4db4bf423feff5f7ffa5f2"></a><!-- doxytag: member="b64.c::b64_encode2" ref="ab08b80124c4db4bf423feff5f7ffa5f2" args="(void const *src, size_t srcSize, char *dest, size_t destLen, unsigned flags, int lineLen, B64_RC *rc)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t <a class="el" href="b64_8c.html#ab08b80124c4db4bf423feff5f7ffa5f2">b64_encode2</a> </td>
<td>(</td>
<td class="paramtype">void const * </td>
<td class="paramname"><em>src</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>srcSize</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char * </td>
<td class="paramname"><em>dest</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>destLen</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned </td>
<td class="paramname"><em>flags</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>lineLen</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">B64_RC * </td>
<td class="paramname"><em>rc</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Encodes a block of binary data into Base-64. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">src</td><td>Pointer to the block to be encoded. May not be NULL, except when <code>dest</code> is NULL, in which case it is ignored. </td></tr>
<tr><td class="paramname">srcSize</td><td>Length of block to be encoded </td></tr>
<tr><td class="paramname">dest</td><td>Pointer to the buffer into which the result is to be written. May be NULL, in which case the function returns the required length </td></tr>
<tr><td class="paramname">destLen</td><td>Length of the buffer into which the result is to be written. Must be at least as large as that indicated by the return value from <a class="el" href="b64_8c.html#ab08b80124c4db4bf423feff5f7ffa5f2">b64_encode2(NULL, srcSize, NULL, 0, flags, lineLen, rc)</a>. </td></tr>
<tr><td class="paramname">flags</td><td>A combination of the B64_FLAGS enumeration, that moderate the behaviour of the function </td></tr>
<tr><td class="paramname">lineLen</td><td>If the flags parameter contains B64_F_LINE_LEN_USE_PARAM, then this parameter represents the length of the lines into which the encoded form is split, with a hard line break ('\r\n'). If this value is 0, then the line is not split. If it is <0, then the RFC-1113 recommended line length of 64 is used </td></tr>
<tr><td class="paramname">rc</td><td>The return code representing the status of the operation. May be NULL.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if the size of the buffer was insufficient, or the length of the converted buffer was longer than <code>destLen</code> </dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>The function returns the required length if <code>dest</code> is NULL. The returned size might be larger than the actual required size, but will never be smaller.</dd>
<dd>
Threading: The function is fully re-entrant.</dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd>b64::encode() </dd></dl>
</div>
</div>
<a class="anchor" id="a84adc01b9c5028eee501d2fb2bef9a11"></a><!-- doxytag: member="b64.c::b64_getErrorString" ref="a84adc01b9c5028eee501d2fb2bef9a11" args="(B64_RC code)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char const* <a class="el" href="b64_8c.html#a84adc01b9c5028eee501d2fb2bef9a11">b64_getErrorString</a> </td>
<td>(</td>
<td class="paramtype">B64_RC </td>
<td class="paramname"><em>code</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the textual description of the error. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">code</td><td>The <a class="el" href="">error code</a> </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a48c61d4785f8b1f8122a5a9f778a9f20"></a><!-- doxytag: member="b64.c::b64_getErrorStringLength" ref="a48c61d4785f8b1f8122a5a9f778a9f20" args="(B64_RC code)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t <a class="el" href="b64_8c.html#a48c61d4785f8b1f8122a5a9f778a9f20">b64_getErrorStringLength</a> </td>
<td>(</td>
<td class="paramtype">B64_RC </td>
<td class="paramname"><em>code</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the length of the textual description of the error. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="b64_8c.html#a84adc01b9c5028eee501d2fb2bef9a11" title="Returns the textual description of the error.">b64_getErrorString()</a></dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">code</td><td>The <a class="el" href="">error code</a> </td></tr>
</table>
</dd>
</dl>
</div>
</div>
</div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Mar 9 2012 18:31:57 for oRTP by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>
|