Untitled_Kernel/include/kttools.h
lordtet 472f91fe14 Started work on memory map, added printf features
Printf now has long (64-bit), char, and % literal support. I haven't written
anything specific for shorts yet but if you cast it to an int on the way
in, it'll work anyway, so whatever.
2025-07-05 04:36:39 -04:00

26 lines
783 B
C

/* 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(uint64_t num, char* buf, int size, int radix);
#endif