diff options
Diffstat (limited to 'host/lib/include/host_misc.h')
-rw-r--r-- | host/lib/include/host_misc.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/host/lib/include/host_misc.h b/host/lib/include/host_misc.h index 2e18d90b..6dc225c1 100644 --- a/host/lib/include/host_misc.h +++ b/host/lib/include/host_misc.h @@ -84,4 +84,16 @@ static __inline const uint32_t roundup32(uint32_t v) return (v + 3) & ~3; } +/** + * Return the buffer size required to hold a description string. + * + * If the string is NULL or empty, the size is zero. Otherwise, it is the + * size of a buffer which can hold the string and its null terminator, + * rounded up to the nerest multiple of 32 bits. + * + * @param desc Description string + * @return The buffer size in bytes. + */ +uint32_t vb2_desc_size(const char *desc); + #endif /* VBOOT_REFERENCE_HOST_MISC_H_ */ |