diff --git a/src/kprint/README.md b/src/kprint/README.md index ec7e124..96375a2 100644 --- a/src/kprint/README.md +++ b/src/kprint/README.md @@ -1,5 +1,19 @@ # kprintf -It is just my variant of printf. +It is just my cross-plaform variant of printf. +Unlike in standard printf, `%l...` and `%ll...` placeholders dont depend on size of `long int` and `long long int`. And you can change terminal colors by unix codes (`\e[92m`) even on Windows. + +| type | placeholder | +|-------------------------|-------------------------| +| int8 / int16 / int32 | %i / %d | +| int64 | %li / %ld / %lld / %lli | +| uint8 / uint16 / uint32 | %u | +| uint64 | %lu / %llu | +| float32 / float64 | %f | +| char | %c | +| char[] | %s | +| void* | %p / %x | + +
# kprint I don't really like printf function (and its variants), so i made safer and more convinient replacement. @@ -33,4 +47,4 @@ I don't really like printf function (and its variants), so i made safer and more Maybe m=MaybeNull; kprint(kprint_fgBlue | kprint_fmtString, "Maybe: ", kprint_fgGreen | ktid_MaybePtr, &m); ``` - output: Maybe: {value={0, ktid_Null}} \ No newline at end of file + output: Maybe: {value={0, ktid_Null}} diff --git a/src/kprint/kprintf.h b/src/kprint/kprintf.h index 0ca5a68..5bb4fa9 100644 --- a/src/kprint/kprintf.h +++ b/src/kprint/kprintf.h @@ -4,7 +4,7 @@ extern "C" { #endif -// cross-platform kprintf analog +// cross-platform printf analog void kprintf(const char* format, ...); #if __cplusplus