libcfe  0.12.1
some useful C-functions
int_to_char.h File Reference
#include <stdlib.h>
#include <stdint.h>
Include dependency graph for int_to_char.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

size_t int_to_char (long long i, char **s, unsigned int min_len, uint8_t base)
 
size_t int_to_char_with_decimal (long long i, char **s, uint8_t num)
 

Function Documentation

◆ int_to_char()

size_t int_to_char ( long long  i,
char **  s,
unsigned int  min_len,
uint8_t  base 
)

Turn an integer into a serie characters.

Parameters
[in]iThe number that needs to be printed.
[out]sMust be a NULL pointer.
[in]min_lenMinimum length of the string, the resulting string will be left filled with zero's.
[in]baseThe base number (binary -> 2, octal -> 8, decimal -> 10, hexadecimal -> 16), this must not be bigger than 16.
Returns
The number of characters in 's' points to. The terminating '\0' is not counted, but is present at the end of the string. The allocated memory is one more than the returned value and can be freed with free().

Definition at line 12 of file int_to_char.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ int_to_char_with_decimal()

size_t int_to_char_with_decimal ( long long  i,
char **  s,
uint8_t  num 
)

Turn an integer into a serie characters and put a point (decimal separator) in it.

Parameters
[in]iThe number that needs to be printed.
[out]sMust be a NULL pointer.
[in]numThe number of digits after which the point will be placed, right counted.
Returns
The number of characters in 's' points to. The terminating '\0' is not counted, but is present at the end of the string. The allocated memory is one more than the returned value and can be freed with free().

Definition at line 36 of file int_to_char.c.

Here is the call graph for this function: