| C N V _ U L O N G T O A ( )
| | | | | SOURCE: qdev_autodocs.txt 1.163 (12/09/2014) English INDEP - CNV_#?
----------------------------------------------------------------------------
NAME
cnv_ULONGtoA() - Stringifies the int. in one of four
ways.
SYNOPSIS
ptr = cnv_ULONGtoA(buffer, value, flags);
UBYTE *cnv_ULONGtoA(UBYTE *, ULONG, ULONG);
FUNCTION
This function allows to represent the integer visually
as: binary or octal or decimal or hexadecimal.
INPUTS
buffer - Buffer space in which converted value will
appear. The buffer size is defined under the
QDEV_CNV_UXXXLEN in header file and it is an
absolute minimum. Also, dont rely on this
input as a pointer, use returned pointer!!!
value - ULONG value.
flags - Generally flags are organised in such a way
that 0xaabbccdd means: aa - number of zeros
to pad, bb - type of prefix per num. system,
cc - lower or upper case letters in hex.,
dd - type of output(bin., oct., dec., hex.)
See header file for exact values. You simply
OR('|') them.
RETURNS
Returns pointer to the start of the converted value.
BASES
None.
NOTES
If 'flags' are 0 then standard decimal conversion will
be performed.
Please note, decimal conversion is the slowest of all
numeral systems, cus it relies on division which is
generally slow.
This function allows signedness(use respective macro).
UQUAD variant of this function exists.
SEE ALSO
cnv_AtoULONG(), cnv_ULONGtoBITS()
EXAMPLE
...
UBYTE buf[QDEV_CNV_UXXXLEN];
FPrintf(Output(), "%s\n", (LONG)cnv_ULONGtoA(buf, 999,
QDEV_CNV_UXXXFALGN));
BUGS
None known.
----------------------------------------------------------------------------
| |
| |