• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/toolchains/hndtools-armeabi-2013.11/share/doc/arm-arm-none-eabi/html/libc/
1<html lang="en">
2<head>
3<title>a64l - Untitled</title>
4<meta http-equiv="Content-Type" content="text/html">
5<meta name="description" content="Untitled">
6<meta name="generator" content="makeinfo 4.13">
7<link title="Top" rel="start" href="index.html#Top">
8<link rel="up" href="Stdlib.html#Stdlib" title="Stdlib">
9<link rel="prev" href="_005fExit.html#g_t_005fExit" title="_Exit">
10<link rel="next" href="abort.html#abort" title="abort">
11<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
12<meta http-equiv="Content-Style-Type" content="text/css">
13<style type="text/css"><!--
14  pre.display { font-family:inherit }
15  pre.format  { font-family:inherit }
16  pre.smalldisplay { font-family:inherit; font-size:smaller }
17  pre.smallformat  { font-family:inherit; font-size:smaller }
18  pre.smallexample { font-size:smaller }
19  pre.smalllisp    { font-size:smaller }
20  span.sc    { font-variant:small-caps }
21  span.roman { font-family:serif; font-weight:normal; } 
22  span.sansserif { font-family:sans-serif; font-weight:normal; } 
23--></style>
24<link rel="stylesheet" type="text/css" href="../cs.css">
25</head>
26<body>
27<div class="node">
28<a name="a64l"></a>
29<p>
30Next:&nbsp;<a rel="next" accesskey="n" href="abort.html#abort">abort</a>,
31Previous:&nbsp;<a rel="previous" accesskey="p" href="_005fExit.html#g_t_005fExit">_Exit</a>,
32Up:&nbsp;<a rel="up" accesskey="u" href="Stdlib.html#Stdlib">Stdlib</a>
33<hr>
34</div>
35
36<h3 class="section">2.2 <code>a64l</code>, <code>l64a</code>&mdash;convert between radix-64 ASCII string and long</h3>
37
38<p><a name="index-a64l-2"></a><a name="index-l64a-3"></a><strong>Synopsis</strong>
39<pre class="example">     #include &lt;stdlib.h&gt;
40     long a64l(const char *<var>input</var>);
41     char *l64a(long <var>input</var>);
42     
43</pre>
44   <p><strong>Description</strong><br>
45Conversion is performed between long and radix-64 characters.  The
46<code>l64a</code> routine transforms up to 32 bits of input value starting from
47least significant bits to the most significant bits.  The input value
48is split up into a maximum of 5 groups of 6 bits and possibly one
49group of 2 bits (bits 31 and 30).
50
51   <p>Each group of 6 bits forms a value from 0&ndash;63 which is translated into
52a character as follows:
53
54     <ul>
55<li>0 = '.' 
56<li>1 = '/'
57<li>2&ndash;11 = '0' to '9'
58<li>12&ndash;37 = 'A' to 'Z'
59<li>38&ndash;63 = 'a' to 'z'
60</ul>
61
62   <p>When the remaining bits are zero or all bits have been translated, a
63null terminator is appended to the string.  An input value of 0
64results in the empty string.
65
66   <p>The <code>a64l</code> function performs the reverse translation.  Each
67character is used to generate a 6-bit value for up to 30 bits and then
68a 2-bit value to complete a 32-bit result.  The null terminator means
69that the remaining digits are 0.  An empty input string or NULL string
70results in 0L.  An invalid string results in undefined behavior.  If
71the size of a long is greater than 32 bits, the result is sign-extended.
72
73   <p><br>
74<strong>Returns</strong><br>
75<code>l64a</code> returns a null-terminated string of 0 to 6 characters. 
76<code>a64l</code> returns the 32-bit translated value from the input character string.
77
78   <p><br>
79<strong>Portability</strong><br>
80<code>l64a</code> and <code>a64l</code> are non-ANSI and are defined by the Single Unix Specification.
81
82   <p>Supporting OS subroutines required: None.
83
84   <p><br>
85
86   </body></html>
87
88