#[unsafe(no_mangle)]pub unsafe extern "C" fn tfe_last_error_message(
buf: *mut u8,
buf_len: usize,
out_len: *mut usize,
) -> tfe_status_tExpand description
Retrieve the last error message (UTF-8, null-terminated).
buf == NULL: query required length only (written to*out_len).buf != NULL: copy message into buffer.
out_len receives the required buffer size including the null terminator.
§Returns
TFE_SUCCESSon success (or query-only mode).TFE_INVALID_ARGUMENTifout_lenis null.TFE_BUFFER_TOO_SMALLifbuf_lenis too small (required size in*out_len).
§Safety
out_lenmust be a valid, non-null pointer.- If
bufis non-null, it must point to a buffer of at leastbuf_lenbytes.
§Examples (C)
size_t len;
tfe_last_error_message(NULL, 0, &len);
if (len > 0) {
char *buf = malloc(len);
tfe_last_error_message((uint8_t *)buf, len, &len);
printf("Error: %s\n", buf);
free(buf);
}