Function tskit::bindings::tsk_tree_copy
source · pub unsafe extern "C" fn tsk_tree_copy(
self_: *const tsk_tree_t,
dest: *mut tsk_tree_t,
options: tsk_flags_t
) -> c_int
Expand description
@brief Copies the state of this tree into the specified destination.
@rst
By default (options
= 0) the method initialises the specified destination
tree by calling :c:func:tsk_tree_init
. If the destination is already
initialised, the :c:macro:TSK_NO_INIT
option should be supplied to avoid
leaking memory. If :c:macro:TSK_NO_INIT
is supplied and the tree sequence associated
with the dest
tree is not equal to the tree sequence associated
with self
, an error is raised.
The destination tree will keep a reference to the tree sequence object associated with the source tree, and this tree sequence must be valid for the full lifetime of the destination tree.
Options**
- :c:macro:
TSK_NO_INIT
If :c:macro:TSK_NO_INIT
is not specified, options for :c:func:tsk_tree_init
can be provided and will be passed on.
@endrst
@param self A pointer to an initialised tsk_tree_t object. @param dest A pointer to a tsk_tree_t object. If the TSK_NO_INIT option is specified, this must be an initialised tree. If not, it must be an uninitialised tree. @param options Copy and allocation time options. See the notes above for details. @return Return 0 on success or a negative value on failure.