summaryrefslogtreecommitdiffstats
path: root/utf8.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-04-29 14:32:32 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-04-29 14:32:32 -0700
commit1ca136f653d66cd271a33c37ea17cf836f7197b4 (patch)
tree0477fb7c9e5604a52baea117cb2b1b2a1810e9a3 /utf8.h
parent17d4160a2e6dcb07d2d7d09f8682ec120034a084 (diff)
downloadtxr-1ca136f653d66cd271a33c37ea17cf836f7197b4.tar.gz
txr-1ca136f653d66cd271a33c37ea17cf836f7197b4.tar.bz2
txr-1ca136f653d66cd271a33c37ea17cf836f7197b4.zip
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.
Diffstat (limited to 'utf8.h')
-rw-r--r--utf8.h1
1 files changed, 1 insertions, 0 deletions
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);