]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) |
2 | .\" Distributed under GPL | |
3 | .\" | |
4 | .\" Corrected, aeb, 2002-05-30 | |
5 | .\" | |
cc4615cc | 6 | .TH A64L 3 2007-07-26 "" "Linux Programmer's Manual" |
fea681da | 7 | .SH NAME |
c13182ef | 8 | a64l, l64a \- convert between long and base-64 |
fea681da MK |
9 | .SH SYNOPSIS |
10 | .B #include <stdlib.h> | |
11 | .sp | |
12 | .BI "long a64l(char *" str64 ); | |
13 | .sp | |
14 | .BI "char *l64a(long " value ); | |
cc4615cc MK |
15 | .sp |
16 | .in -4n | |
17 | Feature Test Macro Requirements for glibc (see | |
18 | .BR feature_test_macros (7)): | |
19 | .in | |
20 | .sp | |
21 | .BR a64l (), | |
22 | .BR l64a (): | |
23 | _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 | |
fea681da MK |
24 | .SH DESCRIPTION |
25 | These functions provide a conversion between 32-bit long integers | |
26 | and little-endian base-64 ASCII strings (of length zero to six). | |
27 | If the string used as argument for | |
28 | .BR a64l () | |
29 | has length greater than six, only the first six bytes are used. | |
e3e25559 MK |
30 | If the type |
31 | .I long | |
32 | has more than 32 bits, then | |
fea681da MK |
33 | .BR l64a () |
34 | uses only the low order 32 bits of | |
35 | .IR value , | |
36 | and | |
37 | .BR a64l () | |
38 | sign-extends its 32-bit result. | |
39 | .LP | |
40 | The 64 digits in the base 64 system are: | |
41 | .RS | |
42 | .nf | |
cf0a9ace | 43 | |
fea681da MK |
44 | \&'.' represents a 0 |
45 | \&'/' represents a 1 | |
46 | 0-9 represent 2-11 | |
47 | A-Z represent 12-37 | |
48 | a-z represent 38-63 | |
cf0a9ace | 49 | |
fea681da MK |
50 | .fi |
51 | .RE | |
fea681da | 52 | So 123 = 59*64^0 + 1*64^1 = "v/". |
2b2581ee MK |
53 | .SH "CONFORMING TO" |
54 | POSIX.1-2001. | |
fea681da MK |
55 | .SH NOTES |
56 | The value returned by | |
57 | .BR a64l () | |
58 | may be a pointer to a static buffer, possibly overwritten | |
59 | by later calls. | |
60 | .LP | |
d9bfdb9c | 61 | The behavior of |
fea681da MK |
62 | .BR l64a () |
63 | is undefined when | |
64 | .I value | |
c13182ef MK |
65 | is negative. |
66 | If | |
fea681da MK |
67 | .I value |
68 | is zero, it returns an empty string. | |
69 | .LP | |
70 | These functions are broken in glibc before 2.2.5 | |
71 | (puts most significant digit first). | |
72 | .LP | |
73 | This is not the encoding used by | |
74 | .BR uuencode (1). | |
fea681da MK |
75 | .SH "SEE ALSO" |
76 | .BR uuencode (1), | |
a91665ff | 77 | .\" .BR itoa (3), |
fea681da | 78 | .BR strtoul (3) |