summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib/a64l.3
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdlib/a64l.3')
-rw-r--r--lib/libc/stdlib/a64l.359
1 files changed, 40 insertions, 19 deletions
diff --git a/lib/libc/stdlib/a64l.3 b/lib/libc/stdlib/a64l.3
index 0607338cbaf..1074dbff2e7 100644
--- a/lib/libc/stdlib/a64l.3
+++ b/lib/libc/stdlib/a64l.3
@@ -24,7 +24,7 @@
.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $OpenBSD: a64l.3,v 1.3 1999/02/27 21:55:53 deraadt Exp $
+.\" $OpenBSD: a64l.3,v 1.4 1999/06/29 18:36:15 aaron Exp $
.\"
.Dd August 17, 1997
.Dt A64L 3
@@ -45,19 +45,36 @@ The
and
.Fn l64a
functions are used to maintain numbers stored in radix-64
-ASCII characters. This is a notation by which 32-bit integers
+.Tn 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 a radix-64 notation.
+represents a
+.Dq digit
+in a radix-64 notation.
.Pp
-The characters used to represent "digits" are '.' for 0, '/' for 1,
-'0' through '9' for 2-11, 'A' through 'Z' for 12-37, and 'a' through
-'z' for 38-63.
+The characters used to represent digits are
+.Ql \&.
+for 0,
+.Ql /
+for 1,
+.Ql 0
+through
+.Ql 9
+for 2-11,
+.Ql A
+through
+.Ql Z
+for 12-37, and
+.Ql a
+through
+.Ql z
+for 38-63.
.Pp
The
.Fn a64l
function takes a pointer to a null-terminated radix-64 representation
and returns a corresponding 32-bit value. If the string pointed to by
-.Ar s
+.Fa s
contains more than six characters,
.Fn a64l
will use the first six.
@@ -68,35 +85,39 @@ larger than 32 bits, the return value will be sign-extended.
.Pp
.Fn l64a
takes a long integer argument
-.Ar l
+.Fa l
and returns a pointer to the corresponding radix-64 representation.
.Sh RETURN VALUES
On success,
.Fn a64l
returns a 32-bit representation of
-.Ar s .
+.Fa s .
If
-.Ar s
-is a NULL pointer or if it contains "digits" other than those described above,
+.Fa s
+is a null pointer or if it contains digits other than those described above.
.Fn a64l
-returns -1L and sets the global variable errno to
-.Va EINVAL .
+returns \-1 and sets the global variable
+.Va errno
+to
+.Er EINVAL .
.Pp
On success,
.Fn l64a
returns a pointer to a string containing the radix-64 representation of
-.Ar l .
+.Fa l .
If
-.Ar l
+.Fa l
is 0,
.Fn l64a
returns a pointer to the empty string.
If
-.Ar l
+.Fa l
is negative,
.Fn l64a
-returns a NULL pointer and sets the global variable errno to
-.Va EINVAL .
+returns a null pointer and sets the global variable
+.Va errno
+to
+.Er EINVAL .
.Sh WARNINGS
The value returned by
.Fn l64a
@@ -115,7 +136,7 @@ If a long integer is larger than 32 bits, only the low-order
32 bits are used.
.Sh STANDARDS
The
-.Fn a64l
+.Fn a64l
and
.Fn l64a
functions conform to