diff --git a/include/tlibc/string/str.h b/include/tlibc/string/str.h index cc10f92..bad3717 100755 --- a/include/tlibc/string/str.h +++ b/include/tlibc/string/str.h @@ -13,7 +13,13 @@ typedef struct str { bool isZeroTerminated; } str; +/* +USAGE: +str s = STR("something"); +printf(FMT_str"\n", str_expand(s)); +*/ #define FMT_str "%.*s" +#define str_expand(s) s.len, s.data /// creates str from a string literal #define STR(LITERAL) str_construct(LITERAL, ARRAY_LEN(LITERAL) - 1, true)