Add a manual page for a64l() and l64a().

This commit is contained in:
kleink 1998-06-14 17:47:15 +00:00
parent d4cc868265
commit d393974f10
2 changed files with 107 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.37 1998/02/02 23:20:35 perry Exp $
# $NetBSD: Makefile.inc,v 1.38 1998/06/14 17:49:21 kleink Exp $
# from: @(#)Makefile.inc 8.3 (Berkeley) 2/4/95
# stdlib sources
@ -18,12 +18,13 @@ SRCS+= _rand48.c _strtoq.c _strtouq.c a64l.c abort.c atexit.c atof.c \
.include "${.CURDIR}/arch/${MACHINE_ARCH}/stdlib/Makefile.inc"
MAN+= abort.3 abs.3 alloca.3 atexit.3 atof.3 atoi.3 atol.3 bsearch.3 \
MAN+= a64l.3 abort.3 abs.3 alloca.3 atexit.3 atof.3 atoi.3 atol.3 bsearch.3 \
calloc.3 div.3 exit.3 free.3 getenv.3 getopt.3 getsubopt.3 \
labs.3 ldiv.3 malloc.3 memory.3 qabs.3 qdiv.3 qsort.3 \
radixsort.3 rand48.3 rand.3 random.3 realloc.3 strtod.3 \
strtol.3 strtoul.3 system.3
MLINKS+=a64l.3 l64a.3
MLINKS+=getenv.3 setenv.3 getenv.3 unsetenv.3 getenv.3 putenv.3
MLINKS+=qsort.3 heapsort.3 qsort.3 mergesort.3
MLINKS+=rand.3 rand_r.3

104
lib/libc/stdlib/a64l.3 Normal file
View File

@ -0,0 +1,104 @@
.\" $NetBSD: a64l.3,v 1.1 1998/06/14 17:47:15 kleink Exp $
.\"
.\" Copyright (c) 1997 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 June 14, 1998
.Dt A64L 3
.Os NetBSD 1.0
.Sh NAME
.Nm a64l ,
.Nm l64a
.Nd convert between a long integer and a base-64 ASCII string
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
.Fd #include <stdlib.h>
.Ft long
.Fn a64l "const char *s"
.Ft char *
.Fn l64a "long l"
.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.
.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.
.Sh SEE ALSO
.Xr strtol 3
.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.