Debian Codegraph @

upstream/debian-trixie/man3/a64l.3

raw
1 '\" t
2 \t
3 .\" Copyright 2002 walter harms ([email protected])
4 .\"
5 .\" SPDX-License-Identifier: GPL-1.0-or-later
6 .\"
7 .\" Corrected, aeb, 2002-05-30
8 .\"
9 .TH a64l 3 2024-05-02 "Linux man-pages 6.9.1"
10 .SH NAME
11 a64l, l64a \- convert between long and base-64
12 .SH LIBRARY
13 Standard C library
14 .RI ( libc ", " \-lc )
15 .SH SYNOPSIS
16 .nf
17 .B #include <stdlib.h>
18 .P
19 .BI "long a64l(const char *" str64 );
20 .BI "char *l64a(long " value );
21 .fi
22 .P
23 .RS -4
24 Feature Test Macro Requirements for glibc (see
25 .BR feature_test_macros (7)):
26 .RE
27 .P
28 .BR a64l (),
29 .BR l64a ():
30 .nf
31 _XOPEN_SOURCE >= 500
32 .\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
33 || /* glibc >= 2.19: */ _DEFAULT_SOURCE
34 || /* glibc <= 2.19: */ _SVID_SOURCE
35 .fi
36 .SH DESCRIPTION
37 These functions provide a conversion between 32-bit long integers
38 and little-endian base-64 ASCII strings (of length zero to six).
39 If the string used as argument for
40 .BR a64l ()
41 has length greater than six, only the first six bytes are used.
42 If the type
43 .I long
44 has more than 32 bits, then
45 .BR l64a ()
46 uses only the low order 32 bits of
47 .IR value ,
48 and
49 .BR a64l ()
50 sign-extends its 32-bit result.
51 .P
52 The 64 digits in the base-64 system are:
53 .P
54 .RS
55 .nf
56 \&\[aq].\[aq] represents a 0
57 \&\[aq]/\[aq] represents a 1
58 0-9 represent 2-11
59 A-Z represent 12-37
60 a-z represent 38-63
61 .fi
62 .RE
63 .P
64 So 123 = 59*64\[ha]0 + 1*64\[ha]1 = "v/".
65 .SH ATTRIBUTES
66 For an explanation of the terms used in this section, see
67 .BR attributes (7).
68 .TS
69 allbox;
70 lbx lb lb
71 l l l.
72 Interface Attribute Value
73 T{
74 .na
75 .nh
76 .BR l64a ()
77 T} Thread safety MT-Unsafe race:l64a
78 T{
79 .na
80 .nh
81 .BR a64l ()
82 T} Thread safety MT-Safe
83 .TE
84 .SH STANDARDS
85 POSIX.1-2008.
86 .SH HISTORY
87 POSIX.1-2001.
88 .SH NOTES
89 The value returned by
90 .BR l64a ()
91 may be a pointer to a static buffer, possibly overwritten
92 by later calls.
93 .P
94 The behavior of
95 .BR l64a ()
96 is undefined when
97 .I value
98 is negative.
99 If
100 .I value
101 is zero, it returns an empty string.
102 .P
103 These functions are broken before glibc 2.2.5
104 (puts most significant digit first).
105 .P
106 This is not the encoding used by
107 .BR uuencode (1).
108 .SH SEE ALSO
109 .BR uuencode (1),
110 .\" .BR itoa (3),
111 .BR strtoul (3)