Function tskit::bindings::tsk_table_collection_loadf[][src]

pub unsafe extern "C" fn tsk_table_collection_loadf(
    self_: *mut tsk_table_collection_t,
    file: *mut FILE,
    options: tsk_flags_t
) -> c_int

@brief Load a table collection from a stream.

@rst Loads a tables definition from the specified file stream to this table collection. By default, the table collection is also initialised. The resources allocated must be freed using :c:func:tsk_table_collection_free even in error conditions.

If the :c:macro:TSK_NO_INIT option is set, the table collection is not initialised, allowing an already initialised table collection to be overwritten with the data from a file.

If the stream contains multiple table collection definitions, this function will load the next table collection from the stream. If the stream contains no more table collection definitions the error value :c:macro:TSK_ERR_EOF will be returned. Note that EOF is only returned in the case where zero bytes are read from the stream — malformed files or other errors will result in different error conditions. Please see the :ref:sec_c_api_examples_file_streaming section for an example of how to sequentially load tree sequences from a stream.

Options**

Options can be specified by providing one or more of the following bitwise flags:

TSK_NO_INIT Do not initialise this :c:type:tsk_table_collection_t before loading.

@endrst

@param self A pointer to an uninitialised tsk_table_collection_t object if the TSK_NO_INIT option is not set (default), or an initialised tsk_table_collection_t otherwise. @param file A FILE stream opened in an appropriate mode for reading (e.g. “r”, “r+” or “w+”) positioned at the beginning of a table collection definition. @param options Bitwise options. See above for details. @return Return 0 on success or a negative value on failure.