diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2021-11-22 09:47:19 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-11-25 08:43:59 +0100 |
commit | d3e90b58e7a5cbb1b74da98aed9dd4ec18c84d77 (patch) | |
tree | f018f982c97ec7f1785ab03f8d4ce56d07fc8a8f /include | |
parent | 9b8e0f5b12231d9983b1af9da156e84f4ef26fb0 (diff) | |
download | barebox-d3e90b58e7a5cbb1b74da98aed9dd4ec18c84d77.tar.gz barebox-d3e90b58e7a5cbb1b74da98aed9dd4ec18c84d77.tar.xz |
lib: wchar: add wctomb and mbtowc
We currently convert wchar_t to char by truncating to 8-bit.
In future, we may want to do UTF-16 to UTF-8 conversion.
Prepare for this by wrapping each conversion direction in a function.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20211122084732.2597109-18-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/wchar.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/wchar.h b/include/wchar.h index b601cc6207..fb9b127a8c 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -17,4 +17,9 @@ char *strdup_wchar_to_char(const wchar_t *src); size_t wcslen(const wchar_t *s); +#define MB_CUR_MAX 4 + +int mbtowc(wchar_t *pwc, const char *s, size_t n); +int wctomb(char *s, wchar_t wc); + #endif /* __WCHAR_H */ |