]>
Commit | Line | Data |
---|---|---|
a73e75e2 | 1 | \t |
fea681da | 2 | .\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) |
2297bf0e | 3 | .\" |
38f20bb9 | 4 | .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE) |
fea681da | 5 | .\" Distributed under GPL |
38f20bb9 | 6 | .\" %%%LICENSE_END |
fea681da MK |
7 | .\" |
8 | .\" Corrected, aeb, 2002-05-30 | |
9 | .\" | |
fe0fefbf | 10 | .TH A64L 3 2015-03-02 "" "Linux Programmer's Manual" |
fea681da | 11 | .SH NAME |
c13182ef | 12 | a64l, l64a \- convert between long and base-64 |
fea681da MK |
13 | .SH SYNOPSIS |
14 | .B #include <stdlib.h> | |
15 | .sp | |
06024da0 | 16 | .BI "long a64l(const char *" str64 ); |
fea681da MK |
17 | .sp |
18 | .BI "char *l64a(long " value ); | |
cc4615cc MK |
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 (): | |
48ceacc2 MK |
27 | .br |
28 | .RS 4 | |
29 | .ad l | |
30 | _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || | |
31 | _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED | |
32 | .RE | |
33 | .ad | |
fea681da MK |
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. | |
e3e25559 MK |
40 | If the type |
41 | .I long | |
42 | has more than 32 bits, then | |
fea681da MK |
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 | .LP | |
f00d425b | 50 | The 64 digits in the base-64 system are: |
fea681da MK |
51 | .RS |
52 | .nf | |
cf0a9ace | 53 | |
f81fb444 MK |
54 | \&\(aq.\(aq represents a 0 |
55 | \&\(aq/\(aq represents a 1 | |
fea681da MK |
56 | 0-9 represent 2-11 |
57 | A-Z represent 12-37 | |
58 | a-z represent 38-63 | |
cf0a9ace | 59 | |
fea681da MK |
60 | .fi |
61 | .RE | |
fea681da | 62 | So 123 = 59*64^0 + 1*64^1 = "v/". |
20d546ab | 63 | .SH ATTRIBUTES |
a73e75e2 MK |
64 | For an explanation of the terms used in this section, see |
65 | .BR attributes (7). | |
66 | .TS | |
67 | allbox; | |
68 | lb lb lb | |
69 | l l l. | |
70 | Interface Attribute Value | |
71 | T{ | |
20d546ab | 72 | .BR l64a () |
9d9d2572 | 73 | T} Thread safety MT-Unsafe race:l64a |
a73e75e2 | 74 | T{ |
20d546ab | 75 | .BR a64l () |
a73e75e2 MK |
76 | T} Thread safety MT-Safe |
77 | .TE | |
47297adb | 78 | .SH CONFORMING TO |
6a5e713d | 79 | POSIX.1-2001, POSIX.1-2008. |
fea681da MK |
80 | .SH NOTES |
81 | The value returned by | |
4c626751 | 82 | .BR l64a () |
fea681da MK |
83 | may be a pointer to a static buffer, possibly overwritten |
84 | by later calls. | |
85 | .LP | |
d9bfdb9c | 86 | The behavior of |
fea681da MK |
87 | .BR l64a () |
88 | is undefined when | |
89 | .I value | |
c13182ef MK |
90 | is negative. |
91 | If | |
fea681da MK |
92 | .I value |
93 | is zero, it returns an empty string. | |
94 | .LP | |
95 | These functions are broken in glibc before 2.2.5 | |
96 | (puts most significant digit first). | |
97 | .LP | |
98 | This is not the encoding used by | |
99 | .BR uuencode (1). | |
47297adb | 100 | .SH SEE ALSO |
fea681da | 101 | .BR uuencode (1), |
a91665ff | 102 | .\" .BR itoa (3), |
fea681da | 103 | .BR strtoul (3) |