Function tc_string_clone_with_len

Source
#[no_mangle]
pub unsafe extern "C" fn tc_string_clone_with_len(
    buf: *const c_char,
    len: usize,
) -> TCString
Expand description

Create a new TCString containing the given string with the given length. This allows creation of strings containing embedded NUL characters. As with tc_string_clone, the resulting TCString is independent of the passed buffer, which may be reused or freed immediately.

The length should not include any trailing NUL.

The given length must be less than half the maximum value of usize.

EXTERN_C struct TCString tc_string_clone_with_len(const char *buf, size_t len);