diff -r 39e69d78b01d -r c3b6ff227481 src/ucx/string.h --- a/src/ucx/string.h Wed May 02 20:55:23 2018 +0200 +++ b/src/ucx/string.h Wed May 02 21:45:52 2018 +0200 @@ -58,6 +58,12 @@ /** Shortcut for the conversion of a C string to a sstr_t. */ #define S(s) sstrn((char*)s, sizeof(s)-1) +/** Expands a sstr_t to printf arguments. */ +#define SFMT(s) (int) (s).length, (s).ptr + +/** Format specifier for a sstr_t. */ +#define PRIsstr ".*s" + #ifdef __cplusplus extern "C" { #endif