From e5186dace2ce5c13c2a178b67507a3f917f4ed25 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 4 May 2017 20:40:55 -0700 Subject: ffi: new bstr type. The bstr type is like str, but doesn't perform UTF-8 conversion. The C data is assumed to be null terminated byte strings representing code points U+0000 through U+00FF. * ffi.c (bstr_s, bstr_d_s): New symbol variables. (ffi_bstr_put, ffi_bstr_get, ffi_bstr_d_get): New static functions. (ffi_init_types): Register bstr and bstr-d types. (ffi_init): Initialize bstr_s and bstr_d_s. * ffi.h (bstr_s, bstr_d_s): Declared. * lib.c (chk_strdup_8bit, string_8bit): New function. * lib.h (chk_strdup_8bit, string_8bit): Declared. --- ffi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ffi.h') diff --git a/ffi.h b/ffi.h index 3f9f421d..c598044f 100644 --- a/ffi.h +++ b/ffi.h @@ -41,7 +41,7 @@ extern val array_s, zarray_s; extern val struct_s; -extern val str_d_s, wstr_s, wstr_d_s; +extern val str_d_s, wstr_s, wstr_d_s, bstr_s, bstr_d_s; extern val buf_d_s; -- cgit v1.2.3