StrWriteFmtInternal
- Function
- October 8, 2025
Table of Contents
StrWriteFmtInternal
StrWriteFmtInternal
Description
Print out a formatted string with rust-style placeholders to given string o
.
Warning
Directly passing literals like 1337
is not supported, especially const char* literals. For constants like integers, booleans, you can use LVAL(r-value)
to convert an l-value to an r-value an then use in FMT
like LVAL(false)
Parameters
Name | Direction | Description |
---|---|---|
o | out | Contents appended to this string. |
fmtstr | in | Format string with placeholders. |
argv | in | Arguments that placeholders will be replaced with. |
argc | in | Number of arguments. |
Success
Placeholders in fmtstr
are replaced by passed arguments.
Failure
Does not return, displays log messages.
Usage example (Cross-references)
- In
Io.c:242
:
}
bool StrWriteFmtInternal(Str *o, const char *fmt, TypeSpecificIO *args, u64 argc) {
if (!o || !fmt) {
LOG_FATAL("Invalid arguments");
- In
Io.h:302
:
TypeSpecificIO *argv_ = &(varr)[0]; \
u64 argc_ = sizeof(varr) / sizeof(TypeSpecificIO); \
StrWriteFmtInternal((input), (fmtstr), argv_, argc_ - 1); \
} while (0)
- In
Io.h:425
:
u64 argc_ = sizeof(varr) / sizeof(TypeSpecificIO) - 1; \
Str out_ = StrInit(); \
StrWriteFmtInternal(&out_, (fmtstr), argv_, argc_); \
fwrite(out_.data, 1, out_.length, (stream)); \
fflush(stream); \
- In
Io.h:463
:
u64 argc_ = sizeof(varr) / sizeof(TypeSpecificIO) - 1; \
Str out_ = StrInit(); \
StrWriteFmtInternal(&out_, (fmtstr), argv_, argc_); \
fwrite(out_.data, 1, out_.length, (stream)); \
fputc('\n', (stream)); \