3 <<utoa>>---unsigned integer to string
10 char *utoa(unsigned <[value]>, char *<[str]>, int <[base]>);
11 char *__utoa(unsigned <[value]>, char *<[str]>, int <[base]>);
14 <<utoa>> converts the unsigned integer [<value>] to a null-terminated string
15 using the specified base, which must be between 2 and 36, inclusive.
16 <[str]> should be an array long enough to contain the converted
17 value, which in the worst case is sizeof(int)*8+1 bytes.
20 A pointer to the string, <[str]>, or NULL if <[base]> is invalid.
25 No supporting OS subroutine calls are required.
31 __utoa (unsigned value
,
35 const char digits
[] = "0123456789abcdefghijklmnopqrstuvwxyz";
40 /* Check base is supported. */
41 if ((base
< 2) || (base
> 36))
47 /* Convert to string. Digits are in reverse order. */
51 remainder
= value
% base
;
52 str
[i
++] = digits
[remainder
];
58 for (j
= 0, i
--; j
< i
; j
++, i
--)
73 return __utoa (value
, str
, base
);