[][src]Function flac_sys::FLAC__metadata_chain_write_with_callbacks_and_tempfile

pub unsafe extern "C" fn FLAC__metadata_chain_write_with_callbacks_and_tempfile(
    chain: *mut FLAC__Metadata_Chain,
    use_padding: FLAC__bool,
    handle: FLAC__IOHandle,
    callbacks: FLAC__IOCallbacks,
    temp_handle: FLAC__IOHandle,
    temp_callbacks: FLAC__IOCallbacks
) -> FLAC__bool

Write all metadata out to a FLAC stream via callbacks.

(See FLAC__metadata_chain_write() for the details on how padding is used to write metadata in place if possible.)

This version of the write-with-callbacks function must be used when FLAC__metadata_chain_check_if_tempfile_needed() returns true. In this function, you must supply an I/O handle corresponding to the FLAC file to edit, and a temporary handle to which the new FLAC file will be written. It is the caller's job to move this temporary FLAC file on top of the original FLAC file to complete the metadata edit.

The \a handle must be open for reading and be seekable. The equivalent minimum stdio fopen() file mode is \c "r" (or \c "rb" for Windows).

The \a temp_handle must be open for writing. The equivalent minimum stdio fopen() file mode is \c "w" (or \c "wb" for Windows). It should be an empty stream, or at least positioned at the start-of-file (in which case it is the caller's duty to truncate it on return).

For this write function to be used, the chain must have been read with FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks(), not FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg(). Also, FLAC__metadata_chain_check_if_tempfile_needed() must have returned \c true.

\param chain A pointer to an existing chain. \param use_padding See FLAC__metadata_chain_write() \param handle The I/O handle of the original FLAC stream to read. The handle will NOT be closed after the metadata is written; that is the duty of the caller. \param callbacks A set of callbacks to use for I/O on \a handle. The mandatory callbacks are \a read, \a seek, and \a eof. \param temp_handle The I/O handle of the FLAC stream to write. The handle will NOT be closed after the metadata is written; that is the duty of the caller. \param temp_callbacks A set of callbacks to use for I/O on temp_handle. The only mandatory callback is \a write. \assert \code chain != NULL \endcode \retval FLAC__bool \c true if the write succeeded, else \c false. On failure, check the status with FLAC__metadata_chain_status().