1 .\" $NetBSD: a64l.3,v 1.8 2003/04/16 13:34:45 wiz Exp $
3 .\" Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
37 .Nd "convert between a long integer and a base-64 ASCII string"
43 .Fn a64l "const char *s"
47 .Fn l64a_r "long int l" "char *buffer" "int buflen"
53 functions convert between a long integer and its base-64 ASCII string
56 The characters used to represent ``digits'' are
60 `A' - `Z' for 12 - 37, and
61 `a' - `z' for 38 - 63.
64 takes a pointer to a NUL-terminated base-64 ASCII string
67 and returns the corresponding long integer value.
70 takes a long integer value,
72 and returns a pointer to the corresponding NUL-terminated base-64
73 ASCII string representation.
76 performs a conversion identical to that of
78 and stores the resulting representation in the memory area pointed to by
82 characters including the terminating NUL character.
84 On successful completion,
86 returns the long integer value corresponding to the input string.
87 If the string pointed to by
91 returns a value of 0L.
94 returns a pointer to the base-64 ASCII string representation corresponding to
100 returns a pointer to an empty string.
102 On successful completion,
106 is of insufficient length, -1 is returned.
120 Multithreading Extension.
124 function is not reentrant.
125 The value returned by it points into a static buffer area;
128 may overwrite this buffer.
129 In multi-threaded applications,
131 should be used instead.