[go: up one dir, main page]

#[no_mangle]
pub unsafe extern "C" fn set_inf_string(
    ptr: *const u8,
    size: usize
) -> i32
Expand description

Set INF_STRING from a pointer and size.

Returns 0 on success, -1 on error.

  • ptr - Pointer to the first character in the contiguous string.
  • size - Size of the string, without the null-terminator.

Safety

Only use this in C-FFI code, otherwise, you should directly modify INF_STRING. Do not call this function in threaded-code, as it is not thread-safe. The assigned string must be valid as long as lexical-core is in use (ideally static), no copies are made.