OSDN Git Service

LDP: Update original to LDP v3.79
[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 2014-05-28 "" "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(const 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 ATTRIBUTES
63 .SS Multithreading (see pthreads(7))
64 The
65 .BR l64a ()
66 function is not thread-safe.
67 .LP
68 The
69 .BR a64l ()
70 function is thread-safe.
71 .SH CONFORMING TO
72 POSIX.1-2001.
73 .SH NOTES
74 The value returned by
75 .BR l64a ()
76 may be a pointer to a static buffer, possibly overwritten
77 by later calls.
78 .LP
79 The behavior of
80 .BR l64a ()
81 is undefined when
82 .I value
83 is negative.
84 If
85 .I value
86 is zero, it returns an empty string.
87 .LP
88 These functions are broken in glibc before 2.2.5
89 (puts most significant digit first).
90 .LP
91 This is not the encoding used by
92 .BR uuencode (1).
93 .SH SEE ALSO
94 .BR uuencode (1),
95 .\" .BR itoa (3),
96 .BR strtoul (3)
97 .SH COLOPHON
98 This page is part of release 3.79 of the Linux
99 .I man-pages
100 project.
101 A description of the project,
102 information about reporting bugs,
103 and the latest version of this page,
104 can be found at
105 \%http://www.kernel.org/doc/man\-pages/.