Function tskit::bindings::kastore_openf
source · pub unsafe extern "C" fn kastore_openf(
self_: *mut kastore_t,
file: *mut FILE,
mode: *const c_char,
flags: c_int
) -> c_int
Expand description
@brief Open a store from a given FILE pointer.
@rst
Behaviour, mode and flags follow that of :c:func:kastore_open
,
except append mode is not supported.
The file
argument must be opened in an appropriate mode (e.g. “r”
for a kastore in “r” mode). Files open with other modes will result
in KAS_ERR_IO being returned when read/write operations are attempted.
The FILE will not be closed when :c:func:kastore_close
is called.
If the KAS_READ_ALL flag is supplied, no seek
operations will be
performed on the FILE and so streams such as stdin, FIFOs etc are
supported. The FILE pointer will be positioned exactly at the end
of the kastore encoded bytes once reading is completed, and reading
multiple stores from the same FILE sequentially is fully supported.
@endrst
@param self A pointer to a kastore object. @param file The FILE* to read/write the store from/to. @param mode The open mode: can be read (“r”) or write (“w”). @param flags The open flags. @return Return 0 on success or a negative value on failure.