151 lines
6.0 KiB
HTML
151 lines
6.0 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<meta name="generator" content="HTML Tidy, see www.w3.org">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 -->
|
|
<!-- Copyright (c) 2001 The Open Group, All Rights Reserved -->
|
|
<title>a64l</title>
|
|
</head>
|
|
<body bgcolor="white">
|
|
<script type="text/javascript" language="JavaScript" src="../jscript/codes.js">
|
|
</script>
|
|
|
|
<basefont size="3"> <a name="a64l"></a> <a name="tag_03_06"></a><!-- a64l -->
|
|
<!--header start-->
|
|
<center><font size="2">The Open Group Base Specifications Issue 6<br>
|
|
IEEE Std 1003.1-2001<br>
|
|
Copyright © 2001 The IEEE and The Open Group, All Rights reserved.</font></center>
|
|
|
|
<!--header end-->
|
|
<hr size="2" noshade>
|
|
<h4><a name="tag_03_06_01"></a>NAME</h4>
|
|
|
|
<blockquote>a64l, l64a - convert between a 32-bit integer and a radix-64 ASCII string</blockquote>
|
|
|
|
<h4><a name="tag_03_06_02"></a>SYNOPSIS</h4>
|
|
|
|
<blockquote class="synopsis">
|
|
<div class="box"><code><tt><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt=
|
|
"[Option Start]" border="0"> #include <<a href="../basedefs/stdlib.h.html">stdlib.h</a>><br>
|
|
<br>
|
|
long a64l(const char *</tt><i>s</i><tt>);<br>
|
|
char *l64a(long</tt> <i>value</i><tt>); <img src="../images/opt-end.gif" alt="[Option End]" border="0"></tt></code></div>
|
|
|
|
<tt><br>
|
|
</tt></blockquote>
|
|
|
|
<h4><a name="tag_03_06_03"></a>DESCRIPTION</h4>
|
|
|
|
<blockquote>
|
|
<p>These functions maintain numbers stored in radix-64 ASCII characters. This is a notation by which 32-bit integers can be
|
|
represented by up to six characters; each character represents a digit in radix-64 notation. If the type <b>long</b> contains more
|
|
than 32 bits, only the low-order 32 bits shall be used for these operations.</p>
|
|
|
|
<p>The characters used to represent digits are <tt>'.'</tt> (dot) for 0, <tt>'/'</tt> for 1, <tt>'0'</tt> through <tt>'9'</tt> for
|
|
[2,11], <tt>'A'</tt> through <tt>'Z'</tt> for [12,37], and <tt>'a'</tt> through <tt>'z'</tt> for [38,63].</p>
|
|
|
|
<p>The <i>a64l</i>() function shall take a pointer to a radix-64 representation, in which the first digit is the least significant,
|
|
and return the corresponding <b>long</b> value. If the string pointed to by <i>s</i> contains more than six characters,
|
|
<i>a64l</i>() shall use the first six. If the first six characters of the string contain a null terminator, <i>a64l</i>() shall use
|
|
only characters preceding the null terminator. The <i>a64l</i>() function shall scan the character string from left to right with
|
|
the least significant digit on the left, decoding each character as a 6-bit radix-64 number. If the type <b>long</b> contains more
|
|
than 32 bits, the resulting value is sign-extended. The behavior of <i>a64l</i>() is unspecified if <i>s</i> is a null pointer or
|
|
the string pointed to by <i>s</i> was not generated by a previous call to <i>l64a</i>().</p>
|
|
|
|
<p>The <i>l64a</i>() function shall take a <b>long</b> argument and return a pointer to the corresponding radix-64 representation.
|
|
The behavior of <i>l64a</i>() is unspecified if <i>value</i> is negative.</p>
|
|
|
|
<p>The value returned by <i>l64a</i>() may be a pointer into a static buffer. Subsequent calls to <i>l64a</i>() may overwrite the
|
|
buffer.</p>
|
|
|
|
<p>The <i>l64a</i>() function need not be reentrant. A function that is not required to be reentrant is not required to be
|
|
thread-safe.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_06_04"></a>RETURN VALUE</h4>
|
|
|
|
<blockquote>
|
|
<p>Upon successful completion, <i>a64l</i>() shall return the <b>long</b> value resulting from conversion of the input string. If a
|
|
string pointed to by <i>s</i> is an empty string, <i>a64l</i>() shall return 0L.</p>
|
|
|
|
<p>The <i>l64a</i>() function shall return a pointer to the radix-64 representation. If <i>value</i> is 0L, <i>l64a</i>() shall
|
|
return a pointer to an empty string.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_06_05"></a>ERRORS</h4>
|
|
|
|
<blockquote>
|
|
<p>No errors are defined.</p>
|
|
</blockquote>
|
|
|
|
<hr>
|
|
<div class="box"><em>The following sections are informative.</em></div>
|
|
|
|
<h4><a name="tag_03_06_06"></a>EXAMPLES</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_06_07"></a>APPLICATION USAGE</h4>
|
|
|
|
<blockquote>
|
|
<p>If the type <b>long</b> contains more than 32 bits, the result of <i>a64l</i>(<i>l64a</i>(<i>x</i>)) is <i>x</i> in the
|
|
low-order 32 bits.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_06_08"></a>RATIONALE</h4>
|
|
|
|
<blockquote>
|
|
<p>This is not the same encoding as used by either encoding variant of the <a href="../utilities/uuencode.html"><i>uuencode</i></a>
|
|
utility.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_06_09"></a>FUTURE DIRECTIONS</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_06_10"></a>SEE ALSO</h4>
|
|
|
|
<blockquote>
|
|
<p><a href="strtoul.html"><i>strtoul</i>()</a> , the Base Definitions volume of IEEE Std 1003.1-2001, <a href=
|
|
"../basedefs/stdlib.h.html"><i><stdlib.h></i></a>, the Shell and Utilities volume of IEEE Std 1003.1-2001, <a href=
|
|
"../utilities/uuencode.html"><i>uuencode</i></a></p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_06_11"></a>CHANGE HISTORY</h4>
|
|
|
|
<blockquote>
|
|
<p>First released in Issue 4, Version 2.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_06_12"></a>Issue 5</h4>
|
|
|
|
<blockquote>
|
|
<p>Moved from X/OPEN UNIX extension to BASE.</p>
|
|
|
|
<p>Normative text previously in the APPLICATION USAGE section is moved to the DESCRIPTION.</p>
|
|
|
|
<p>A note indicating that these functions need not be reentrant is added to the DESCRIPTION.</p>
|
|
</blockquote>
|
|
|
|
<div class="box"><em>End of informative text.</em></div>
|
|
|
|
<hr>
|
|
<hr size="2" noshade>
|
|
<center><font size="2"><!--footer start-->
|
|
UNIX ® is a registered Trademark of The Open Group.<br>
|
|
POSIX ® is a registered Trademark of The IEEE.<br>
|
|
[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
|
|
"../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>
|
|
]</font></center>
|
|
|
|
<!--footer end-->
|
|
<hr size="2" noshade>
|
|
</body>
|
|
</html>
|
|
|