1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows"> 8<title>DWC_Base64Encode</title> 9<LINK rel="stylesheet" href="../css/nitro.css" type="text/css"> 10</head> 11 12<body> 13<a name="dwc__base64_8h_1a8aa39d2d18f12643553e1ea1b927a0a"></a> 14<h1 align="left">DWC_Base64Encode</h1> 15<h2>Syntax</h2> 16 17<dl> 18 <dd> 19<CODE>#include <dwc.h></CODE><BR> 20 <BR> 21 <PRE><CODE>int <a href=DWC_Base64Encode.html#dwc__base64_8h_1a8aa39d2d18f12643553e1ea1b927a0a>DWC_Base64Encode</a>(const char *src, 22 const unsigned long srclen, 23 char *dst, 24 const unsigned long dstlen);</CODE></PRE></dd> 25</dl> 26 27<h2>Arguments</h2> 28 29<TABLE border="1" width="100%"> 30 <TBODY> 31 32 <TR> 33<TD width="13%"><EM><STRONG>src</STRONG></EM></TD> 34<TD width="87%">Pointer to the data to convert.</TD> 35 </TR> 36 37 <TR> 38<TD width="13%"><EM><STRONG>srclen</STRONG></EM></TD> 39<TD width="87%">Data size of the data to convert.</TD> 40 </TR> 41 42 <TR> 43<TD width="13%"><EM><STRONG>dst</STRONG></EM></TD> 44<TD width="87%">Pointer to the buffer used to store the post-conversion data.</TD> 45 </TR> 46 47 <TR> 48<TD width="13%"><EM><STRONG>dstlen</STRONG></EM></TD> 49<TD width="87%">Size (length of the string) of the buffer used to store the data after conversion.</TD> 50 </TR> 51 52 </TBODY> 53</TABLE> 54 55<h2>Return Values</h2> 56 57<TABLE border="1" width="100%"> 58 <TBODY> 59 60 <TR> 61 <TD width="13%"><EM><STRONG>-1</STRONG></EM></TD> 62<TD width="87%">Conversion failed.<br>The maximum length of the string expected after the conversion exceeds the value of the <CODE>dstlen</CODE> argument.</TD> 63 </TR> 64 65 <TR> 66<TD width="13%"><EM><STRONG>Zero or greater</STRONG></EM></TD> 67<TD width="87%">The actual size (string length) of the post-conversion data.</TD> 68 </TR> 69 70 </TBODY> 71</TABLE> 72 73<H2>Description</H2> 74<p>This function encodes the data designated with <CODE>src</CODE> in Base64 and outputs it as a <CODE>char</CODE>-type character string.</p><p>If NULL is designated in <CODE>dst</CODE>, no conversion will occur and the maximum character string length expected after the conversion is returned as the return value. The maximum string length is the value for the worst-case conversion. The actual length is often smaller after conversion.</p><p>The string after conversion does not include a NULL terminator.</p><p>This function uses a special type of Base64. You must use the <A href="DWC_Base64Decode.html"><CODE>DWC_Base64Decode</CODE></a> function to decode data encoded with this function.</p> 75 76<H2>Revision History</H2> 77<DL> 78 79</DL> 80<hr><p>CONFIDENTIAL</p></body> 81</html> 82