aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMasahisa Kojima <masahisa.kojima@linaro.org>2022-04-28 17:09:34 +0900
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-05-03 21:39:22 +0200
commiteca08ce94ceb72358c5fb00e82506c0f74e65e3f (patch)
tree29ee5dde90ded64112e7b336ca09eb8c74ed5043 /include
parentd30924f16bdceb4c34bfa1f230b04e91e28d5666 (diff)
downloadu-boot-eca08ce94ceb72358c5fb00e82506c0f74e65e3f.zip
u-boot-eca08ce94ceb72358c5fb00e82506c0f74e65e3f.tar.gz
u-boot-eca08ce94ceb72358c5fb00e82506c0f74e65e3f.tar.bz2
lib/charset: add u16_strlcat() function
Provide u16 string version of strlcat(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'include')
-rw-r--r--include/charset.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/charset.h b/include/charset.h
index 38908e0..20abfbe 100644
--- a/include/charset.h
+++ b/include/charset.h
@@ -262,6 +262,20 @@ u16 *u16_strcpy(u16 *dest, const u16 *src);
u16 *u16_strdup(const void *src);
/**
+ * u16_strlcat() - Append a length-limited, %NUL-terminated string to another
+ *
+ * Append the source string @src to the destination string @dest, overwriting
+ * null word at the end of @dest adding a terminating null word.
+ *
+ * @dest: zero terminated u16 destination string
+ * @src: zero terminated u16 source string
+ * @count: size of buffer in u16 words including taling 0x0000
+ * Return: required size including trailing 0x0000 in u16 words
+ * If return value >= count, truncation occurred.
+ */
+size_t u16_strlcat(u16 *dest, const u16 *src, size_t size);
+
+/**
* utf16_to_utf8() - Convert an utf16 string to utf8
*
* Converts 'size' characters of the utf16 string 'src' to utf8