#[no_mangle]
pub unsafe extern "C" fn decoder_decode_to_utf16(
decoder: *mut Decoder,
src: *const u8,
src_len: *mut usize,
dst: *mut u16,
dst_len: *mut usize,
last: bool,
had_replacements: *mut bool,
) -> u32
Expand description
Incrementally decode a byte stream into UTF-16 with malformed sequences replaced with the REPLACEMENT CHARACTER.
See the top-level FFI documentation for documentation for how the
decoder_decode_*
functions are mapped from Rust and the documentation
for the Decoder
struct for the semantics.
src
must be non-NULL
even if src_len
is zero. Whensrc_len
is zero,
it is OK for src
to be something non-dereferencable, such as 0x1
.
Likewise for dst
when dst_len
is zero. This is required due to Rust’s
optimization for slices within Option
.
§Undefined behavior
UB ensues if any of the pointer arguments is NULL
, src
and src_len
don’t designate a valid block of memory or dst
and dst_len
don’t
designate a valid block of memory.