xref: /linux-6.15/include/linux/ucs2_string.h (revision e4c89f93)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
20635eb8aSMatthew Garrett #ifndef _LINUX_UCS2_STRING_H_
30635eb8aSMatthew Garrett #define _LINUX_UCS2_STRING_H_
40635eb8aSMatthew Garrett 
50635eb8aSMatthew Garrett #include <linux/types.h>	/* for size_t */
60635eb8aSMatthew Garrett #include <linux/stddef.h>	/* for NULL */
70635eb8aSMatthew Garrett 
80635eb8aSMatthew Garrett typedef u16 ucs2_char_t;
90635eb8aSMatthew Garrett 
100635eb8aSMatthew Garrett unsigned long ucs2_strnlen(const ucs2_char_t *s, size_t maxlength);
110635eb8aSMatthew Garrett unsigned long ucs2_strlen(const ucs2_char_t *s);
120635eb8aSMatthew Garrett unsigned long ucs2_strsize(const ucs2_char_t *data, unsigned long maxlength);
13*e4c89f93SMaximilian Luz ssize_t ucs2_strscpy(ucs2_char_t *dst, const ucs2_char_t *src, size_t count);
140635eb8aSMatthew Garrett int ucs2_strncmp(const ucs2_char_t *a, const ucs2_char_t *b, size_t len);
150635eb8aSMatthew Garrett 
1673500267SPeter Jones unsigned long ucs2_utf8size(const ucs2_char_t *src);
1773500267SPeter Jones unsigned long ucs2_as_utf8(u8 *dest, const ucs2_char_t *src,
1873500267SPeter Jones 			   unsigned long maxlength);
1973500267SPeter Jones 
200635eb8aSMatthew Garrett #endif /* _LINUX_UCS2_STRING_H_ */
21