Untitled_Kernel/include/kttools.h

27 lines
783 B
C
Raw Normal View History

/* kttools.h
* Kernel Type Tools
*
* Library for converting types and transcribing data.
*/
#ifndef KTTOOLS_H
#define KTTOOLS_H
#include <stdint.h>
/**
* @brief Convert a hex int to string, up to 32 bits.
*
* Converts int "num" into a null-terminated string, placed into buffer "buf".
* Evaluates from right to left, so left hand digits will be cut off if the buffer is too small
* Should work for non 32-bit integers actually, but is uint32_t for now.
*
* @param num: Value to convert to string
* @param buf: Memory to place the string into
* @param size: Size of the memory buffer
* @param radix: Base counting system to use for output
* @return No return value
*
*/
void i_to_str(uint32_t num, char* buf, int size, int radix);
#endif