From 1ca136f653d66cd271a33c37ea17cf836f7197b4 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 29 Apr 2017 14:32:32 -0700 Subject: ffi: conv between strings and char/wchar_t arrays. * ffi.c (struct txr_ffi_type): New bitfield members char_conv, wchar_conv. (ffi_array_put): Check char_conv and wchar_conv flags and perform conversion to string, watching out for the presence or absence of null termination. (ffi_type_compile): When compiling array, check for the str and wstr element type, and set the flags. * utf8.c (ut8f_dup_from_buf): New function. * utf8.c (ut8f_dup_from_buf): Declared. --- utf8.h | 1 + 1 file changed, 1 insertion(+) (limited to 'utf8.h') diff --git a/utf8.h b/utf8.h index 3be8ee5f..2d253fae 100644 --- a/utf8.h +++ b/utf8.h @@ -30,6 +30,7 @@ size_t utf8_from(wchar_t *, const char *); size_t utf8_to_buf(unsigned char *dst, const wchar_t *wsrc, int null_term); size_t utf8_to(char *, const wchar_t *); wchar_t *utf8_dup_from(const char *); +wchar_t *utf8_dup_from_buf(const char *str, size_t size); char *utf8_dup_to(const wchar_t *); unsigned char *utf8_dup_to_buf(const wchar_t *, size_t *pnbytes, int null_term); -- cgit v1.2.3