|
|
|
@ -41,6 +41,10 @@
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef FMT_USE_MEMMOVE
|
|
|
|
|
#define FMT_USE_MEMMOVE (1) /**< use memmove() or internal implementation */
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Format a byte value as hex
|
|
|
|
|
*
|
|
|
|
@ -294,6 +298,28 @@ void print_u64_dec(uint64_t val);
|
|
|
|
|
*/
|
|
|
|
|
void print_str(const char* str);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Pad string to the left
|
|
|
|
|
*
|
|
|
|
|
* This function left-pads a given string @p out with @p pad_char
|
|
|
|
|
*
|
|
|
|
|
* For example, calling
|
|
|
|
|
*
|
|
|
|
|
* fmt_lpad("abcd", 4, 7, ' ');
|
|
|
|
|
*
|
|
|
|
|
* would result in " abcd".
|
|
|
|
|
*
|
|
|
|
|
* @note Caller must ensure @p str can take pad_len characters!
|
|
|
|
|
*
|
|
|
|
|
* @param[inout] str string to pad
|
|
|
|
|
* @param[in] in_len length of str
|
|
|
|
|
* @param[in] pad_len total length after padding
|
|
|
|
|
* @param[in] pad_char char to use as pad char
|
|
|
|
|
*
|
|
|
|
|
* @returns pad_len
|
|
|
|
|
*/
|
|
|
|
|
size_t fmt_lpad(char *str, size_t in_len, size_t pad_len, char pad_char);
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|