]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/a64l.3
0a2841ed2f7f8c039c45c630f5288f8ae35b6a88
[thirdparty/man-pages.git] / man3 / a64l.3
1 \t
2 .\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de)
3 .\"
4 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
5 .\" Distributed under GPL
6 .\" %%%LICENSE_END
7 .\"
8 .\" Corrected, aeb, 2002-05-30
9 .\"
10 .TH A64L 3 2015-08-08 "" "Linux Programmer's Manual"
11 .SH NAME
12 a64l, l64a \- convert between long and base-64
13 .SH SYNOPSIS
14 .B #include <stdlib.h>
15 .sp
16 .BI "long a64l(const char *" str64 );
17 .sp
18 .BI "char *l64a(long " value );
19 .sp
20 .in -4n
21 Feature Test Macro Requirements for glibc (see
22 .BR feature_test_macros (7)):
23 .in
24 .sp
25 .BR a64l (),
26 .BR l64a ():
27 .br
28 .RS 4
29 .ad l
30 _XOPEN_SOURCE\ >=\ 500
31 .\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
32 || /* Glibc since 2.19: */ _DEFAULT_SOURCE
33 || /* Glibc versions <= 2.19: */ _SVID_SOURCE
34 .RE
35 .ad
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 .LP
52 The 64 digits in the base-64 system are:
53 .RS
54 .nf
55
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
62 .fi
63 .RE
64 So 123 = 59*64^0 + 1*64^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 lb lb lb
71 l l l.
72 Interface Attribute Value
73 T{
74 .BR l64a ()
75 T} Thread safety MT-Unsafe race:l64a
76 T{
77 .BR a64l ()
78 T} Thread safety MT-Safe
79 .TE
80 .SH CONFORMING TO
81 POSIX.1-2001, POSIX.1-2008.
82 .SH NOTES
83 The value returned by
84 .BR l64a ()
85 may be a pointer to a static buffer, possibly overwritten
86 by later calls.
87 .LP
88 The behavior of
89 .BR l64a ()
90 is undefined when
91 .I value
92 is negative.
93 If
94 .I value
95 is zero, it returns an empty string.
96 .LP
97 These functions are broken in glibc before 2.2.5
98 (puts most significant digit first).
99 .LP
100 This is not the encoding used by
101 .BR uuencode (1).
102 .SH SEE ALSO
103 .BR uuencode (1),
104 .\" .BR itoa (3),
105 .BR strtoul (3)