summaryrefslogtreecommitdiffstats
path: root/lib.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-05-04 20:40:55 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-05-04 20:40:55 -0700
commite5186dace2ce5c13c2a178b67507a3f917f4ed25 (patch)
tree365929fae624706089d854ee9c50cb7dc3378e5c /lib.h
parent7246e3eff36f290b207b203c40f90850ddd031e8 (diff)
downloadtxr-e5186dace2ce5c13c2a178b67507a3f917f4ed25.tar.gz
txr-e5186dace2ce5c13c2a178b67507a3f917f4ed25.tar.bz2
txr-e5186dace2ce5c13c2a178b67507a3f917f4ed25.zip
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.
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib.h b/lib.h
index 5c74abf5..4875ef2a 100644
--- a/lib.h
+++ b/lib.h
@@ -605,6 +605,7 @@ mem_t *chk_manage_vec(mem_t *old, size_t oldfilled, size_t newfilled,
wchar_t *chk_wmalloc(size_t nwchar);
wchar_t *chk_strdup(const wchar_t *str);
char *chk_strdup_utf8(const char *str);
+unsigned char *chk_strdup_8bit(const wchar_t *str);
mem_t *chk_copy_obj(mem_t *orig, size_t size);
val cons(val car, val cdr);
val make_lazy_cons(val func);
@@ -724,6 +725,7 @@ val maskv(struct args *bits);
val string_own(wchar_t *str);
val string(const wchar_t *str);
val string_utf8(const char *str);
+val string_8bit(const unsigned char *str);
val mkstring(val len, val ch);
val mkustring(val len); /* must initialize immediately with init_str! */
val init_str(val str, const wchar_t *);