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

Go to the source code of this file.

Macros

#define int_to_bit(i, s)   int_to_bit1(i,s,256)
 

Functions

size_t int_to_bit1 (unsigned long long i, unsigned char **s, unsigned int base)
 

Macro Definition Documentation

◆ int_to_bit

#define int_to_bit (   i,
 
)    int_to_bit1(i,s,256)

Shorthand which use a base of 256. See int_to_bit1.

Definition at line 9 of file int_to_bit.h.

Function Documentation

◆ int_to_bit1()

size_t int_to_bit1 ( unsigned long long  i,
unsigned char **  s,
unsigned int  base 
)

Turn an integer into a binary value which is stored as a string.

Parameters
[in]iThe number that needs to be converted.
[out]sMust be a NULL pointer.
[in]baseThe base number.
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 6 of file int_to_bit.c.

Here is the call graph for this function: