OSDN Git Service

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