Plan 9 from Bell Labs’s /usr/web/sources/contrib/fgb/root/sys/lib/ape/man/3/a64l

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved 
.TH "A64L" 3P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual"
.\" a64l 
.SH PROLOG
This manual page is part of the POSIX Programmer's Manual.
The Linux implementation of this interface may differ (consult
the corresponding Linux manual page for details of Linux behavior),
or the interface may not be implemented on Linux.
.SH NAME
a64l, l64a \- convert between a 32-bit integer and a radix-64 ASCII
string
.SH SYNOPSIS
.LP
\fB#include <stdlib.h>
.br
.sp
long a64l(const char *\fP\fIs\fP\fB);
.br
char *l64a(long\fP \fIvalue\fP\fB); \fP
\fB
.br
\fP
.SH DESCRIPTION
.LP
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 \fBlong\fP contains more
than 32 bits, only the low-order 32 bits shall be used for these operations.
.LP
The characters used to represent digits are \fB'.'\fP (dot) for 0,
\fB'/'\fP for 1, \fB'0'\fP through \fB'9'\fP for
[2,11], \fB'A'\fP through \fB'Z'\fP for [12,37], and \fB'a'\fP through
\fB'z'\fP for [38,63].
.LP
The \fIa64l\fP() function shall take a pointer to a radix-64 representation,
in which the first digit is the least significant,
and return the corresponding \fBlong\fP value. If the string pointed
to by \fIs\fP contains more than six characters,
\fIa64l\fP() shall use the first six. If the first six characters
of the string contain a null terminator, \fIa64l\fP() shall use
only characters preceding the null terminator. The \fIa64l\fP() 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 \fBlong\fP contains more
than 32 bits, the resulting value is sign-extended. The behavior of
\fIa64l\fP() is unspecified if \fIs\fP is a null pointer or
the string pointed to by \fIs\fP was not generated by a previous call
to \fIl64a\fP().
.LP
The \fIl64a\fP() function shall take a \fBlong\fP argument and return
a pointer to the corresponding radix-64 representation.
The behavior of \fIl64a\fP() is unspecified if \fIvalue\fP is negative.
.LP
The value returned by \fIl64a\fP() may be a pointer into a static
buffer. Subsequent calls to \fIl64a\fP() may overwrite the
buffer.
.LP
The \fIl64a\fP() function need not be reentrant. A function that is
not required to be reentrant is not required to be
thread-safe.
.SH RETURN VALUE
.LP
Upon successful completion, \fIa64l\fP() shall return the \fBlong\fP
value resulting from conversion of the input string. If a
string pointed to by \fIs\fP is an empty string, \fIa64l\fP() shall
return 0L.
.LP
The \fIl64a\fP() function shall return a pointer to the radix-64 representation.
If \fIvalue\fP is 0L, \fIl64a\fP() shall
return a pointer to an empty string.
.SH ERRORS
.LP
No errors are defined.
.LP
\fIThe following sections are informative.\fP
.SH EXAMPLES
.LP
None.
.SH APPLICATION USAGE
.LP
If the type \fBlong\fP contains more than 32 bits, the result of \fIa64l\fP(\fIl64a\fP(\fIx\fP))
is \fIx\fP in the
low-order 32 bits.
.SH RATIONALE
.LP
This is not the same encoding as used by either encoding variant of
the \fIuuencode\fP
utility.
.SH FUTURE DIRECTIONS
.LP
None.
.SH SEE ALSO
.LP
\fIstrtoul\fP(), the Base Definitions volume of IEEE\ Std\ 1003.1-2001,
\fI<stdlib.h>\fP, the Shell and Utilities volume of IEEE\ Std\ 1003.1-2001,
\fIuuencode\fP
.SH COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
-- Portable Operating System Interface (POSIX), The Open Group Base
Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group. In the
event of any discrepancy between this version and the original IEEE and
The Open Group Standard, the original IEEE and The Open Group Standard
is the referee document. The original Standard can be obtained online at
http://www.opengroup.org/unix/online.html .

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.