2025-06-28 06:11:09 +00:00
|
|
|
/* kttools.h
|
|
|
|
|
* Kernel Type Tools
|
|
|
|
|
*
|
|
|
|
|
* Library for converting types and transcribing data.
|
|
|
|
|
*/
|
2025-06-08 20:18:06 +00:00
|
|
|
#ifndef KTTOOLS_H
|
|
|
|
|
#define KTTOOLS_H
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
2025-07-02 23:48:33 +00:00
|
|
|
/**
|
|
|
|
|
* @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
|
|
|
|
|
*
|
|
|
|
|
*/
|
2025-07-05 08:36:39 +00:00
|
|
|
void i_to_str(uint64_t num, char* buf, int size, int radix);
|
2025-06-08 20:18:06 +00:00
|
|
|
|
|
|
|
|
#endif
|