ioctl_tty.2: Document ioctls: TCGETS2, TCSETS2, TCSETSW2, TCSETSF2
[man-pages.git] / man3 / a64l.3
blob4014212fde37415c2a441edeefca5b55215ecd2e
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 2021-03-22 "" "Linux Programmer's Manual"
11 .SH NAME
12 a64l, l64a \- convert between long and base-64
13 .SH SYNOPSIS
14 .nf
15 .B #include <stdlib.h>
16 .PP
17 .BI "long a64l(const char *" str64 );
18 .BI "char *l64a(long " value );
19 .fi
20 .PP
21 .RS -4
22 Feature Test Macro Requirements for glibc (see
23 .BR feature_test_macros (7)):
24 .RE
25 .PP
26 .BR a64l (),
27 .BR l64a ():
28 .nf
29     _XOPEN_SOURCE >= 500
30 .\"    || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
31         || /* Glibc since 2.19: */ _DEFAULT_SOURCE
32         || /* Glibc <= 2.19: */ _SVID_SOURCE
33 .fi
34 .SH DESCRIPTION
35 These functions provide a conversion between 32-bit long integers
36 and little-endian base-64 ASCII strings (of length zero to six).
37 If the string used as argument for
38 .BR a64l ()
39 has length greater than six, only the first six bytes are used.
40 If the type
41 .I long
42 has more than 32 bits, then
43 .BR l64a ()
44 uses only the low order 32 bits of
45 .IR value ,
46 and
47 .BR a64l ()
48 sign-extends its 32-bit result.
49 .PP
50 The 64 digits in the base-64 system are:
51 .PP
52 .RS
53 .nf
54 \&\(aq.\(aq     represents a 0
55 \&\(aq/\(aq     represents a 1
56 0-9     represent  2-11
57 A-Z     represent 12-37
58 a-z     represent 38-63
59 .fi
60 .RE
61 .PP
62 So 123 = 59*64\(ha0 + 1*64\(ha1 = "v/".
63 .SH ATTRIBUTES
64 For an explanation of the terms used in this section, see
65 .BR attributes (7).
66 .ad l
67 .nh
68 .TS
69 allbox;
70 lbx lb lb
71 l l l.
72 Interface       Attribute       Value
74 .BR l64a ()
75 T}      Thread safety   MT-Unsafe race:l64a
77 .BR a64l ()
78 T}      Thread safety   MT-Safe
79 .TE
80 .hy
81 .ad
82 .sp 1
83 .SH CONFORMING TO
84 POSIX.1-2001, POSIX.1-2008.
85 .SH NOTES
86 The value returned by
87 .BR l64a ()
88 may be a pointer to a static buffer, possibly overwritten
89 by later calls.
90 .PP
91 The behavior of
92 .BR l64a ()
93 is undefined when
94 .I value
95 is negative.
97 .I value
98 is zero, it returns an empty string.
99 .PP
100 These functions are broken in glibc before 2.2.5
101 (puts most significant digit first).
103 This is not the encoding used by
104 .BR uuencode (1).
105 .SH SEE ALSO
106 .BR uuencode (1),
107 .\" .BR itoa (3),
108 .BR strtoul (3)