internals FEATURE add LY_PRI_LENSTR() macro
Simplify providing printf's arguments for %.*s format string in case of
constant strings.
@@ -454,6 +454,12 @@ LY_ERR ly_value_prefix_next(const char *str_begin, const char *str_end, uint32_t
*/
#define ly_strlen_const(STR) (sizeof STR - 1)
+/**
+ * @brief Macro to simply put couple of string length and the string as
+ * printf's arguments for %.*s. Use only with constant strings.
+ */
+#define LY_PRI_LENSTR(STR) ly_strlen_const(STR), STR
+
#define ly_sizeofarray(ARRAY) (sizeof ARRAY / sizeof *ARRAY)
/*
