summaryrefslogtreecommitdiff
path: root/include/charset.h
diff options
context:
space:
mode:
authorAkashi, Takahiro <takahiro.akashi@linaro.org>2018-12-14 19:10:38 +0900
committerAlexander Graf <agraf@suse.de>2019-02-13 09:40:05 +0100
commit2a3537ae2272d9699312a0855a7b72472d1719c5 (patch)
tree470f1262db074eb6beb340bd4b6742d23b1bdbde /include/charset.h
parent2859f446b081db62336c32a832af026d37ab00b4 (diff)
downloadu-boot-2a3537ae2272d9699312a0855a7b72472d1719c5.tar.gz
lib: add u16_strcpy/strdup functions
Add u16_strcpy() and u16_strdup(). The latter function will be used later in implementing efi HII database protocol. Signed-off-by: Akashi Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'include/charset.h')
-rw-r--r--include/charset.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/charset.h b/include/charset.h
index 4d45e246e5..65087f76d1 100644
--- a/include/charset.h
+++ b/include/charset.h
@@ -192,6 +192,29 @@ size_t u16_strlen(const u16 *in);
size_t u16_strnlen(const u16 *in, size_t count);
/**
+ * u16_strcpy() - copy u16 string
+ *
+ * Copy u16 string pointed to by src, including terminating null word, to
+ * the buffer pointed to by dest.
+ *
+ * @dest: destination buffer
+ * @src: source buffer (null terminated)
+ * Return: 'dest' address
+ */
+u16 *u16_strcpy(u16 *dest, const u16 *src);
+
+/**
+ * u16_strdup() - duplicate u16 string
+ *
+ * Copy u16 string pointed to by src, including terminating null word, to a
+ * newly allocated buffer.
+ *
+ * @src: source buffer (null terminated)
+ * Return: allocated new buffer on success, NULL on failure
+ */
+u16 *u16_strdup(const u16 *src);
+
+/**
* utf16_to_utf8() - Convert an utf16 string to utf8
*
* Converts 'size' characters of the utf16 string 'src' to utf8