#[no_mangle]
pub unsafe extern "C" fn ttbc_get_last_input_abspath(
    es: &mut CoreBridgeState<'_>,
    buffer: *mut u8,
    len: size_t
) -> ssize_t
Expand description

Get the filesystem path of the most-recently-opened input file.

This function is needed by SyncTeX, because its output file should contain absolute filesystem paths to the input source files. In principle this functionality could be implemented in a few different ways, but the approach used here is the most backward-compatible. This function will fill in the caller’s buffer with the filesystem path associated with the most recently-opened input file, including a terminating NUL, if possible.

It returns 0 if no such path is known, -1 if the path cannot be expressed UTF-8, -2 if the destination buffer is not big enough, or the number of bytes written into the buffer (including a terminating NUL) otherwise.

§Safety

This function is unsafe because it dereferences raw C pointers.