diff options
author | cvs2svn <admin@example.com> | 2025-04-14 17:32:06 +0000 |
---|---|---|
committer | cvs2svn <admin@example.com> | 2025-04-14 17:32:06 +0000 |
commit | eb8dd9dca1228af0cd132f515509051ecfabf6f6 (patch) | |
tree | edb6da6af7e865d488dc1a29309f1e1ec226e603 /src/lib/libc/stdlib/a64l.3 | |
parent | 247f0352e0ed72a4f476db9dc91f4d982bc83eb2 (diff) | |
download | openbsd-tb_20250414.tar.gz openbsd-tb_20250414.tar.bz2 openbsd-tb_20250414.zip |
This commit was manufactured by cvs2git to create tag 'tb_20250414'.tb_20250414
Diffstat (limited to 'src/lib/libc/stdlib/a64l.3')
-rw-r--r-- | src/lib/libc/stdlib/a64l.3 | 133 |
1 files changed, 0 insertions, 133 deletions
diff --git a/src/lib/libc/stdlib/a64l.3 b/src/lib/libc/stdlib/a64l.3 deleted file mode 100644 index c34af99c88..0000000000 --- a/src/lib/libc/stdlib/a64l.3 +++ /dev/null | |||
@@ -1,133 +0,0 @@ | |||
1 | .\" $OpenBSD: a64l.3,v 1.13 2019/01/25 00:19:25 millert Exp $ | ||
2 | .\" | ||
3 | .\" Copyright (c) 1997 Todd C. Miller <millert@openbsd.org> | ||
4 | .\" | ||
5 | .\" Permission to use, copy, modify, and distribute this software for any | ||
6 | .\" purpose with or without fee is hereby granted, provided that the above | ||
7 | .\" copyright notice and this permission notice appear in all copies. | ||
8 | .\" | ||
9 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
10 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
11 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
12 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
13 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
16 | .\" | ||
17 | .Dd $Mdocdate: January 25 2019 $ | ||
18 | .Dt A64L 3 | ||
19 | .Os | ||
20 | .Sh NAME | ||
21 | .Nm a64l , | ||
22 | .Nm l64a | ||
23 | .Nd convert between 32-bit integer and radix-64 ASCII string | ||
24 | .Sh SYNOPSIS | ||
25 | .In stdlib.h | ||
26 | .Ft long | ||
27 | .Fn a64l "const char *s" | ||
28 | .Ft char * | ||
29 | .Fn l64a "long l" | ||
30 | .Sh DESCRIPTION | ||
31 | The | ||
32 | .Fn a64l | ||
33 | and | ||
34 | .Fn l64a | ||
35 | functions are used to maintain numbers stored in radix-64 | ||
36 | .Tn ASCII | ||
37 | characters. | ||
38 | This is a notation by which 32-bit integers | ||
39 | can be represented by up to six characters; each character represents a | ||
40 | .Dq digit | ||
41 | in a radix-64 notation. | ||
42 | .Pp | ||
43 | The characters used to represent digits are | ||
44 | .Ql \&. | ||
45 | for 0, | ||
46 | .Ql / | ||
47 | for 1, | ||
48 | .Ql 0 | ||
49 | through | ||
50 | .Ql 9 | ||
51 | for 2-11, | ||
52 | .Ql A | ||
53 | through | ||
54 | .Ql Z | ||
55 | for 12-37, and | ||
56 | .Ql a | ||
57 | through | ||
58 | .Ql z | ||
59 | for 38-63. | ||
60 | .Pp | ||
61 | The | ||
62 | .Fn a64l | ||
63 | function takes a pointer to a NUL-terminated radix-64 representation | ||
64 | and returns a corresponding 32-bit value. | ||
65 | If the string pointed to by | ||
66 | .Fa s | ||
67 | contains more than six characters, | ||
68 | .Fn a64l | ||
69 | will use the first six. | ||
70 | .Fn a64l | ||
71 | scans the character string from left to right, decoding | ||
72 | each character as a 6-bit radix-64 number. | ||
73 | If a long integer is | ||
74 | larger than 32 bits, the return value will be sign-extended. | ||
75 | .Pp | ||
76 | .Fn l64a | ||
77 | takes a long integer argument | ||
78 | .Fa l | ||
79 | and returns a pointer to the corresponding radix-64 representation. | ||
80 | .Sh RETURN VALUES | ||
81 | On success, | ||
82 | .Fn a64l | ||
83 | returns a 32-bit representation of | ||
84 | .Fa s . | ||
85 | If | ||
86 | .Fa s | ||
87 | is a null pointer or if it contains digits other than those described above, | ||
88 | .Fn a64l | ||
89 | returns \-1 and sets the global variable | ||
90 | .Va errno | ||
91 | to | ||
92 | .Er EINVAL . | ||
93 | .Pp | ||
94 | On success, | ||
95 | .Fn l64a | ||
96 | returns a pointer to a string containing the radix-64 representation of | ||
97 | .Fa l . | ||
98 | If | ||
99 | .Fa l | ||
100 | is 0, | ||
101 | .Fn l64a | ||
102 | returns a pointer to the empty string. | ||
103 | If | ||
104 | .Fa l | ||
105 | is negative, | ||
106 | .Fn l64a | ||
107 | returns a null pointer and sets the global variable | ||
108 | .Va errno | ||
109 | to | ||
110 | .Er EINVAL . | ||
111 | .Sh STANDARDS | ||
112 | The | ||
113 | .Fn a64l | ||
114 | and | ||
115 | .Fn l64a | ||
116 | functions conform to | ||
117 | .St -xpg4.2 . | ||
118 | .Sh CAVEATS | ||
119 | The value returned by | ||
120 | .Fn l64a | ||
121 | is a pointer into a static buffer, the contents of which | ||
122 | will be overwritten by subsequent calls. | ||
123 | .Pp | ||
124 | The value returned by | ||
125 | .Fn a64l | ||
126 | may be incorrect if the value is too large; for that reason, only strings | ||
127 | that resulted from a call to | ||
128 | .Fn l64a | ||
129 | should be used to call | ||
130 | .Fn a64l . | ||
131 | .Pp | ||
132 | If a long integer is larger than 32 bits, only the low-order | ||
133 | 32 bits are used. | ||