Printing different types as string.
More...
#define VTM_FMT_CHARS_INT32 11 |
Maximum needed buffer size for storing a 32 bit integer value as string
#define VTM_FMT_CHARS_INT64 20 |
Maximum needed buffer size for storing a 64 bit integer value as string
#define VTM_FMT_CHARS_HEX_SIZE 16 |
Maximum needed buffer size for storing a 64 bit size_t value as hex-string
VTM_API unsigned int vtm_fmt_int |
( |
char * |
dst, |
|
|
int |
val |
|
) |
| |
Print string representation of signed integer.
- Parameters
-
dst | the destination where the string is written to, can be NULL |
val | the value that should be printed |
- Returns
- the number of characters used to represent the number
VTM_API unsigned int vtm_fmt_uint |
( |
char * |
dst, |
|
|
unsigned int |
val |
|
) |
| |
Print string representation of unsigned integer.
- Parameters
-
dst | the destination where the string is written to, can be NULL |
val | the value that should be printed |
- Returns
- the number of characters used to represent the number
VTM_API unsigned int vtm_fmt_int64 |
( |
char * |
dst, |
|
|
int64_t |
val |
|
) |
| |
Print string representation of signed 64 bit integer.
- Parameters
-
dst | the destination where the string is written to, can be NULL |
val | the value that should be printed |
- Returns
- the number of characters used to represent the number
VTM_API unsigned int vtm_fmt_uint64 |
( |
char * |
dst, |
|
|
uint64_t |
val |
|
) |
| |
Print string representation of unsigned 64 bit integer.
- Parameters
-
dst | the destination where the string is written to, can be NULL |
val | the value that should be printed |
- Returns
- the number of characters used to represent the number
VTM_API unsigned int vtm_fmt_hex_size |
( |
char * |
dst, |
|
|
size_t |
val |
|
) |
| |
Print hex-string representation of size_t value.
- Parameters
-
dst | the destination where the string is written to, can be NULL |
val | the value that should be printed |
- Returns
- the number of characters used by the hex-string
VTM_API unsigned int vtm_fmt_hex_mem |
( |
char * |
dst, |
|
|
const unsigned char * |
src, |
|
|
size_t |
len, |
|
|
bool |
ucase |
|
) |
| |
Print hex-string representation of a memory chunk.
- Parameters
-
dst | the destination where the string is written to, can be NULL |
src | pointer to memory chunk |
len | length of memory chunk in bytes |
ucase | true if uppercase hex letters should be used |
- Returns
- the number of characters used by the hex-string
VTM_API const char VTM_HEX_CHARS[] |
VTM_API const char VTM_HEX_LCHARS[] |