1A64L(P) POSIX Programmer's Manual A64L(P)
2
3
4
6 a64l, l64a - convert between a 32-bit integer and a radix-64 ASCII
7 string
8
10 #include <stdlib.h>
11
12 long a64l(const char *s);
13 char *l64a(long value);
14
15
17 These functions maintain numbers stored in radix-64 ASCII characters.
18 This is a notation by which 32-bit integers can be represented by up to
19 six characters; each character represents a digit in radix-64 notation.
20 If the type long contains more than 32 bits, only the low-order 32 bits
21 shall be used for these operations.
22
23 The characters used to represent digits are '.' (dot) for 0, '/' for 1,
24 '0' through '9' for [2,11], 'A' through 'Z' for [12,37], and 'a'
25 through 'z' for [38,63].
26
27 The a64l() function shall take a pointer to a radix-64 representation,
28 in which the first digit is the least significant, and return the cor‐
29 responding long value. If the string pointed to by s contains more than
30 six characters, a64l() shall use the first six. If the first six char‐
31 acters of the string contain a null terminator, a64l() shall use only
32 characters preceding the null terminator. The a64l() function shall
33 scan the character string from left to right with the least significant
34 digit on the left, decoding each character as a 6-bit radix-64 number.
35 If the type long contains more than 32 bits, the resulting value is
36 sign-extended. The behavior of a64l() is unspecified if s is a null
37 pointer or the string pointed to by s was not generated by a previous
38 call to l64a().
39
40 The l64a() function shall take a long argument and return a pointer to
41 the corresponding radix-64 representation. The behavior of l64a() is
42 unspecified if value is negative.
43
44 The value returned by l64a() may be a pointer into a static buffer.
45 Subsequent calls to l64a() may overwrite the buffer.
46
47 The l64a() function need not be reentrant. A function that is not
48 required to be reentrant is not required to be thread-safe.
49
51 Upon successful completion, a64l() shall return the long value result‐
52 ing from conversion of the input string. If a string pointed to by s is
53 an empty string, a64l() shall return 0L.
54
55 The l64a() function shall return a pointer to the radix-64 representa‐
56 tion. If value is 0L, l64a() shall return a pointer to an empty
57 string.
58
60 No errors are defined.
61
62 The following sections are informative.
63
65 None.
66
68 If the type long contains more than 32 bits, the result of
69 a64l(l64a(x)) is x in the low-order 32 bits.
70
72 This is not the same encoding as used by either encoding variant of the
73 uuencode utility.
74
76 None.
77
79 strtoul() , the Base Definitions volume of IEEE Std 1003.1-2001,
80 <stdlib.h>, the Shell and Utilities volume of IEEE Std 1003.1-2001,
81 uuencode
82
84 Portions of this text are reprinted and reproduced in electronic form
85 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
86 -- Portable Operating System Interface (POSIX), The Open Group Base
87 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
88 Electrical and Electronics Engineers, Inc and The Open Group. In the
89 event of any discrepancy between this version and the original IEEE and
90 The Open Group Standard, the original IEEE and The Open Group Standard
91 is the referee document. The original Standard can be obtained online
92 at http://www.opengroup.org/unix/online.html .
93
94
95
96IEEE/The Open Group 2003 A64L(P)