summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/a64l.3
diff options
context:
space:
mode:
authoraaron <>1999-06-29 18:36:24 +0000
committeraaron <>1999-06-29 18:36:24 +0000
commit5771e6280ed94b6457e5db9facb5899254e4fb7f (patch)
tree95397a7ed19a0cddf5a2ebb73dee20cf20fe2c29 /src/lib/libc/stdlib/a64l.3
parent403f5844d16c63a63b8ce33a354e4871cb93df4c (diff)
downloadopenbsd-5771e6280ed94b6457e5db9facb5899254e4fb7f.tar.gz
openbsd-5771e6280ed94b6457e5db9facb5899254e4fb7f.tar.bz2
openbsd-5771e6280ed94b6457e5db9facb5899254e4fb7f.zip
first round of repairs on stdlib
Diffstat (limited to 'src/lib/libc/stdlib/a64l.3')
-rw-r--r--src/lib/libc/stdlib/a64l.359
1 files changed, 40 insertions, 19 deletions
diff --git a/src/lib/libc/stdlib/a64l.3 b/src/lib/libc/stdlib/a64l.3
index 0607338cba..1074dbff2e 100644
--- a/src/lib/libc/stdlib/a64l.3
+++ b/src/lib/libc/stdlib/a64l.3
@@ -24,7 +24,7 @@
24.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 24.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26.\" 26.\"
27.\" $OpenBSD: a64l.3,v 1.3 1999/02/27 21:55:53 deraadt Exp $ 27.\" $OpenBSD: a64l.3,v 1.4 1999/06/29 18:36:15 aaron Exp $
28.\" 28.\"
29.Dd August 17, 1997 29.Dd August 17, 1997
30.Dt A64L 3 30.Dt A64L 3
@@ -45,19 +45,36 @@ The
45and 45and
46.Fn l64a 46.Fn l64a
47functions are used to maintain numbers stored in radix-64 47functions are used to maintain numbers stored in radix-64
48ASCII characters. This is a notation by which 32-bit integers 48.Tn ASCII
49characters. This is a notation by which 32-bit integers
49can be represented by up to six characters; each character 50can be represented by up to six characters; each character
50represents a "digit" in a radix-64 notation. 51represents a
52.Dq digit
53in a radix-64 notation.
51.Pp 54.Pp
52The characters used to represent "digits" are '.' for 0, '/' for 1, 55The characters used to represent digits are
53'0' through '9' for 2-11, 'A' through 'Z' for 12-37, and 'a' through 56.Ql \&.
54'z' for 38-63. 57for 0,
58.Ql /
59for 1,
60.Ql 0
61through
62.Ql 9
63for 2-11,
64.Ql A
65through
66.Ql Z
67for 12-37, and
68.Ql a
69through
70.Ql z
71for 38-63.
55.Pp 72.Pp
56The 73The
57.Fn a64l 74.Fn a64l
58function takes a pointer to a null-terminated radix-64 representation 75function takes a pointer to a null-terminated radix-64 representation
59and returns a corresponding 32-bit value. If the string pointed to by 76and returns a corresponding 32-bit value. If the string pointed to by
60.Ar s 77.Fa s
61contains more than six characters, 78contains more than six characters,
62.Fn a64l 79.Fn a64l
63will use the first six. 80will use the first six.
@@ -68,35 +85,39 @@ larger than 32 bits, the return value will be sign-extended.
68.Pp 85.Pp
69.Fn l64a 86.Fn l64a
70takes a long integer argument 87takes a long integer argument
71.Ar l 88.Fa l
72and returns a pointer to the corresponding radix-64 representation. 89and returns a pointer to the corresponding radix-64 representation.
73.Sh RETURN VALUES 90.Sh RETURN VALUES
74On success, 91On success,
75.Fn a64l 92.Fn a64l
76returns a 32-bit representation of 93returns a 32-bit representation of
77.Ar s . 94.Fa s .
78If 95If
79.Ar s 96.Fa s
80is a NULL pointer or if it contains "digits" other than those described above, 97is a null pointer or if it contains digits other than those described above.
81.Fn a64l 98.Fn a64l
82returns -1L and sets the global variable errno to 99returns \-1 and sets the global variable
83.Va EINVAL . 100.Va errno
101to
102.Er EINVAL .
84.Pp 103.Pp
85On success, 104On success,
86.Fn l64a 105.Fn l64a
87returns a pointer to a string containing the radix-64 representation of 106returns a pointer to a string containing the radix-64 representation of
88.Ar l . 107.Fa l .
89If 108If
90.Ar l 109.Fa l
91is 0, 110is 0,
92.Fn l64a 111.Fn l64a
93returns a pointer to the empty string. 112returns a pointer to the empty string.
94If 113If
95.Ar l 114.Fa l
96is negative, 115is negative,
97.Fn l64a 116.Fn l64a
98returns a NULL pointer and sets the global variable errno to 117returns a null pointer and sets the global variable
99.Va EINVAL . 118.Va errno
119to
120.Er EINVAL .
100.Sh WARNINGS 121.Sh WARNINGS
101The value returned by 122The value returned by
102.Fn l64a 123.Fn l64a
@@ -115,7 +136,7 @@ If a long integer is larger than 32 bits, only the low-order
11532 bits are used. 13632 bits are used.
116.Sh STANDARDS 137.Sh STANDARDS
117The 138The
118.Fn a64l 139.Fn a64l
119and 140and
120.Fn l64a 141.Fn l64a
121functions conform to 142functions conform to