pub unsafe extern "C" fn ghostty_formatter_format_alloc(
formatter: GhosttyFormatter_ptr,
allocator: *const GhosttyAllocator,
out_ptr: *mut *mut u8,
out_len: *mut usize,
) -> GhosttyResultExpand description
Run the formatter and return an allocated buffer with the output.
Each call formats the current terminal state. The buffer is allocated using the provided allocator (or the default allocator if NULL). The caller is responsible for freeing the returned buffer with ghostty_free(), passing the same allocator (or NULL for the default) that was used for the allocation.
@param formatter The formatter handle (must not be NULL) @param allocator Pointer to allocator, or NULL to use the default allocator @param out_ptr Pointer to receive the allocated buffer @param out_len Pointer to receive the length of the output in bytes @return GHOSTTY_SUCCESS on success, GHOSTTY_OUT_OF_MEMORY on allocation failure
@ingroup formatter