[BACK]Return to a64l.3 CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libc / stdlib

File: [cvs.NetBSD.org] / src / lib / libc / stdlib / a64l.3 (download)

Revision 1.8, Wed Apr 16 13:34:45 2003 UTC (20 years, 11 months ago) by wiz
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base, wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4, netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3, netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2-0, netbsd-2, matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, matt-armv6-nbase, matt-armv6-base, matt-armv6, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-base, hpcarm-cleanup, cube-autoconf-base, cube-autoconf, abandoned-netbsd-4-base, abandoned-netbsd-4
Branch point for: yamt-pf42
Changes since 1.7: +2 -2 lines

Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.

.\" $NetBSD: a64l.3,v 1.8 2003/04/16 13:34:45 wiz Exp $
.\"
.\" Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
.\" by Klaus Klein.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"        This product includes software developed by the NetBSD
.\"        Foundation, Inc. and its contributors.
.\" 4. Neither the name of The NetBSD Foundation nor the names of its
.\"    contributors may be used to endorse or promote products derived
.\"    from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd February 6, 1999
.Dt A64L 3
.Os
.Sh NAME
.Nm a64l ,
.Nm l64a ,
.Nm l64a_r
.Nd "convert between a long integer and a base-64 ASCII string"
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
.In stdlib.h
.Ft long
.Fn a64l "const char *s"
.Ft char *
.Fn l64a "long int l"
.Ft int
.Fn l64a_r "long int l" "char *buffer" "int buflen"
.Sh DESCRIPTION
The
.Fn a64l
and
.Fn l64a
functions convert between a long integer and its base-64 ASCII string
representation.
.Pp
The characters used to represent ``digits'' are
`.' for 0,
`/' for 1,
`0' - `9' for 2 - 11,
`A' - `Z' for 12 - 37, and
`a' - `z' for 38 - 63.
.Pp
.Fn a64l
takes a pointer to a NUL-terminated base-64 ASCII string
representation,
.Fa s ,
and returns the corresponding long integer value.
.Pp
.Fn l64a
takes a long integer value,
.Fa l ,
and returns a pointer to the corresponding NUL-terminated base-64
ASCII string representation.
.Pp
.Fn l64a_r
performs a conversion identical to that of
.Fn l64a
and stores the resulting representation in the memory area pointed to by
.Fa buffer ,
consuming at most
.Fa buflen
characters including the terminating NUL character.
.Sh RETURN VALUES
On successful completion,
.Fn a64l
returns the long integer value corresponding to the input string.
If the string pointed to by
.Fa s
is an empty string,
.Fn a64l
returns a value of 0L.
.Pp
.Fn l64a
returns a pointer to the base-64 ASCII string representation corresponding to
the input value.
If
.Fa l
is 0L,
.Fn l64a
returns a pointer to an empty string.
.Pp
On successful completion,
.Fn l64a_r
returns 0; if
.Fa buffer
is of insufficient length, -1 is returned.
.Sh SEE ALSO
.Xr strtol 3
.Sh STANDARDS
The
.Fn a64l
and
.Fn l64a
functions conform to
.St -xpg4.2 .
The
.Fn l64a_r
function conforms to
.St -svid4 ,
Multithreading Extension.
.Sh BUGS
The
.Fn l64a
function is not reentrant.
The value returned by it points into a static buffer area;
subsequent calls to
.Fn la64a
may overwrite this buffer.
In multi-threaded applications,
.Fn l64a_r
should be used instead.