pub const TSK_MAX_ID: u32 = 2147483646;
pub const TSK_VERSION_MAJOR: u32 = 1;
pub const TSK_VERSION_MINOR: u32 = 1;
pub const TSK_VERSION_PATCH: u32 = 1;
pub const TSK_UNKNOWN_TIME_HEX: u64 = 9221248276113224737;
pub const TSK_NODE_IS_SAMPLE: u32 = 1;
pub const TSK_MISSING_DATA: i32 = -1;
pub const TSK_TIME_UNITS_UNKNOWN: &[u8; 8usize] = b"unknown\0";
pub const TSK_TIME_UNITS_UNCALIBRATED: &[u8; 13usize] = b"uncalibrated\0";
pub const TSK_FILE_FORMAT_NAME: &[u8; 12usize] = b"tskit.trees\0";
pub const TSK_FILE_FORMAT_NAME_LENGTH: u32 = 11;
pub const TSK_FILE_FORMAT_VERSION_MAJOR: u32 = 12;
pub const TSK_FILE_FORMAT_VERSION_MINOR: u32 = 7;
pub const TSK_DEBUG: u32 = 2147483648;
pub const TSK_NO_INIT: u32 = 1073741824;
pub const TSK_NO_CHECK_INTEGRITY: u32 = 536870912;
pub const TSK_TAKE_OWNERSHIP: u32 = 268435456;
pub const TSK_ERR_GENERIC: i32 = -1;
pub const TSK_ERR_NO_MEMORY: i32 = -2;
pub const TSK_ERR_IO: i32 = -3;
pub const TSK_ERR_BAD_PARAM_VALUE: i32 = -4;
pub const TSK_ERR_BUFFER_OVERFLOW: i32 = -5;
pub const TSK_ERR_UNSUPPORTED_OPERATION: i32 = -6;
pub const TSK_ERR_GENERATE_UUID: i32 = -7;
pub const TSK_ERR_EOF: i32 = -8;
pub const TSK_ERR_FILE_FORMAT: i32 = -100;
pub const TSK_ERR_FILE_VERSION_TOO_OLD: i32 = -101;
pub const TSK_ERR_FILE_VERSION_TOO_NEW: i32 = -102;
pub const TSK_ERR_REQUIRED_COL_NOT_FOUND: i32 = -103;
pub const TSK_ERR_BOTH_COLUMNS_REQUIRED: i32 = -104;
pub const TSK_ERR_BAD_COLUMN_TYPE: i32 = -105;
pub const TSK_ERR_BAD_OFFSET: i32 = -200;
pub const TSK_ERR_SEEK_OUT_OF_BOUNDS: i32 = -201;
pub const TSK_ERR_NODE_OUT_OF_BOUNDS: i32 = -202;
pub const TSK_ERR_EDGE_OUT_OF_BOUNDS: i32 = -203;
pub const TSK_ERR_POPULATION_OUT_OF_BOUNDS: i32 = -204;
pub const TSK_ERR_SITE_OUT_OF_BOUNDS: i32 = -205;
pub const TSK_ERR_MUTATION_OUT_OF_BOUNDS: i32 = -206;
pub const TSK_ERR_INDIVIDUAL_OUT_OF_BOUNDS: i32 = -207;
pub const TSK_ERR_MIGRATION_OUT_OF_BOUNDS: i32 = -208;
pub const TSK_ERR_PROVENANCE_OUT_OF_BOUNDS: i32 = -209;
pub const TSK_ERR_TIME_NONFINITE: i32 = -210;
pub const TSK_ERR_GENOME_COORDS_NONFINITE: i32 = -211;
pub const TSK_ERR_NULL_PARENT: i32 = -300;
pub const TSK_ERR_NULL_CHILD: i32 = -301;
pub const TSK_ERR_EDGES_NOT_SORTED_PARENT_TIME: i32 = -302;
pub const TSK_ERR_EDGES_NONCONTIGUOUS_PARENTS: i32 = -303;
pub const TSK_ERR_EDGES_NOT_SORTED_CHILD: i32 = -304;
pub const TSK_ERR_EDGES_NOT_SORTED_LEFT: i32 = -305;
pub const TSK_ERR_BAD_NODE_TIME_ORDERING: i32 = -306;
pub const TSK_ERR_BAD_EDGE_INTERVAL: i32 = -307;
pub const TSK_ERR_DUPLICATE_EDGES: i32 = -308;
pub const TSK_ERR_RIGHT_GREATER_SEQ_LENGTH: i32 = -309;
pub const TSK_ERR_LEFT_LESS_ZERO: i32 = -310;
pub const TSK_ERR_BAD_EDGES_CONTRADICTORY_CHILDREN: i32 = -311;
pub const TSK_ERR_CANT_PROCESS_EDGES_WITH_METADATA: i32 = -312;
pub const TSK_ERR_UNSORTED_SITES: i32 = -400;
pub const TSK_ERR_DUPLICATE_SITE_POSITION: i32 = -401;
pub const TSK_ERR_BAD_SITE_POSITION: i32 = -402;
pub const TSK_ERR_MUTATION_PARENT_DIFFERENT_SITE: i32 = -500;
pub const TSK_ERR_MUTATION_PARENT_EQUAL: i32 = -501;
pub const TSK_ERR_MUTATION_PARENT_AFTER_CHILD: i32 = -502;
pub const TSK_ERR_MUTATION_PARENT_INCONSISTENT: i32 = -503;
pub const TSK_ERR_UNSORTED_MUTATIONS: i32 = -504;
pub const TSK_ERR_MUTATION_TIME_YOUNGER_THAN_NODE: i32 = -506;
pub const TSK_ERR_MUTATION_TIME_OLDER_THAN_PARENT_MUTATION: i32 = -507;
pub const TSK_ERR_MUTATION_TIME_OLDER_THAN_PARENT_NODE: i32 = -508;
pub const TSK_ERR_MUTATION_TIME_HAS_BOTH_KNOWN_AND_UNKNOWN: i32 = -509;
pub const TSK_ERR_UNSORTED_MIGRATIONS: i32 = -550;
pub const TSK_ERR_DUPLICATE_SAMPLE: i32 = -600;
pub const TSK_ERR_BAD_SAMPLES: i32 = -601;
pub const TSK_ERR_BAD_TABLE_POSITION: i32 = -700;
pub const TSK_ERR_BAD_SEQUENCE_LENGTH: i32 = -701;
pub const TSK_ERR_TABLES_NOT_INDEXED: i32 = -702;
pub const TSK_ERR_TABLE_OVERFLOW: i32 = -703;
pub const TSK_ERR_COLUMN_OVERFLOW: i32 = -704;
pub const TSK_ERR_TREE_OVERFLOW: i32 = -705;
pub const TSK_ERR_METADATA_DISABLED: i32 = -706;
pub const TSK_ERR_TABLES_BAD_INDEXES: i32 = -707;
pub const TSK_ERR_ONLY_INFINITE_SITES: i32 = -800;
pub const TSK_ERR_SIMPLIFY_MIGRATIONS_NOT_SUPPORTED: i32 = -801;
pub const TSK_ERR_SORT_MIGRATIONS_NOT_SUPPORTED: i32 = -802;
pub const TSK_ERR_SORT_OFFSET_NOT_SUPPORTED: i32 = -803;
pub const TSK_ERR_NONBINARY_MUTATIONS_UNSUPPORTED: i32 = -804;
pub const TSK_ERR_MIGRATIONS_NOT_SUPPORTED: i32 = -805;
pub const TSK_ERR_CANNOT_EXTEND_FROM_SELF: i32 = -806;
pub const TSK_ERR_SILENT_MUTATIONS_NOT_SUPPORTED: i32 = -807;
pub const TSK_ERR_VARIANT_CANT_DECODE_COPY: i32 = -808;
pub const TSK_ERR_CANT_TAKE_OWNERSHIP_NO_EDGE_METADATA: i32 = -809;
pub const TSK_ERR_UNDEFINED_NONBINARY: i32 = -810;
pub const TSK_ERR_UNDEFINED_MULTIROOT: i32 = -811;
pub const TSK_ERR_BAD_NUM_WINDOWS: i32 = -900;
pub const TSK_ERR_BAD_WINDOWS: i32 = -901;
pub const TSK_ERR_MULTIPLE_STAT_MODES: i32 = -902;
pub const TSK_ERR_BAD_STATE_DIMS: i32 = -903;
pub const TSK_ERR_BAD_RESULT_DIMS: i32 = -904;
pub const TSK_ERR_INSUFFICIENT_SAMPLE_SETS: i32 = -905;
pub const TSK_ERR_INSUFFICIENT_INDEX_TUPLES: i32 = -906;
pub const TSK_ERR_BAD_SAMPLE_SET_INDEX: i32 = -907;
pub const TSK_ERR_EMPTY_SAMPLE_SET: i32 = -908;
pub const TSK_ERR_UNSUPPORTED_STAT_MODE: i32 = -909;
pub const TSK_ERR_TIME_UNCALIBRATED: i32 = -910;
pub const TSK_ERR_GENOTYPES_ALL_MISSING: i32 = -1000;
pub const TSK_ERR_BAD_GENOTYPE: i32 = -1001;
pub const TSK_ERR_BAD_ANCESTRAL_STATE: i32 = -1002;
pub const TSK_ERR_MUST_IMPUTE_NON_SAMPLES: i32 = -1100;
pub const TSK_ERR_ALLELE_NOT_FOUND: i32 = -1101;
pub const TSK_ERR_TOO_MANY_ALLELES: i32 = -1102;
pub const TSK_ERR_ZERO_ALLELES: i32 = -1103;
pub const TSK_ERR_SAMPLE_SIZE_MISMATCH: i32 = -1200;
pub const TSK_ERR_SAMPLES_NOT_EQUAL: i32 = -1201;
pub const TSK_ERR_MULTIPLE_ROOTS: i32 = -1202;
pub const TSK_ERR_UNARY_NODES: i32 = -1203;
pub const TSK_ERR_SEQUENCE_LENGTH_MISMATCH: i32 = -1204;
pub const TSK_ERR_NO_SAMPLE_LISTS: i32 = -1205;
pub const TSK_ERR_NULL_VITERBI_MATRIX: i32 = -1300;
pub const TSK_ERR_MATCH_IMPOSSIBLE: i32 = -1301;
pub const TSK_ERR_BAD_COMPRESSED_MATRIX_NODE: i32 = -1302;
pub const TSK_ERR_TOO_MANY_VALUES: i32 = -1303;
pub const TSK_ERR_UNION_BAD_MAP: i32 = -1400;
pub const TSK_ERR_UNION_DIFF_HISTORIES: i32 = -1401;
pub const TSK_ERR_SAME_NODES_IN_PAIR: i32 = -1500;
pub const TSK_ERR_IBD_PAIRS_NOT_STORED: i32 = -1501;
pub const TSK_ERR_IBD_SEGMENTS_NOT_STORED: i32 = -1502;
pub const TSK_ERR_KEEP_UNARY_MUTUALLY_EXCLUSIVE: i32 = -1600;
pub const TSK_ERR_UNSORTED_INDIVIDUALS: i32 = -1700;
pub const TSK_ERR_INDIVIDUAL_SELF_PARENT: i32 = -1701;
pub const TSK_ERR_INDIVIDUAL_PARENT_CYCLE: i32 = -1702;
pub const TSK_ERR_INDIVIDUAL_POPULATION_MISMATCH: i32 = -1703;
pub const TSK_ERR_INDIVIDUAL_TIME_MISMATCH: i32 = -1704;
pub const TSK_KAS_ERR_BIT: u32 = 14;
pub const TSK_BUG_ASSERT_MESSAGE : & [u8 ; 265usize] = b"If you are using tskit directly please open an issue on GitHub, ideally with a reproducible example. (https://github.com/tskit-dev/tskit/issues) If you are using software that uses tskit, please report an issue to that software's issue tracker, at least initially.\0" ;
pub const TSK_UUID_SIZE: u32 = 36;
pub const KAS_ERR_GENERIC: i32 = -1;
pub const KAS_ERR_IO: i32 = -2;
pub const KAS_ERR_BAD_MODE: i32 = -3;
pub const KAS_ERR_NO_MEMORY: i32 = -4;
pub const KAS_ERR_BAD_FILE_FORMAT: i32 = -5;
pub const KAS_ERR_VERSION_TOO_OLD: i32 = -6;
pub const KAS_ERR_VERSION_TOO_NEW: i32 = -7;
pub const KAS_ERR_BAD_TYPE: i32 = -8;
pub const KAS_ERR_EMPTY_KEY: i32 = -9;
pub const KAS_ERR_DUPLICATE_KEY: i32 = -10;
pub const KAS_ERR_KEY_NOT_FOUND: i32 = -11;
pub const KAS_ERR_ILLEGAL_OPERATION: i32 = -12;
pub const KAS_ERR_TYPE_MISMATCH: i32 = -13;
pub const KAS_ERR_EOF: i32 = -14;
pub const KAS_ERR_BAD_FLAGS: i32 = -15;
pub const KAS_READ_ALL: u32 = 1;
pub const KAS_GET_TAKES_OWNERSHIP: u32 = 2;
pub const KAS_BORROWS_ARRAY: u32 = 256;
pub const KAS_INT8: u32 = 0;
pub const KAS_UINT8: u32 = 1;
pub const KAS_INT16: u32 = 2;
pub const KAS_UINT16: u32 = 3;
pub const KAS_INT32: u32 = 4;
pub const KAS_UINT32: u32 = 5;
pub const KAS_INT64: u32 = 6;
pub const KAS_UINT64: u32 = 7;
pub const KAS_FLOAT32: u32 = 8;
pub const KAS_FLOAT64: u32 = 9;
pub const KAS_NUM_TYPES: u32 = 10;
pub const KAS_READ: u32 = 1;
pub const KAS_WRITE: u32 = 2;
pub const KAS_FILE_VERSION_MAJOR: u32 = 1;
pub const KAS_FILE_VERSION_MINOR: u32 = 0;
pub const KAS_VERSION_MAJOR: u32 = 2;
pub const KAS_VERSION_MINOR: u32 = 1;
pub const KAS_VERSION_PATCH: u32 = 1;
pub const KAS_HEADER_SIZE: u32 = 64;
pub const KAS_ITEM_DESCRIPTOR_SIZE: u32 = 64;
pub const KAS_MAGIC: [u8; 9usize] = [137u8, 75u8, 65u8, 83u8, 13u8, 10u8, 26u8, 10u8, 0u8];
pub const KAS_ARRAY_ALIGN: u32 = 8;
pub const KAS_BUG_ASSERT_MESSAGE : & [u8 ; 271usize] = b"If you are using kastore directly please open an issue on GitHub, ideally with a reproducible example. (https://github.com/tskit-dev/kastore/issues) If you are using software that uses kastore, please report an issue to that software's issue tracker, at least initially.\0" ;
pub const TSK_SIMPLIFY_FILTER_SITES: u32 = 1;
pub const TSK_SIMPLIFY_FILTER_POPULATIONS: u32 = 2;
pub const TSK_SIMPLIFY_FILTER_INDIVIDUALS: u32 = 4;
pub const TSK_SIMPLIFY_REDUCE_TO_SITE_TOPOLOGY: u32 = 8;
pub const TSK_SIMPLIFY_KEEP_UNARY: u32 = 16;
pub const TSK_SIMPLIFY_KEEP_INPUT_ROOTS: u32 = 32;
pub const TSK_SIMPLIFY_KEEP_UNARY_IN_INDIVIDUALS: u32 = 64;
pub const TSK_SUBSET_NO_CHANGE_POPULATIONS: u32 = 1;
pub const TSK_SUBSET_KEEP_UNREFERENCED: u32 = 2;
pub const TSK_CHECK_EDGE_ORDERING: u32 = 1;
pub const TSK_CHECK_SITE_ORDERING: u32 = 2;
pub const TSK_CHECK_SITE_DUPLICATES: u32 = 4;
pub const TSK_CHECK_MUTATION_ORDERING: u32 = 8;
pub const TSK_CHECK_INDIVIDUAL_ORDERING: u32 = 16;
pub const TSK_CHECK_MIGRATION_ORDERING: u32 = 32;
pub const TSK_CHECK_INDEXES: u32 = 64;
pub const TSK_CHECK_TREES: u32 = 128;
pub const TSK_NO_CHECK_POPULATION_REFS: u32 = 4096;
pub const TSK_LOAD_SKIP_TABLES: u32 = 1;
pub const TSK_LOAD_SKIP_REFERENCE_SEQUENCE: u32 = 2;
pub const TSK_TABLE_NO_METADATA: u32 = 4;
pub const TSK_TC_NO_EDGE_METADATA: u32 = 8;
pub const TSK_DUMP_FORCE_OFFSET_64: u32 = 134217728;
pub const TSK_COPY_FILE_UUID: u32 = 1;
pub const TSK_UNION_NO_CHECK_SHARED: u32 = 1;
pub const TSK_UNION_NO_ADD_POP: u32 = 2;
pub const TSK_CMP_IGNORE_TS_METADATA: u32 = 1;
pub const TSK_CMP_IGNORE_PROVENANCE: u32 = 2;
pub const TSK_CMP_IGNORE_METADATA: u32 = 4;
pub const TSK_CMP_IGNORE_TIMESTAMPS: u32 = 8;
pub const TSK_CMP_IGNORE_TABLES: u32 = 16;
pub const TSK_CMP_IGNORE_REFERENCE_SEQUENCE: u32 = 32;
pub const TSK_CLEAR_METADATA_SCHEMAS: u32 = 1;
pub const TSK_CLEAR_TS_METADATA_AND_SCHEMA: u32 = 2;
pub const TSK_CLEAR_PROVENANCE: u32 = 4;
pub const TSK_IBD_STORE_PAIRS: u32 = 1;
pub const TSK_IBD_STORE_SEGMENTS: u32 = 2;
pub const TSK_SAMPLE_LISTS: u32 = 2;
pub const TSK_NO_SAMPLE_COUNTS: u32 = 4;
pub const TSK_STAT_SITE: u32 = 1;
pub const TSK_STAT_BRANCH: u32 = 2;
pub const TSK_STAT_NODE: u32 = 4;
pub const TSK_STAT_POLARISED: u32 = 1024;
pub const TSK_STAT_SPAN_NORMALISE: u32 = 2048;
pub const TSK_STAT_ALLOW_TIME_UNCALIBRATED: u32 = 4096;
pub const TSK_MM_FIXED_ANCESTRAL_STATE: u32 = 1;
pub const TSK_DIR_FORWARD: u32 = 1;
pub const TSK_DIR_REVERSE: i32 = -1;
pub const TSK_INCLUDE_TERMINAL: u32 = 1;
pub const TSK_TS_INIT_BUILD_INDEXES: u32 = 1;
pub const TSK_TREE_OK: u32 = 1;
pub const TSK_ISOLATED_NOT_MISSING: u32 = 2;
pub const TSK_NEWICK_LEGACY_MS_LABELS: u32 = 1;
pub const TSK_ALLELES_ACGT: u32 = 65536;
pub type __off_t = ::std::os::raw::c_long;
pub type __off64_t = ::std::os::raw::c_long;
pub type FILE = _IO_FILE;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _IO_marker {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _IO_codecvt {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _IO_wide_data {
_unused: [u8; 0],
}
pub type _IO_lock_t = ::std::os::raw::c_void;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _IO_FILE {
pub _flags: ::std::os::raw::c_int,
pub _IO_read_ptr: *mut ::std::os::raw::c_char,
pub _IO_read_end: *mut ::std::os::raw::c_char,
pub _IO_read_base: *mut ::std::os::raw::c_char,
pub _IO_write_base: *mut ::std::os::raw::c_char,
pub _IO_write_ptr: *mut ::std::os::raw::c_char,
pub _IO_write_end: *mut ::std::os::raw::c_char,
pub _IO_buf_base: *mut ::std::os::raw::c_char,
pub _IO_buf_end: *mut ::std::os::raw::c_char,
pub _IO_save_base: *mut ::std::os::raw::c_char,
pub _IO_backup_base: *mut ::std::os::raw::c_char,
pub _IO_save_end: *mut ::std::os::raw::c_char,
pub _markers: *mut _IO_marker,
pub _chain: *mut _IO_FILE,
pub _fileno: ::std::os::raw::c_int,
pub _flags2: ::std::os::raw::c_int,
pub _old_offset: __off_t,
pub _cur_column: ::std::os::raw::c_ushort,
pub _vtable_offset: ::std::os::raw::c_schar,
pub _shortbuf: [::std::os::raw::c_char; 1usize],
pub _lock: *mut _IO_lock_t,
pub _offset: __off64_t,
pub _codecvt: *mut _IO_codecvt,
pub _wide_data: *mut _IO_wide_data,
pub _freeres_list: *mut _IO_FILE,
pub _freeres_buf: *mut ::std::os::raw::c_void,
pub __pad5: usize,
pub _mode: ::std::os::raw::c_int,
pub _unused2: [::std::os::raw::c_char; 20usize],
}
#[test]
fn bindgen_test_layout__IO_FILE() {
const UNINIT: ::std::mem::MaybeUninit<_IO_FILE> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<_IO_FILE>(),
216usize,
concat!("Size of: ", stringify!(_IO_FILE))
);
assert_eq!(
::std::mem::align_of::<_IO_FILE>(),
8usize,
concat!("Alignment of ", stringify!(_IO_FILE))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._flags) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_flags)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_ptr) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_read_ptr)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_end) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_read_end)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_base) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_read_base)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_base) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_write_base)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_ptr) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_write_ptr)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_end) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_write_end)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._IO_buf_base) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_buf_base)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._IO_buf_end) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_buf_end)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._IO_save_base) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_save_base)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._IO_backup_base) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_backup_base)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._IO_save_end) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_save_end)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._markers) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_markers)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._chain) as usize - ptr as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_chain)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._fileno) as usize - ptr as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_fileno)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._flags2) as usize - ptr as usize },
116usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_flags2)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._old_offset) as usize - ptr as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_old_offset)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._cur_column) as usize - ptr as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_cur_column)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._vtable_offset) as usize - ptr as usize },
130usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_vtable_offset)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._shortbuf) as usize - ptr as usize },
131usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_shortbuf)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._lock) as usize - ptr as usize },
136usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_lock)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._offset) as usize - ptr as usize },
144usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_offset)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._codecvt) as usize - ptr as usize },
152usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_codecvt)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._wide_data) as usize - ptr as usize },
160usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_wide_data)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._freeres_list) as usize - ptr as usize },
168usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_freeres_list)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._freeres_buf) as usize - ptr as usize },
176usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_freeres_buf)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).__pad5) as usize - ptr as usize },
184usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(__pad5)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._mode) as usize - ptr as usize },
192usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_mode)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._unused2) as usize - ptr as usize },
196usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_unused2)
)
);
}
pub type tsk_id_t = i32;
#[doc = "@brief Tskit sizes.\n\n@rst\nThe ``tsk_size_t`` type is an unsigned integer used for any size or count value.\n@endrst"]
pub type tsk_size_t = u64;
#[doc = "@brief Container for bitwise flags.\n\n@rst\nBitwise flags are used in tskit as a column type and also as a way to\nspecify options to API functions.\n@endrst"]
pub type tsk_flags_t = u32;
extern "C" {
pub fn tsk_set_kas_error(err: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_is_kas_error(err: ::std::os::raw::c_int) -> bool;
}
extern "C" {
pub fn tsk_get_kas_error(err: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Return a description of the specified error.\n\nThe memory for the returned string is handled by the library and should\nnot be freed by client code.\n\n@param err A tskit error code.\n@return A description of the error."]
pub fn tsk_strerror(err: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_blkalloc_t {
pub chunk_size: usize,
pub top: usize,
pub current_chunk: usize,
pub total_size: usize,
pub total_allocated: usize,
pub num_chunks: usize,
pub mem_chunks: *mut *mut ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_tsk_blkalloc_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_blkalloc_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_blkalloc_t>(),
56usize,
concat!("Size of: ", stringify!(tsk_blkalloc_t))
);
assert_eq!(
::std::mem::align_of::<tsk_blkalloc_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_blkalloc_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).chunk_size) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_blkalloc_t),
"::",
stringify!(chunk_size)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).top) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_blkalloc_t),
"::",
stringify!(top)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).current_chunk) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_blkalloc_t),
"::",
stringify!(current_chunk)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).total_size) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_blkalloc_t),
"::",
stringify!(total_size)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).total_allocated) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_blkalloc_t),
"::",
stringify!(total_allocated)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_chunks) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_blkalloc_t),
"::",
stringify!(num_chunks)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).mem_chunks) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_blkalloc_t),
"::",
stringify!(mem_chunks)
)
);
}
extern "C" {
pub fn tsk_blkalloc_print_state(self_: *mut tsk_blkalloc_t, out: *mut FILE);
}
extern "C" {
pub fn tsk_blkalloc_reset(self_: *mut tsk_blkalloc_t) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_blkalloc_init(
self_: *mut tsk_blkalloc_t,
chunk_size: usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_blkalloc_get(self_: *mut tsk_blkalloc_t, size: usize)
-> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn tsk_blkalloc_free(self_: *mut tsk_blkalloc_t);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _tsk_avl_node_int_t {
pub key: i64,
pub value: *mut ::std::os::raw::c_void,
pub llink: *mut _tsk_avl_node_int_t,
pub rlink: *mut _tsk_avl_node_int_t,
pub balance: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout__tsk_avl_node_int_t() {
const UNINIT: ::std::mem::MaybeUninit<_tsk_avl_node_int_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<_tsk_avl_node_int_t>(),
40usize,
concat!("Size of: ", stringify!(_tsk_avl_node_int_t))
);
assert_eq!(
::std::mem::align_of::<_tsk_avl_node_int_t>(),
8usize,
concat!("Alignment of ", stringify!(_tsk_avl_node_int_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).key) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_tsk_avl_node_int_t),
"::",
stringify!(key)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(_tsk_avl_node_int_t),
"::",
stringify!(value)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).llink) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(_tsk_avl_node_int_t),
"::",
stringify!(llink)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).rlink) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(_tsk_avl_node_int_t),
"::",
stringify!(rlink)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).balance) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(_tsk_avl_node_int_t),
"::",
stringify!(balance)
)
);
}
pub type tsk_avl_node_int_t = _tsk_avl_node_int_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_avl_tree_int_t {
pub head: tsk_avl_node_int_t,
pub size: tsk_size_t,
pub height: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_avl_tree_int_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_avl_tree_int_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_avl_tree_int_t>(),
56usize,
concat!("Size of: ", stringify!(tsk_avl_tree_int_t))
);
assert_eq!(
::std::mem::align_of::<tsk_avl_tree_int_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_avl_tree_int_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_avl_tree_int_t),
"::",
stringify!(head)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_avl_tree_int_t),
"::",
stringify!(size)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).height) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_avl_tree_int_t),
"::",
stringify!(height)
)
);
}
extern "C" {
pub fn tsk_avl_tree_int_init(self_: *mut tsk_avl_tree_int_t) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_avl_tree_int_free(self_: *mut tsk_avl_tree_int_t) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_avl_tree_int_print_state(self_: *mut tsk_avl_tree_int_t, out: *mut FILE);
}
extern "C" {
pub fn tsk_avl_tree_int_insert(
self_: *mut tsk_avl_tree_int_t,
node: *mut tsk_avl_node_int_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_avl_tree_int_search(
self_: *const tsk_avl_tree_int_t,
key: i64,
) -> *mut tsk_avl_node_int_t;
}
extern "C" {
pub fn tsk_avl_tree_int_ordered_nodes(
self_: *const tsk_avl_tree_int_t,
out: *mut *mut tsk_avl_node_int_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_avl_tree_int_get_root(self_: *const tsk_avl_tree_int_t) -> *mut tsk_avl_node_int_t;
}
extern "C" {
pub fn tsk_search_sorted(array: *const f64, size: tsk_size_t, value: f64) -> tsk_size_t;
}
extern "C" {
pub fn tsk_round(x: f64, ndigits: ::std::os::raw::c_uint) -> f64;
}
extern "C" {
#[doc = "@brief Check if a number is ``TSK_UNKNOWN_TIME``\n\n@rst\nUnknown time values in tskit are represented by a particular NaN value. Since NaN values\nare not equal to each other by definition, a simple comparison like\n``mutation.time == TSK_UNKNOWN_TIME`` will fail even if the mutation's time is\nTSK_UNKNOWN_TIME. This function compares the underlying bit representation of a double\nvalue and returns true iff it is equal to the specific NaN value\n:c:macro:`TSK_UNKNOWN_TIME`.\n@endrst\n\n@param val The number to check\n@return true if the number is ``TSK_UNKNOWN_TIME`` else false"]
pub fn tsk_is_unknown_time(val: f64) -> bool;
}
extern "C" {
pub fn tsk_isnan(val: f64) -> bool;
}
extern "C" {
pub fn tsk_isfinite(val: f64) -> bool;
}
extern "C" {
pub fn tsk_generate_uuid(
dest: *mut ::std::os::raw::c_char,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_malloc(size: tsk_size_t) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn tsk_realloc(
ptr: *mut ::std::os::raw::c_void,
size: tsk_size_t,
) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn tsk_calloc(n: tsk_size_t, size: usize) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn tsk_memset(
ptr: *mut ::std::os::raw::c_void,
fill: ::std::os::raw::c_int,
size: tsk_size_t,
) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn tsk_memcpy(
dest: *mut ::std::os::raw::c_void,
src: *const ::std::os::raw::c_void,
size: tsk_size_t,
) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn tsk_memmove(
dest: *mut ::std::os::raw::c_void,
src: *const ::std::os::raw::c_void,
size: tsk_size_t,
) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn tsk_memcmp(
s1: *const ::std::os::raw::c_void,
s2: *const ::std::os::raw::c_void,
size: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_set_debug_stream(f: *mut FILE);
}
extern "C" {
pub fn tsk_get_debug_stream() -> *mut FILE;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct kaitem_t {
pub type_: ::std::os::raw::c_int,
pub key_len: usize,
pub array_len: usize,
pub key: *mut ::std::os::raw::c_char,
pub borrowed_array: *const ::std::os::raw::c_void,
pub array: *mut ::std::os::raw::c_void,
pub key_start: usize,
pub array_start: usize,
}
#[test]
fn bindgen_test_layout_kaitem_t() {
const UNINIT: ::std::mem::MaybeUninit<kaitem_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<kaitem_t>(),
64usize,
concat!("Size of: ", stringify!(kaitem_t))
);
assert_eq!(
::std::mem::align_of::<kaitem_t>(),
8usize,
concat!("Alignment of ", stringify!(kaitem_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(kaitem_t),
"::",
stringify!(type_)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).key_len) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(kaitem_t),
"::",
stringify!(key_len)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).array_len) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(kaitem_t),
"::",
stringify!(array_len)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).key) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(kaitem_t),
"::",
stringify!(key)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).borrowed_array) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(kaitem_t),
"::",
stringify!(borrowed_array)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).array) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(kaitem_t),
"::",
stringify!(array)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).key_start) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(kaitem_t),
"::",
stringify!(key_start)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).array_start) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(kaitem_t),
"::",
stringify!(array_start)
)
);
}
#[doc = "@brief A file-backed store of key-array values."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct kastore_t {
pub flags: ::std::os::raw::c_int,
pub mode: ::std::os::raw::c_int,
pub file_version: [::std::os::raw::c_int; 2usize],
pub num_items: usize,
pub items: *mut kaitem_t,
pub file: *mut FILE,
pub file_size: usize,
pub file_offset: ::std::os::raw::c_long,
pub key_read_buffer: *mut ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_kastore_t() {
const UNINIT: ::std::mem::MaybeUninit<kastore_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<kastore_t>(),
64usize,
concat!("Size of: ", stringify!(kastore_t))
);
assert_eq!(
::std::mem::align_of::<kastore_t>(),
8usize,
concat!("Alignment of ", stringify!(kastore_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(kastore_t),
"::",
stringify!(flags)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(kastore_t),
"::",
stringify!(mode)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).file_version) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(kastore_t),
"::",
stringify!(file_version)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_items) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(kastore_t),
"::",
stringify!(num_items)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).items) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(kastore_t),
"::",
stringify!(items)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).file) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(kastore_t),
"::",
stringify!(file)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).file_size) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(kastore_t),
"::",
stringify!(file_size)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).file_offset) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(kastore_t),
"::",
stringify!(file_offset)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).key_read_buffer) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(kastore_t),
"::",
stringify!(key_read_buffer)
)
);
}
extern "C" {
#[doc = "@brief Open a store from a given file in read (\"r\"), write (\"w\") or\nappend (\"a\") mode.\n\n@rst\nIn read mode, a store can be queried using the :ref:`get functions\n<sec_c_api_get>` and any attempts to write to the store will return an error.\nIn write and append mode, the store can written to using the :ref:`put\nfunctions <sec_c_api_put>` and any attempt to read will return an error.\n\nAfter :c:func:`kastore_open` has been called on a particular store,\n:c:func:`kastore_close` must be called to avoid leaking memory. This must also\nbe done when :c:func:`kastore_open` returns an error.\n\nWhen opened in read-mode, the default is to read key/array values from file\non demand. This is useful when a subset of the data is required and we don't\nwish to read the entire file. If the entire file is to be read, the\n``KAS_READ_ALL`` flag may be specified to improve performance.\n\nFlags**\n\nKAS_READ_ALL\nIf this option is specified, read the entire file at\nopen time. This will give slightly better performance as the file can\nbe read sequentially in a single pass.\n\nKAS_GET_TAKES_OWNERSHIP\nIf this option is specified, all ``get`` operations will transfer\nownership of the array to the caller. ``kastore`` will not ``free``\nthe array memory and this is the responsibility of the caller.\nIf ``get`` is called on the same key multiple times, a new buffer will be\nreturned each time. Note that second and subsequent ``get`` calls\non a given key will result in ``seek`` operations even when the\nKAS_READ_ALL flag is set, and will therefore fail on unseekable\nstreams.\n\n@endrst\n\n@param self A pointer to a kastore object.\n@param filename The file path to open.\n@param mode The open mode: can be read (\"r\"), write (\"w\") or append (\"a\").\n@param flags The open flags.\n@return Return 0 on success or a negative value on failure."]
pub fn kastore_open(
self_: *mut kastore_t,
filename: *const ::std::os::raw::c_char,
mode: *const ::std::os::raw::c_char,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Open a store from a given FILE pointer.\n\n@rst\nBehaviour, mode and flags follow that of :c:func:`kastore_open`,\nexcept append mode is not supported.\nThe ``file`` argument must be opened in an appropriate mode (e.g. \"r\"\nfor a kastore in \"r\" mode). Files open with other modes will result\nin KAS_ERR_IO being returned when read/write operations are attempted.\n\nThe FILE will not be closed when :c:func:`kastore_close` is called.\nIf the KAS_READ_ALL flag is supplied, no ``seek`` operations will be\nperformed on the FILE and so streams such as stdin, FIFOs etc are\nsupported. The FILE pointer will be positioned exactly at the end\nof the kastore encoded bytes once reading is completed, and reading\nmultiple stores from the same FILE sequentially is fully supported.\n@endrst\n\n@param self A pointer to a kastore object.\n@param file The FILE* to read/write the store from/to.\n@param mode The open mode: can be read (\"r\") or write (\"w\").\n@param flags The open flags.\n@return Return 0 on success or a negative value on failure."]
pub fn kastore_openf(
self_: *mut kastore_t,
file: *mut FILE,
mode: *const ::std::os::raw::c_char,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Close an opened store, freeing all resources.\n\nAny store that has been opened must be closed to avoid memory leaks\n(including cases in which errors have occured). It is not an error to\ncall ``kastore_close`` multiple times on the same object, but\n``kastore_open`` must be called before ``kastore_close``.\n\n@param self A pointer to a kastore object.\n@return Return 0 on success or a negative value on failure."]
pub fn kastore_close(self_: *mut kastore_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Return 1 if the store contains the specified key and 0 if it does not.\n\n@rst\nQueries the store for the specified key and returns 1 if it exists. If the\nkey does not exist, 0 is returned. If an error occurs (for example, if querying\nthe store while it is in write-mode), a negative value is returned.\n\nFor keys that are standard NULL terminated strings, the :c:func:`kastore_containss`\nfunction may be more convenient.\n@endrst\n\n@param self A pointer to a kastore object.\n@param key The key.\n@param key_len The length of the key.\n@return Return 1 if the key is present and 0 if it does not. If an error occurs,\nreturn a negative value."]
pub fn kastore_contains(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
key_len: usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Return 1 if the store contains the specified NULL terminated key\nand 0 if it does not.\n\n@rst\nQueries the store for the specified key, which must be a NULL terminated string,\nand returns 1 if it exists. If the\nkey does not exist, 0 is returned. If an error occurs (for example, if querying\nthe store while it is in write-mode), a negative value is returned.\nthe array in the specified destination pointers.\n@endrst\n\n@param self A pointer to a kastore object.\n@param key The key.\n@return Return 1 if the key is present and 0 if it does not. If an error occurs,\nreturn a negative value."]
pub fn kastore_containss(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Get the array for the specified key.\n\n@rst\nQueries the store for the specified key and stores pointers to the memory for\nthe corresponding array, the number of elements in this array and the type of\nthe array in the specified destination pointers. This is the most general form\nof ``get`` query in kastore, as non NULL-terminated strings can be used as\nkeys and the resulting array is returned in a generic pointer. When standard C\nstrings are used as keys and the type of the array is known, it is more\nconvenient to use the :ref:`typed variants <sec_c_api_typed_get>` of this function.\n\nThe returned array points to memory that is internally managed by the store\nand must not be freed or modified. The pointer is guaranteed to be valid\nuntil :c:func:`kastore_close` is called.\n@endrst\n\n@param self A pointer to a kastore object.\n@param key The key.\n@param key_len The length of the key.\n@param array The destination pointer for the array.\n@param array_len The destination pointer for the number of elements\nin the array.\n@param type The destination pointer for the type code of the array.\n@return Return 0 on success or a negative value on failure."]
pub fn kastore_get(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
key_len: usize,
array: *mut *mut ::std::os::raw::c_void,
array_len: *mut usize,
type_: *mut ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Get the array for the specified NULL-terminated key.\n\n@rst\nAs for :c:func:`kastore_get()` except the key is a NULL-terminated string.\n@endrst\n\n@param self A pointer to a kastore object.\n@param key The key.\n@param array The destination pointer for the array.\n@param array_len The destination pointer for the number of elements\nin the array.\n@param type The destination pointer for the type code of the array.\n@return Return 0 on success or a negative value on failure."]
pub fn kastore_gets(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *mut *mut ::std::os::raw::c_void,
array_len: *mut usize,
type_: *mut ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@defgroup TYPED_GETS_GROUP Typed get functions.\n@{"]
pub fn kastore_gets_int8(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *mut *mut i8,
array_len: *mut usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_gets_uint8(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *mut *mut u8,
array_len: *mut usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_gets_int16(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *mut *mut i16,
array_len: *mut usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_gets_uint16(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *mut *mut u16,
array_len: *mut usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_gets_int32(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *mut *mut i32,
array_len: *mut usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_gets_uint32(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *mut *mut u32,
array_len: *mut usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_gets_int64(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *mut *mut i64,
array_len: *mut usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_gets_uint64(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *mut *mut u64,
array_len: *mut usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_gets_float32(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *mut *mut f32,
array_len: *mut usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_gets_float64(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *mut *mut f64,
array_len: *mut usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Insert the specified key-array pair into the store.\n\n@rst\nA key with the specified length is inserted into the store and associated with\nan array of the specified type and number of elements. The contents of the\nspecified key and array are copied unless the KAS_BORROWS_ARRAY flag is specified.\nIf KAS_BORROWS_ARRAY is specified the array buffer must persist until the\nkastore is closed.\nKeys can be any sequence of bytes but must be at least one byte long and be\nunique. There is no restriction on the contents of arrays. This is the most\ngeneral form of ``put`` operation in kastore; when the type of the array\nis known and the keys are standard C strings, it is usually more convenient\nto use the :ref:`typed variants <sec_c_api_typed_put>` of this function.\n@endrst\n\n@param self A pointer to a kastore object.\n@param key The key.\n@param key_len The length of the key.\n@param array The array.\n@param array_len The number of elements in the array.\n@param type The type of the array.\n@param flags The insertion flags, only KAS_BORROWS_ARRAY or 0 is a valid.\n@return Return 0 on success or a negative value on failure."]
pub fn kastore_put(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
key_len: usize,
array: *const ::std::os::raw::c_void,
array_len: usize,
type_: ::std::os::raw::c_int,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Insert the specified NULL terminated key and array pair into the store.\n\n@rst\nAs for :c:func:`kastore_put` except the key must be NULL-terminated C string.\n@endrst\n\n@param self A pointer to a kastore object.\n@param key The key.\n@param array The array.\n@param array_len The number of elements in the array.\n@param type The type of the array.\n@param flags The insertion flags, only KAS_BORROWS_ARRAY or 0 is a valid.\n@return Return 0 on success or a negative value on failure."]
pub fn kastore_puts(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *const ::std::os::raw::c_void,
array_len: usize,
type_: ::std::os::raw::c_int,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@defgroup TYPED_PUTS_GROUP Typed put functions.\n@{"]
pub fn kastore_puts_int8(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *const i8,
array_len: usize,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_puts_uint8(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *const u8,
array_len: usize,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_puts_int16(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *const i16,
array_len: usize,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_puts_uint16(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *const u16,
array_len: usize,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_puts_int32(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *const i32,
array_len: usize,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_puts_uint32(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *const u32,
array_len: usize,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_puts_int64(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *const i64,
array_len: usize,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_puts_uint64(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *const u64,
array_len: usize,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_puts_float32(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *const f32,
array_len: usize,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_puts_float64(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *const f64,
array_len: usize,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Insert the specified key-array pair into the store, transferring ownership\nof the malloced array buffer to the store (own-put).\n\n@rst\nA key with the specified length is inserted into the store and associated with\nan array of the specified type and number of elements. The contents of the\nspecified key is copied, but the array buffer is taken directly and freed when\nthe store is closed. The array buffer must be a pointer returned by ``malloc``\nor ``calloc``. Ownership of the buffer is not taken unless the function returns\nsuccessfully.\n\nApart from taking ownership of the array buffer, the semantics of this\nfunction are identical to :c:func:`kastore_put`.\n@endrst\n\n@param self A pointer to a kastore object.\n@param key The key.\n@param key_len The length of the key.\n@param array The array. Must be a pointer returned by malloc/calloc.\n@param array_len The number of elements in the array.\n@param type The type of the array.\n@param flags The insertion flags. Currently unused.\n@return Return 0 on success or a negative value on failure."]
pub fn kastore_oput(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
key_len: usize,
array: *mut ::std::os::raw::c_void,
array_len: usize,
type_: ::std::os::raw::c_int,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Insert the specified NULL terminated key and array pair into the store,\ntransferring ownership of the malloced array buffer to the store (own-put).\n\n@rst\nAs for :c:func:`kastore_oput` except the key must be NULL-terminated C string.\n@endrst\n\n@param self A pointer to a kastore object.\n@param key The key.\n@param array The array. Must be a pointer returned by malloc/calloc.\n@param array_len The number of elements in the array.\n@param type The type of the array.\n@param flags The insertion flags. Currently unused.\n@return Return 0 on success or a negative value on failure."]
pub fn kastore_oputs(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *mut ::std::os::raw::c_void,
array_len: usize,
type_: ::std::os::raw::c_int,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@defgroup TYPED_OPUTS_GROUP Typed own-and-put functions.\n@{"]
pub fn kastore_oputs_int8(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *mut i8,
array_len: usize,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_oputs_uint8(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *mut u8,
array_len: usize,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_oputs_int16(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *mut i16,
array_len: usize,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_oputs_uint16(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *mut u16,
array_len: usize,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_oputs_int32(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *mut i32,
array_len: usize,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_oputs_uint32(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *mut u32,
array_len: usize,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_oputs_int64(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *mut i64,
array_len: usize,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_oputs_uint64(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *mut u64,
array_len: usize,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_oputs_float32(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *mut f32,
array_len: usize,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn kastore_oputs_float64(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *mut f64,
array_len: usize,
flags: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = " @}"]
pub fn kastore_print_state(self_: *mut kastore_t, out: *mut FILE);
}
#[doc = "@brief A single individual defined by a row in the individual table.\n\n@rst\nSee the :ref:`data model <sec_data_model_definitions>` section for the definition of\nan individual and its properties.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_individual_t {
#[doc = " @brief Non-negative ID value corresponding to table row."]
pub id: tsk_id_t,
#[doc = " @brief Bitwise flags."]
pub flags: tsk_flags_t,
#[doc = " @brief Spatial location. The number of dimensions is defined by\n ``location_length``."]
pub location: *const f64,
#[doc = " @brief Number of spatial dimensions."]
pub location_length: tsk_size_t,
#[doc = " @brief IDs of the parents. The number of parents given by ``parents_length``"]
pub parents: *mut tsk_id_t,
#[doc = " @brief Number of parents."]
pub parents_length: tsk_size_t,
#[doc = " @brief Metadata."]
pub metadata: *const ::std::os::raw::c_char,
#[doc = " @brief Size of the metadata in bytes."]
pub metadata_length: tsk_size_t,
#[doc = " @brief An array of the nodes associated with this individual"]
pub nodes: *const tsk_id_t,
#[doc = " @brief The number of nodes associated with this individual"]
pub nodes_length: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_individual_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_individual_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_individual_t>(),
72usize,
concat!("Size of: ", stringify!(tsk_individual_t))
);
assert_eq!(
::std::mem::align_of::<tsk_individual_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_individual_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_t),
"::",
stringify!(id)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_t),
"::",
stringify!(flags)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).location) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_t),
"::",
stringify!(location)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).location_length) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_t),
"::",
stringify!(location_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).parents) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_t),
"::",
stringify!(parents)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).parents_length) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_t),
"::",
stringify!(parents_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_t),
"::",
stringify!(metadata_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).nodes) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_t),
"::",
stringify!(nodes)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).nodes_length) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_t),
"::",
stringify!(nodes_length)
)
);
}
#[doc = "@brief A single node defined by a row in the node table.\n\n@rst\nSee the :ref:`data model <sec_data_model_definitions>` section for the definition of\na node and its properties.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_node_t {
#[doc = " @brief Non-negative ID value corresponding to table row."]
pub id: tsk_id_t,
#[doc = " @brief Bitwise flags."]
pub flags: tsk_flags_t,
#[doc = " @brief Time."]
pub time: f64,
#[doc = " @brief Population ID."]
pub population: tsk_id_t,
#[doc = " @brief Individual ID."]
pub individual: tsk_id_t,
#[doc = " @brief Metadata."]
pub metadata: *const ::std::os::raw::c_char,
#[doc = " @brief Size of the metadata in bytes."]
pub metadata_length: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_node_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_node_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_node_t>(),
40usize,
concat!("Size of: ", stringify!(tsk_node_t))
);
assert_eq!(
::std::mem::align_of::<tsk_node_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_node_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_t),
"::",
stringify!(id)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_t),
"::",
stringify!(flags)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_t),
"::",
stringify!(time)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).population) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_t),
"::",
stringify!(population)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).individual) as usize - ptr as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_t),
"::",
stringify!(individual)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_t),
"::",
stringify!(metadata_length)
)
);
}
#[doc = "@brief A single edge defined by a row in the edge table.\n\n@rst\nSee the :ref:`data model <sec_data_model_definitions>` section for the definition of\nan edge and its properties.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_edge_t {
#[doc = " @brief Non-negative ID value corresponding to table row."]
pub id: tsk_id_t,
#[doc = " @brief Parent node ID."]
pub parent: tsk_id_t,
#[doc = " @brief Child node ID."]
pub child: tsk_id_t,
#[doc = " @brief Left coordinate."]
pub left: f64,
#[doc = " @brief Right coordinate."]
pub right: f64,
#[doc = " @brief Metadata."]
pub metadata: *const ::std::os::raw::c_char,
#[doc = " @brief Size of the metadata in bytes."]
pub metadata_length: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_edge_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_edge_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_edge_t>(),
48usize,
concat!("Size of: ", stringify!(tsk_edge_t))
);
assert_eq!(
::std::mem::align_of::<tsk_edge_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_edge_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_t),
"::",
stringify!(id)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).parent) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_t),
"::",
stringify!(parent)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).child) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_t),
"::",
stringify!(child)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).left) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_t),
"::",
stringify!(left)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).right) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_t),
"::",
stringify!(right)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_t),
"::",
stringify!(metadata_length)
)
);
}
#[doc = "@brief A single mutation defined by a row in the mutation table.\n\n@rst\nSee the :ref:`data model <sec_data_model_definitions>` section for the definition of\na mutation and its properties.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_mutation_t {
#[doc = " @brief Non-negative ID value corresponding to table row."]
pub id: tsk_id_t,
#[doc = " @brief Site ID."]
pub site: tsk_id_t,
#[doc = " @brief Node ID."]
pub node: tsk_id_t,
#[doc = " @brief Parent mutation ID."]
pub parent: tsk_id_t,
#[doc = " @brief Mutation time."]
pub time: f64,
#[doc = " @brief Derived state."]
pub derived_state: *const ::std::os::raw::c_char,
#[doc = " @brief Size of the derived state in bytes."]
pub derived_state_length: tsk_size_t,
#[doc = " @brief Metadata."]
pub metadata: *const ::std::os::raw::c_char,
#[doc = " @brief Size of the metadata in bytes."]
pub metadata_length: tsk_size_t,
#[doc = " @brief The ID of the edge that this mutation lies on, or TSK_NULL\nif there is no corresponding edge."]
pub edge: tsk_id_t,
}
#[test]
fn bindgen_test_layout_tsk_mutation_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_mutation_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_mutation_t>(),
64usize,
concat!("Size of: ", stringify!(tsk_mutation_t))
);
assert_eq!(
::std::mem::align_of::<tsk_mutation_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_mutation_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_t),
"::",
stringify!(id)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).site) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_t),
"::",
stringify!(site)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).node) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_t),
"::",
stringify!(node)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).parent) as usize - ptr as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_t),
"::",
stringify!(parent)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_t),
"::",
stringify!(time)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).derived_state) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_t),
"::",
stringify!(derived_state)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).derived_state_length) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_t),
"::",
stringify!(derived_state_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_t),
"::",
stringify!(metadata_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).edge) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_t),
"::",
stringify!(edge)
)
);
}
#[doc = "@brief A single site defined by a row in the site table.\n\n@rst\nSee the :ref:`data model <sec_data_model_definitions>` section for the definition of\na site and its properties.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_site_t {
#[doc = " @brief Non-negative ID value corresponding to table row."]
pub id: tsk_id_t,
#[doc = " @brief Position coordinate."]
pub position: f64,
#[doc = " @brief Ancestral state."]
pub ancestral_state: *const ::std::os::raw::c_char,
#[doc = " @brief Ancestral state length in bytes."]
pub ancestral_state_length: tsk_size_t,
#[doc = " @brief Metadata."]
pub metadata: *const ::std::os::raw::c_char,
#[doc = " @brief Metadata length in bytes."]
pub metadata_length: tsk_size_t,
#[doc = " @brief An array of this site's mutations"]
pub mutations: *const tsk_mutation_t,
#[doc = " @brief The number of mutations at this site"]
pub mutations_length: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_site_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_site_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_site_t>(),
64usize,
concat!("Size of: ", stringify!(tsk_site_t))
);
assert_eq!(
::std::mem::align_of::<tsk_site_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_site_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_t),
"::",
stringify!(id)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).position) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_t),
"::",
stringify!(position)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).ancestral_state) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_t),
"::",
stringify!(ancestral_state)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).ancestral_state_length) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_t),
"::",
stringify!(ancestral_state_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_t),
"::",
stringify!(metadata_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).mutations) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_t),
"::",
stringify!(mutations)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).mutations_length) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_t),
"::",
stringify!(mutations_length)
)
);
}
#[doc = "@brief A single migration defined by a row in the migration table.\n\n@rst\nSee the :ref:`data model <sec_data_model_definitions>` section for the definition of\na migration and its properties.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_migration_t {
#[doc = " @brief Non-negative ID value corresponding to table row."]
pub id: tsk_id_t,
#[doc = " @brief Source population ID."]
pub source: tsk_id_t,
#[doc = " @brief Destination population ID."]
pub dest: tsk_id_t,
#[doc = " @brief Node ID."]
pub node: tsk_id_t,
#[doc = " @brief Left coordinate."]
pub left: f64,
#[doc = " @brief Right coordinate."]
pub right: f64,
#[doc = " @brief Time."]
pub time: f64,
#[doc = " @brief Metadata."]
pub metadata: *const ::std::os::raw::c_char,
#[doc = " @brief Size of the metadata in bytes."]
pub metadata_length: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_migration_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_migration_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_migration_t>(),
56usize,
concat!("Size of: ", stringify!(tsk_migration_t))
);
assert_eq!(
::std::mem::align_of::<tsk_migration_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_migration_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_t),
"::",
stringify!(id)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_t),
"::",
stringify!(source)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).dest) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_t),
"::",
stringify!(dest)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).node) as usize - ptr as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_t),
"::",
stringify!(node)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).left) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_t),
"::",
stringify!(left)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).right) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_t),
"::",
stringify!(right)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_t),
"::",
stringify!(time)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_t),
"::",
stringify!(metadata_length)
)
);
}
#[doc = "@brief A single population defined by a row in the population table.\n\n@rst\nSee the :ref:`data model <sec_data_model_definitions>` section for the definition of\na population and its properties.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_population_t {
#[doc = " @brief Non-negative ID value corresponding to table row."]
pub id: tsk_id_t,
#[doc = " @brief Metadata."]
pub metadata: *const ::std::os::raw::c_char,
#[doc = " @brief Metadata length in bytes."]
pub metadata_length: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_population_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_population_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_population_t>(),
24usize,
concat!("Size of: ", stringify!(tsk_population_t))
);
assert_eq!(
::std::mem::align_of::<tsk_population_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_population_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_t),
"::",
stringify!(id)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_t),
"::",
stringify!(metadata_length)
)
);
}
#[doc = "@brief A single provenance defined by a row in the provenance table.\n\n@rst\nSee the :ref:`data model <sec_data_model_definitions>` section for the definition of\na provenance object and its properties. See the :ref:`sec_provenance` section\nfor more information on how provenance records should be structured.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_provenance_t {
#[doc = " @brief Non-negative ID value corresponding to table row."]
pub id: tsk_id_t,
#[doc = " @brief The timestamp."]
pub timestamp: *const ::std::os::raw::c_char,
#[doc = " @brief The timestamp length in bytes."]
pub timestamp_length: tsk_size_t,
#[doc = " @brief The record."]
pub record: *const ::std::os::raw::c_char,
#[doc = " @brief The record length in bytes."]
pub record_length: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_provenance_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_provenance_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_provenance_t>(),
40usize,
concat!("Size of: ", stringify!(tsk_provenance_t))
);
assert_eq!(
::std::mem::align_of::<tsk_provenance_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_provenance_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_t),
"::",
stringify!(id)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).timestamp) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_t),
"::",
stringify!(timestamp)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).timestamp_length) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_t),
"::",
stringify!(timestamp_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).record) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_t),
"::",
stringify!(record)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).record_length) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_t),
"::",
stringify!(record_length)
)
);
}
#[doc = "@brief The individual table.\n\n@rst\nSee the individual :ref:`table definition <sec_individual_table_definition>` for\ndetails of the columns in this table.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_individual_table_t {
#[doc = " @brief The number of rows in this table."]
pub num_rows: tsk_size_t,
pub max_rows: tsk_size_t,
pub max_rows_increment: tsk_size_t,
#[doc = " @brief The total length of the location column."]
pub location_length: tsk_size_t,
pub max_location_length: tsk_size_t,
pub max_location_length_increment: tsk_size_t,
#[doc = " @brief The total length of the parent column."]
pub parents_length: tsk_size_t,
pub max_parents_length: tsk_size_t,
pub max_parents_length_increment: tsk_size_t,
#[doc = " @brief The total length of the metadata column."]
pub metadata_length: tsk_size_t,
pub max_metadata_length: tsk_size_t,
pub max_metadata_length_increment: tsk_size_t,
pub metadata_schema_length: tsk_size_t,
#[doc = " @brief The flags column."]
pub flags: *mut tsk_flags_t,
#[doc = " @brief The location column."]
pub location: *mut f64,
#[doc = " @brief The location_offset column."]
pub location_offset: *mut tsk_size_t,
#[doc = " @brief The parents column."]
pub parents: *mut tsk_id_t,
#[doc = " @brief The parents_offset column."]
pub parents_offset: *mut tsk_size_t,
#[doc = " @brief The metadata column."]
pub metadata: *mut ::std::os::raw::c_char,
#[doc = " @brief The metadata_offset column."]
pub metadata_offset: *mut tsk_size_t,
#[doc = " @brief The metadata schema"]
pub metadata_schema: *mut ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_tsk_individual_table_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_individual_table_t> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_individual_table_t>(),
168usize,
concat!("Size of: ", stringify!(tsk_individual_table_t))
);
assert_eq!(
::std::mem::align_of::<tsk_individual_table_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_individual_table_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_rows) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(num_rows)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_rows) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(max_rows)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_rows_increment) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(max_rows_increment)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).location_length) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(location_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_location_length) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(max_location_length)
)
);
assert_eq!(
unsafe {
::std::ptr::addr_of!((*ptr).max_location_length_increment) as usize - ptr as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(max_location_length_increment)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).parents_length) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(parents_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_parents_length) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(max_parents_length)
)
);
assert_eq!(
unsafe {
::std::ptr::addr_of!((*ptr).max_parents_length_increment) as usize - ptr as usize
},
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(max_parents_length_increment)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(metadata_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_metadata_length) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(max_metadata_length)
)
);
assert_eq!(
unsafe {
::std::ptr::addr_of!((*ptr).max_metadata_length_increment) as usize - ptr as usize
},
88usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(max_metadata_length_increment)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema_length) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(metadata_schema_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(flags)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).location) as usize - ptr as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(location)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).location_offset) as usize - ptr as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(location_offset)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).parents) as usize - ptr as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(parents)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).parents_offset) as usize - ptr as usize },
136usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(parents_offset)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
144usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_offset) as usize - ptr as usize },
152usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(metadata_offset)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema) as usize - ptr as usize },
160usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(metadata_schema)
)
);
}
#[doc = "@brief The node table.\n\n@rst\nSee the node :ref:`table definition <sec_node_table_definition>` for\ndetails of the columns in this table.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_node_table_t {
#[doc = " @brief The number of rows in this table."]
pub num_rows: tsk_size_t,
pub max_rows: tsk_size_t,
pub max_rows_increment: tsk_size_t,
#[doc = " @brief The total length of the metadata column."]
pub metadata_length: tsk_size_t,
pub max_metadata_length: tsk_size_t,
pub max_metadata_length_increment: tsk_size_t,
pub metadata_schema_length: tsk_size_t,
#[doc = " @brief The flags column."]
pub flags: *mut tsk_flags_t,
#[doc = " @brief The time column."]
pub time: *mut f64,
#[doc = " @brief The population column."]
pub population: *mut tsk_id_t,
#[doc = " @brief The individual column."]
pub individual: *mut tsk_id_t,
#[doc = " @brief The metadata column."]
pub metadata: *mut ::std::os::raw::c_char,
#[doc = " @brief The metadata_offset column."]
pub metadata_offset: *mut tsk_size_t,
#[doc = " @brief The metadata schema"]
pub metadata_schema: *mut ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_tsk_node_table_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_node_table_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_node_table_t>(),
112usize,
concat!("Size of: ", stringify!(tsk_node_table_t))
);
assert_eq!(
::std::mem::align_of::<tsk_node_table_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_node_table_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_rows) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(num_rows)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_rows) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(max_rows)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_rows_increment) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(max_rows_increment)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(metadata_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_metadata_length) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(max_metadata_length)
)
);
assert_eq!(
unsafe {
::std::ptr::addr_of!((*ptr).max_metadata_length_increment) as usize - ptr as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(max_metadata_length_increment)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema_length) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(metadata_schema_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(flags)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(time)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).population) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(population)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).individual) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(individual)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_offset) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(metadata_offset)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema) as usize - ptr as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(metadata_schema)
)
);
}
#[doc = "@brief The edge table.\n\n@rst\nSee the edge :ref:`table definition <sec_edge_table_definition>` for\ndetails of the columns in this table.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_edge_table_t {
#[doc = " @brief The number of rows in this table."]
pub num_rows: tsk_size_t,
pub max_rows: tsk_size_t,
pub max_rows_increment: tsk_size_t,
#[doc = " @brief The total length of the metadata column."]
pub metadata_length: tsk_size_t,
pub max_metadata_length: tsk_size_t,
pub max_metadata_length_increment: tsk_size_t,
pub metadata_schema_length: tsk_size_t,
#[doc = " @brief The left column."]
pub left: *mut f64,
#[doc = " @brief The right column."]
pub right: *mut f64,
#[doc = " @brief The parent column."]
pub parent: *mut tsk_id_t,
#[doc = " @brief The child column."]
pub child: *mut tsk_id_t,
#[doc = " @brief The metadata column."]
pub metadata: *mut ::std::os::raw::c_char,
#[doc = " @brief The metadata_offset column."]
pub metadata_offset: *mut tsk_size_t,
#[doc = " @brief The metadata schema"]
pub metadata_schema: *mut ::std::os::raw::c_char,
#[doc = " @brief Flags for this table"]
pub options: tsk_flags_t,
}
#[test]
fn bindgen_test_layout_tsk_edge_table_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_edge_table_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_edge_table_t>(),
120usize,
concat!("Size of: ", stringify!(tsk_edge_table_t))
);
assert_eq!(
::std::mem::align_of::<tsk_edge_table_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_edge_table_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_rows) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(num_rows)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_rows) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(max_rows)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_rows_increment) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(max_rows_increment)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(metadata_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_metadata_length) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(max_metadata_length)
)
);
assert_eq!(
unsafe {
::std::ptr::addr_of!((*ptr).max_metadata_length_increment) as usize - ptr as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(max_metadata_length_increment)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema_length) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(metadata_schema_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).left) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(left)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).right) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(right)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).parent) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(parent)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).child) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(child)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_offset) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(metadata_offset)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema) as usize - ptr as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(metadata_schema)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).options) as usize - ptr as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(options)
)
);
}
#[doc = "@brief The migration table.\n\n@rst\nSee the migration :ref:`table definition <sec_migration_table_definition>` for\ndetails of the columns in this table.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_migration_table_t {
#[doc = " @brief The number of rows in this table."]
pub num_rows: tsk_size_t,
pub max_rows: tsk_size_t,
pub max_rows_increment: tsk_size_t,
#[doc = " @brief The total length of the metadata column."]
pub metadata_length: tsk_size_t,
pub max_metadata_length: tsk_size_t,
pub max_metadata_length_increment: tsk_size_t,
pub metadata_schema_length: tsk_size_t,
#[doc = " @brief The source column."]
pub source: *mut tsk_id_t,
#[doc = " @brief The dest column."]
pub dest: *mut tsk_id_t,
#[doc = " @brief The node column."]
pub node: *mut tsk_id_t,
#[doc = " @brief The left column."]
pub left: *mut f64,
#[doc = " @brief The right column."]
pub right: *mut f64,
#[doc = " @brief The time column."]
pub time: *mut f64,
#[doc = " @brief The metadata column."]
pub metadata: *mut ::std::os::raw::c_char,
#[doc = " @brief The metadata_offset column."]
pub metadata_offset: *mut tsk_size_t,
#[doc = " @brief The metadata schema"]
pub metadata_schema: *mut ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_tsk_migration_table_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_migration_table_t> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_migration_table_t>(),
128usize,
concat!("Size of: ", stringify!(tsk_migration_table_t))
);
assert_eq!(
::std::mem::align_of::<tsk_migration_table_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_migration_table_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_rows) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(num_rows)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_rows) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(max_rows)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_rows_increment) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(max_rows_increment)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(metadata_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_metadata_length) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(max_metadata_length)
)
);
assert_eq!(
unsafe {
::std::ptr::addr_of!((*ptr).max_metadata_length_increment) as usize - ptr as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(max_metadata_length_increment)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema_length) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(metadata_schema_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(source)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).dest) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(dest)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).node) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(node)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).left) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(left)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).right) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(right)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(time)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_offset) as usize - ptr as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(metadata_offset)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema) as usize - ptr as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(metadata_schema)
)
);
}
#[doc = "@brief The site table.\n\n@rst\nSee the site :ref:`table definition <sec_site_table_definition>` for\ndetails of the columns in this table.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_site_table_t {
#[doc = " @brief The number of rows in this table."]
pub num_rows: tsk_size_t,
pub max_rows: tsk_size_t,
pub max_rows_increment: tsk_size_t,
pub ancestral_state_length: tsk_size_t,
pub max_ancestral_state_length: tsk_size_t,
pub max_ancestral_state_length_increment: tsk_size_t,
#[doc = " @brief The total length of the metadata column."]
pub metadata_length: tsk_size_t,
pub max_metadata_length: tsk_size_t,
pub max_metadata_length_increment: tsk_size_t,
pub metadata_schema_length: tsk_size_t,
#[doc = " @brief The position column."]
pub position: *mut f64,
#[doc = " @brief The ancestral_state column."]
pub ancestral_state: *mut ::std::os::raw::c_char,
#[doc = " @brief The ancestral_state_offset column."]
pub ancestral_state_offset: *mut tsk_size_t,
#[doc = " @brief The metadata column."]
pub metadata: *mut ::std::os::raw::c_char,
#[doc = " @brief The metadata_offset column."]
pub metadata_offset: *mut tsk_size_t,
#[doc = " @brief The metadata schema"]
pub metadata_schema: *mut ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_tsk_site_table_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_site_table_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_site_table_t>(),
128usize,
concat!("Size of: ", stringify!(tsk_site_table_t))
);
assert_eq!(
::std::mem::align_of::<tsk_site_table_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_site_table_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_rows) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(num_rows)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_rows) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(max_rows)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_rows_increment) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(max_rows_increment)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).ancestral_state_length) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(ancestral_state_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_ancestral_state_length) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(max_ancestral_state_length)
)
);
assert_eq!(
unsafe {
::std::ptr::addr_of!((*ptr).max_ancestral_state_length_increment) as usize
- ptr as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(max_ancestral_state_length_increment)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(metadata_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_metadata_length) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(max_metadata_length)
)
);
assert_eq!(
unsafe {
::std::ptr::addr_of!((*ptr).max_metadata_length_increment) as usize - ptr as usize
},
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(max_metadata_length_increment)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema_length) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(metadata_schema_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).position) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(position)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).ancestral_state) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(ancestral_state)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).ancestral_state_offset) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(ancestral_state_offset)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_offset) as usize - ptr as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(metadata_offset)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema) as usize - ptr as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(metadata_schema)
)
);
}
#[doc = "@brief The mutation table.\n\n@rst\nSee the mutation :ref:`table definition <sec_mutation_table_definition>` for\ndetails of the columns in this table.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_mutation_table_t {
#[doc = " @brief The number of rows in this table."]
pub num_rows: tsk_size_t,
pub max_rows: tsk_size_t,
pub max_rows_increment: tsk_size_t,
pub derived_state_length: tsk_size_t,
pub max_derived_state_length: tsk_size_t,
pub max_derived_state_length_increment: tsk_size_t,
#[doc = " @brief The total length of the metadata column."]
pub metadata_length: tsk_size_t,
pub max_metadata_length: tsk_size_t,
pub max_metadata_length_increment: tsk_size_t,
pub metadata_schema_length: tsk_size_t,
#[doc = " @brief The node column."]
pub node: *mut tsk_id_t,
#[doc = " @brief The site column."]
pub site: *mut tsk_id_t,
#[doc = " @brief The parent column."]
pub parent: *mut tsk_id_t,
#[doc = " @brief The time column."]
pub time: *mut f64,
#[doc = " @brief The derived_state column."]
pub derived_state: *mut ::std::os::raw::c_char,
#[doc = " @brief The derived_state_offset column."]
pub derived_state_offset: *mut tsk_size_t,
#[doc = " @brief The metadata column."]
pub metadata: *mut ::std::os::raw::c_char,
#[doc = " @brief The metadata_offset column."]
pub metadata_offset: *mut tsk_size_t,
#[doc = " @brief The metadata schema"]
pub metadata_schema: *mut ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_tsk_mutation_table_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_mutation_table_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_mutation_table_t>(),
152usize,
concat!("Size of: ", stringify!(tsk_mutation_table_t))
);
assert_eq!(
::std::mem::align_of::<tsk_mutation_table_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_mutation_table_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_rows) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(num_rows)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_rows) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(max_rows)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_rows_increment) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(max_rows_increment)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).derived_state_length) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(derived_state_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_derived_state_length) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(max_derived_state_length)
)
);
assert_eq!(
unsafe {
::std::ptr::addr_of!((*ptr).max_derived_state_length_increment) as usize - ptr as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(max_derived_state_length_increment)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(metadata_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_metadata_length) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(max_metadata_length)
)
);
assert_eq!(
unsafe {
::std::ptr::addr_of!((*ptr).max_metadata_length_increment) as usize - ptr as usize
},
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(max_metadata_length_increment)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema_length) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(metadata_schema_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).node) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(node)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).site) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(site)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).parent) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(parent)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(time)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).derived_state) as usize - ptr as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(derived_state)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).derived_state_offset) as usize - ptr as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(derived_state_offset)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_offset) as usize - ptr as usize },
136usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(metadata_offset)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema) as usize - ptr as usize },
144usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(metadata_schema)
)
);
}
#[doc = "@brief The population table.\n\n@rst\nSee the population :ref:`table definition <sec_population_table_definition>` for\ndetails of the columns in this table.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_population_table_t {
#[doc = " @brief The number of rows in this table."]
pub num_rows: tsk_size_t,
pub max_rows: tsk_size_t,
pub max_rows_increment: tsk_size_t,
#[doc = " @brief The total length of the metadata column."]
pub metadata_length: tsk_size_t,
pub max_metadata_length: tsk_size_t,
pub max_metadata_length_increment: tsk_size_t,
pub metadata_schema_length: tsk_size_t,
#[doc = " @brief The metadata column."]
pub metadata: *mut ::std::os::raw::c_char,
#[doc = " @brief The metadata_offset column."]
pub metadata_offset: *mut tsk_size_t,
#[doc = " @brief The metadata schema"]
pub metadata_schema: *mut ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_tsk_population_table_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_population_table_t> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_population_table_t>(),
80usize,
concat!("Size of: ", stringify!(tsk_population_table_t))
);
assert_eq!(
::std::mem::align_of::<tsk_population_table_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_population_table_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_rows) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_table_t),
"::",
stringify!(num_rows)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_rows) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_table_t),
"::",
stringify!(max_rows)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_rows_increment) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_table_t),
"::",
stringify!(max_rows_increment)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_table_t),
"::",
stringify!(metadata_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_metadata_length) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_table_t),
"::",
stringify!(max_metadata_length)
)
);
assert_eq!(
unsafe {
::std::ptr::addr_of!((*ptr).max_metadata_length_increment) as usize - ptr as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_table_t),
"::",
stringify!(max_metadata_length_increment)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema_length) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_table_t),
"::",
stringify!(metadata_schema_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_table_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_offset) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_table_t),
"::",
stringify!(metadata_offset)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_table_t),
"::",
stringify!(metadata_schema)
)
);
}
#[doc = "@brief The provenance table.\n\n@rst\nSee the provenance :ref:`table definition <sec_provenance_table_definition>` for\ndetails of the columns in this table.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_provenance_table_t {
#[doc = " @brief The number of rows in this table."]
pub num_rows: tsk_size_t,
pub max_rows: tsk_size_t,
pub max_rows_increment: tsk_size_t,
#[doc = " @brief The total length of the timestamp column."]
pub timestamp_length: tsk_size_t,
pub max_timestamp_length: tsk_size_t,
pub max_timestamp_length_increment: tsk_size_t,
#[doc = " @brief The total length of the record column."]
pub record_length: tsk_size_t,
pub max_record_length: tsk_size_t,
pub max_record_length_increment: tsk_size_t,
#[doc = " @brief The timestamp column."]
pub timestamp: *mut ::std::os::raw::c_char,
#[doc = " @brief The timestamp_offset column."]
pub timestamp_offset: *mut tsk_size_t,
#[doc = " @brief The record column."]
pub record: *mut ::std::os::raw::c_char,
#[doc = " @brief The record_offset column."]
pub record_offset: *mut tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_provenance_table_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_provenance_table_t> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_provenance_table_t>(),
104usize,
concat!("Size of: ", stringify!(tsk_provenance_table_t))
);
assert_eq!(
::std::mem::align_of::<tsk_provenance_table_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_provenance_table_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_rows) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(num_rows)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_rows) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(max_rows)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_rows_increment) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(max_rows_increment)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).timestamp_length) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(timestamp_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_timestamp_length) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(max_timestamp_length)
)
);
assert_eq!(
unsafe {
::std::ptr::addr_of!((*ptr).max_timestamp_length_increment) as usize - ptr as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(max_timestamp_length_increment)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).record_length) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(record_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_record_length) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(max_record_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_record_length_increment) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(max_record_length_increment)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).timestamp) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(timestamp)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).timestamp_offset) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(timestamp_offset)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).record) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(record)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).record_offset) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(record_offset)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_reference_sequence_t {
pub data: *mut ::std::os::raw::c_char,
pub data_length: tsk_size_t,
pub url: *mut ::std::os::raw::c_char,
pub url_length: tsk_size_t,
pub metadata: *mut ::std::os::raw::c_char,
pub metadata_length: tsk_size_t,
pub metadata_schema: *mut ::std::os::raw::c_char,
pub metadata_schema_length: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_reference_sequence_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_reference_sequence_t> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_reference_sequence_t>(),
64usize,
concat!("Size of: ", stringify!(tsk_reference_sequence_t))
);
assert_eq!(
::std::mem::align_of::<tsk_reference_sequence_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_reference_sequence_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_reference_sequence_t),
"::",
stringify!(data)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).data_length) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_reference_sequence_t),
"::",
stringify!(data_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).url) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_reference_sequence_t),
"::",
stringify!(url)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).url_length) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_reference_sequence_t),
"::",
stringify!(url_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_reference_sequence_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_reference_sequence_t),
"::",
stringify!(metadata_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_reference_sequence_t),
"::",
stringify!(metadata_schema)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema_length) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_reference_sequence_t),
"::",
stringify!(metadata_schema_length)
)
);
}
#[doc = "@brief A collection of tables defining the data for a tree sequence."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_table_collection_t {
#[doc = " @brief The sequence length defining the tree sequence's coordinate space"]
pub sequence_length: f64,
pub file_uuid: *mut ::std::os::raw::c_char,
#[doc = " @brief The units of the time dimension"]
pub time_units: *mut ::std::os::raw::c_char,
pub time_units_length: tsk_size_t,
#[doc = " @brief The tree-sequence metadata"]
pub metadata: *mut ::std::os::raw::c_char,
pub metadata_length: tsk_size_t,
#[doc = " @brief The metadata schema"]
pub metadata_schema: *mut ::std::os::raw::c_char,
pub metadata_schema_length: tsk_size_t,
pub reference_sequence: tsk_reference_sequence_t,
#[doc = " @brief The individual table"]
pub individuals: tsk_individual_table_t,
#[doc = " @brief The node table"]
pub nodes: tsk_node_table_t,
#[doc = " @brief The edge table"]
pub edges: tsk_edge_table_t,
#[doc = " @brief The migration table"]
pub migrations: tsk_migration_table_t,
#[doc = " @brief The site table"]
pub sites: tsk_site_table_t,
#[doc = " @brief The mutation table"]
pub mutations: tsk_mutation_table_t,
#[doc = " @brief The population table"]
pub populations: tsk_population_table_t,
#[doc = " @brief The provenance table"]
pub provenances: tsk_provenance_table_t,
pub indexes: tsk_table_collection_t__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_table_collection_t__bindgen_ty_1 {
pub edge_insertion_order: *mut tsk_id_t,
pub edge_removal_order: *mut tsk_id_t,
pub num_edges: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_table_collection_t__bindgen_ty_1() {
const UNINIT: ::std::mem::MaybeUninit<tsk_table_collection_t__bindgen_ty_1> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_table_collection_t__bindgen_ty_1>(),
24usize,
concat!(
"Size of: ",
stringify!(tsk_table_collection_t__bindgen_ty_1)
)
);
assert_eq!(
::std::mem::align_of::<tsk_table_collection_t__bindgen_ty_1>(),
8usize,
concat!(
"Alignment of ",
stringify!(tsk_table_collection_t__bindgen_ty_1)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).edge_insertion_order) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t__bindgen_ty_1),
"::",
stringify!(edge_insertion_order)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).edge_removal_order) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t__bindgen_ty_1),
"::",
stringify!(edge_removal_order)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_edges) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t__bindgen_ty_1),
"::",
stringify!(num_edges)
)
);
}
#[test]
fn bindgen_test_layout_tsk_table_collection_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_table_collection_t> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_table_collection_t>(),
1144usize,
concat!("Size of: ", stringify!(tsk_table_collection_t))
);
assert_eq!(
::std::mem::align_of::<tsk_table_collection_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_table_collection_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).sequence_length) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(sequence_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).file_uuid) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(file_uuid)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).time_units) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(time_units)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).time_units_length) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(time_units_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(metadata_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(metadata_schema)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema_length) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(metadata_schema_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).reference_sequence) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(reference_sequence)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).individuals) as usize - ptr as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(individuals)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).nodes) as usize - ptr as usize },
296usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(nodes)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).edges) as usize - ptr as usize },
408usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(edges)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).migrations) as usize - ptr as usize },
528usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(migrations)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).sites) as usize - ptr as usize },
656usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(sites)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).mutations) as usize - ptr as usize },
784usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(mutations)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).populations) as usize - ptr as usize },
936usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(populations)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).provenances) as usize - ptr as usize },
1016usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(provenances)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).indexes) as usize - ptr as usize },
1120usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(indexes)
)
);
}
#[doc = "@brief A bookmark recording the position of all the tables in a table collection."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_bookmark_t {
#[doc = " @brief The position in the individual table."]
pub individuals: tsk_size_t,
#[doc = " @brief The position in the node table."]
pub nodes: tsk_size_t,
#[doc = " @brief The position in the edge table."]
pub edges: tsk_size_t,
#[doc = " @brief The position in the migration table."]
pub migrations: tsk_size_t,
#[doc = " @brief The position in the site table."]
pub sites: tsk_size_t,
#[doc = " @brief The position in the mutation table."]
pub mutations: tsk_size_t,
#[doc = " @brief The position in the population table."]
pub populations: tsk_size_t,
#[doc = " @brief The position in the provenance table."]
pub provenances: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_bookmark_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_bookmark_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_bookmark_t>(),
64usize,
concat!("Size of: ", stringify!(tsk_bookmark_t))
);
assert_eq!(
::std::mem::align_of::<tsk_bookmark_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_bookmark_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).individuals) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_bookmark_t),
"::",
stringify!(individuals)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).nodes) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_bookmark_t),
"::",
stringify!(nodes)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).edges) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_bookmark_t),
"::",
stringify!(edges)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).migrations) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_bookmark_t),
"::",
stringify!(migrations)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).sites) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_bookmark_t),
"::",
stringify!(sites)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).mutations) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_bookmark_t),
"::",
stringify!(mutations)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).populations) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_bookmark_t),
"::",
stringify!(populations)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).provenances) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_bookmark_t),
"::",
stringify!(provenances)
)
);
}
#[doc = "@brief Low-level table sorting method."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _tsk_table_sorter_t {
#[doc = " @brief The input tables that are being sorted."]
pub tables: *mut tsk_table_collection_t,
#[doc = " @brief The edge sorting function. If set to NULL, edges are not sorted."]
pub sort_edges: ::std::option::Option<
unsafe extern "C" fn(
self_: *mut _tsk_table_sorter_t,
start: tsk_size_t,
) -> ::std::os::raw::c_int,
>,
#[doc = " @brief The mutation sorting function."]
pub sort_mutations: ::std::option::Option<
unsafe extern "C" fn(self_: *mut _tsk_table_sorter_t) -> ::std::os::raw::c_int,
>,
#[doc = " @brief The individual sorting function."]
pub sort_individuals: ::std::option::Option<
unsafe extern "C" fn(self_: *mut _tsk_table_sorter_t) -> ::std::os::raw::c_int,
>,
#[doc = " @brief An opaque pointer for use by client code"]
pub user_data: *mut ::std::os::raw::c_void,
#[doc = " @brief Mapping from input site IDs to output site IDs"]
pub site_id_map: *mut tsk_id_t,
}
#[test]
fn bindgen_test_layout__tsk_table_sorter_t() {
const UNINIT: ::std::mem::MaybeUninit<_tsk_table_sorter_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<_tsk_table_sorter_t>(),
48usize,
concat!("Size of: ", stringify!(_tsk_table_sorter_t))
);
assert_eq!(
::std::mem::align_of::<_tsk_table_sorter_t>(),
8usize,
concat!("Alignment of ", stringify!(_tsk_table_sorter_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).tables) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_tsk_table_sorter_t),
"::",
stringify!(tables)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).sort_edges) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(_tsk_table_sorter_t),
"::",
stringify!(sort_edges)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).sort_mutations) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(_tsk_table_sorter_t),
"::",
stringify!(sort_mutations)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).sort_individuals) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(_tsk_table_sorter_t),
"::",
stringify!(sort_individuals)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).user_data) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(_tsk_table_sorter_t),
"::",
stringify!(user_data)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).site_id_map) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(_tsk_table_sorter_t),
"::",
stringify!(site_id_map)
)
);
}
#[doc = "@brief Low-level table sorting method."]
pub type tsk_table_sorter_t = _tsk_table_sorter_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _tsk_identity_segment_t {
pub left: f64,
pub right: f64,
pub next: *mut _tsk_identity_segment_t,
pub node: tsk_id_t,
}
#[test]
fn bindgen_test_layout__tsk_identity_segment_t() {
const UNINIT: ::std::mem::MaybeUninit<_tsk_identity_segment_t> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<_tsk_identity_segment_t>(),
32usize,
concat!("Size of: ", stringify!(_tsk_identity_segment_t))
);
assert_eq!(
::std::mem::align_of::<_tsk_identity_segment_t>(),
8usize,
concat!("Alignment of ", stringify!(_tsk_identity_segment_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).left) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_tsk_identity_segment_t),
"::",
stringify!(left)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).right) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(_tsk_identity_segment_t),
"::",
stringify!(right)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(_tsk_identity_segment_t),
"::",
stringify!(next)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).node) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(_tsk_identity_segment_t),
"::",
stringify!(node)
)
);
}
pub type tsk_identity_segment_t = _tsk_identity_segment_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_identity_segment_list_t {
pub num_segments: tsk_size_t,
pub total_span: f64,
pub head: *mut tsk_identity_segment_t,
pub tail: *mut tsk_identity_segment_t,
}
#[test]
fn bindgen_test_layout_tsk_identity_segment_list_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_identity_segment_list_t> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_identity_segment_list_t>(),
32usize,
concat!("Size of: ", stringify!(tsk_identity_segment_list_t))
);
assert_eq!(
::std::mem::align_of::<tsk_identity_segment_list_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_identity_segment_list_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_segments) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_identity_segment_list_t),
"::",
stringify!(num_segments)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).total_span) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_identity_segment_list_t),
"::",
stringify!(total_span)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_identity_segment_list_t),
"::",
stringify!(head)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_identity_segment_list_t),
"::",
stringify!(tail)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_identity_segments_t {
pub num_nodes: tsk_size_t,
pub pair_map: tsk_avl_tree_int_t,
pub num_segments: tsk_size_t,
pub total_span: f64,
pub heap: tsk_blkalloc_t,
pub store_segments: bool,
pub store_pairs: bool,
}
#[test]
fn bindgen_test_layout_tsk_identity_segments_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_identity_segments_t> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_identity_segments_t>(),
144usize,
concat!("Size of: ", stringify!(tsk_identity_segments_t))
);
assert_eq!(
::std::mem::align_of::<tsk_identity_segments_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_identity_segments_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_nodes) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_identity_segments_t),
"::",
stringify!(num_nodes)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).pair_map) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_identity_segments_t),
"::",
stringify!(pair_map)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_segments) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_identity_segments_t),
"::",
stringify!(num_segments)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).total_span) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(tsk_identity_segments_t),
"::",
stringify!(total_span)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).heap) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(tsk_identity_segments_t),
"::",
stringify!(heap)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).store_segments) as usize - ptr as usize },
136usize,
concat!(
"Offset of field: ",
stringify!(tsk_identity_segments_t),
"::",
stringify!(store_segments)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).store_pairs) as usize - ptr as usize },
137usize,
concat!(
"Offset of field: ",
stringify!(tsk_identity_segments_t),
"::",
stringify!(store_pairs)
)
);
}
extern "C" {
#[doc = "@brief Initialises the table by allocating the internal memory.\n\n@rst\nThis must be called before any operations are performed on the table.\nSee the :ref:`sec_c_api_overview_structure` for details on how objects\nare initialised and freed.\n@endrst\n\n@param self A pointer to an uninitialised tsk_individual_table_t object.\n@param options Allocation time options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_individual_table_init(
self_: *mut tsk_individual_table_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Free the internal memory for the specified table.\n\n@param self A pointer to an initialised tsk_individual_table_t object.\n@return Always returns 0."]
pub fn tsk_individual_table_free(self_: *mut tsk_individual_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Adds a row to this individual table.\n\n@rst\nAdd a new individual with the specified ``flags``, ``location``, ``parents`` and\n``metadata`` to the table. Copies of the ``location``, ``parents`` and ``metadata``\nparameters are taken immediately. See the :ref:`table definition\n<sec_individual_table_definition>` for details of the columns in this table.\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param flags The bitwise flags for the new individual.\n@param location A pointer to a double array representing the spatial location\nof the new individual. Can be ``NULL`` if ``location_length`` is 0.\n@param location_length The number of dimensions in the locations position.\nNote this the number of elements in the corresponding double array\nnot the number of bytes.\n@param parents A pointer to a ``tsk_id`` array representing the parents\nof the new individual. Can be ``NULL`` if ``parents_length`` is 0.\n@param parents_length The number of parents.\nNote this the number of elements in the corresponding ``tsk_id`` array\nnot the number of bytes.\n@param metadata The metadata to be associated with the new individual. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n@return Return the ID of the newly added individual on success,\nor a negative value on failure."]
pub fn tsk_individual_table_add_row(
self_: *mut tsk_individual_table_t,
flags: tsk_flags_t,
location: *const f64,
location_length: tsk_size_t,
parents: *const tsk_id_t,
parents_length: tsk_size_t,
metadata: *const ::std::os::raw::c_char,
metadata_length: tsk_size_t,
) -> tsk_id_t;
}
extern "C" {
#[doc = "@brief Updates the row at the specified index.\n\n@rst\nRewrite the row at the specified index in this table to use the specified\nvalues. Copies of the ``location``, ``parents`` and ``metadata``\nparameters are taken immediately. See the :ref:`table definition\n<sec_individual_table_definition>` for details of the columns in this table.\n\n.. warning::\nBecause of the way that ragged columns are encoded, this method requires a\nfull rewrite of the internal column memory in worst case, and would\ntherefore be inefficient for bulk updates for such columns. However, if the\nsizes of all ragged column values are unchanged in the updated row, this\nmethod is guaranteed to only update the memory for the row in question.\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param index The row to update.\n@param flags The bitwise flags for the individual.\n@param location A pointer to a double array representing the spatial location\nof the new individual. Can be ``NULL`` if ``location_length`` is 0.\n@param location_length The number of dimensions in the locations position.\nNote this the number of elements in the corresponding double array\nnot the number of bytes.\n@param parents A pointer to a ``tsk_id`` array representing the parents\nof the new individual. Can be ``NULL`` if ``parents_length`` is 0.\n@param parents_length The number of parents.\nNote this the number of elements in the corresponding ``tsk_id`` array\nnot the number of bytes.\n@param metadata The metadata to be associated with the new individual. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_individual_table_update_row(
self_: *mut tsk_individual_table_t,
index: tsk_id_t,
flags: tsk_flags_t,
location: *const f64,
location_length: tsk_size_t,
parents: *const tsk_id_t,
parents_length: tsk_size_t,
metadata: *const ::std::os::raw::c_char,
metadata_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Clears this table, setting the number of rows to zero.\n\n@rst\nNo memory is freed as a result of this operation; please use\n:c:func:`tsk_individual_table_free` to free the table's internal resources. Note that the\nmetadata schema is not cleared.\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_individual_table_clear(self_: *mut tsk_individual_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Truncates this table so that only the first num_rows are retained.\n\n@param self A pointer to a tsk_individual_table_t object.\n@param num_rows The number of rows to retain in the table.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_individual_table_truncate(
self_: *mut tsk_individual_table_t,
num_rows: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Extends this table by appending rows copied from another table.\n\n@rst\nAppends the rows at the specified indexes from the table ``other`` to the end of this\ntable. Row indexes can be repeated and in any order. If ``row_indexes`` is NULL, append\nthe first ``num_rows`` from ``other`` to this table. Note that metadata is copied as-is\nand is not checked for compatibility with any existing schema on this table.\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object where rows are to be added.\n@param other A pointer to a tsk_individual_table_t object where rows are copied from.\n@param num_rows The number of rows from ``other`` to append to this table.\n@param row_indexes Array of row indexes in ``other``. If ``NULL`` is passed then the\nfirst ``num_rows`` of ``other`` are used.\n@param options Bitwise option flags. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_individual_table_extend(
self_: *mut tsk_individual_table_t,
other: *const tsk_individual_table_t,
num_rows: tsk_size_t,
row_indexes: *const tsk_id_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Returns true if the data in the specified table is identical to the data\nin this table.\n\n@rst\n\nOptions**\n\nOptions to control the comparison can be specified by providing one or\nmore of the following bitwise flags. By default (options=0) tables are\nconsidered equal if they are byte-wise identical in all columns,\nand their metadata schemas are byte-wise identical.\n\n- :c:macro:`TSK_CMP_IGNORE_METADATA`\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param other A pointer to a tsk_individual_table_t object.\n@param options Bitwise comparison options.\n@return Return true if the specified table is equal to this table."]
pub fn tsk_individual_table_equals(
self_: *const tsk_individual_table_t,
other: *const tsk_individual_table_t,
options: tsk_flags_t,
) -> bool;
}
extern "C" {
#[doc = "@brief Copies the state of this table into the specified destination.\n\n@rst\nBy default the method initialises the specified destination table. If the\ndestination is already initialised, the :c:macro:`TSK_NO_INIT` option should\nbe supplied to avoid leaking memory.\n\nIndexes that are present are also copied to the destination table.\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param dest A pointer to a tsk_individual_table_t object. If the TSK_NO_INIT\noption is specified, this must be an initialised individual table. If not, it must be an\nuninitialised individual table.\n@param options Bitwise option flags.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_individual_table_copy(
self_: *const tsk_individual_table_t,
dest: *mut tsk_individual_table_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Get the row at the specified index.\n\n@rst\nUpdates the specified individual struct to reflect the values in the specified row.\nPointers to memory within this struct are handled by the table and should **not**\nbe freed by client code. These pointers are guaranteed to be valid until the\nnext operation that modifies the table (e.g., by adding a new row), but not afterwards.\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param index The requested table row.\n@param row A pointer to a tsk_individual_t struct that is updated to reflect the\nvalues in the specified row.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_individual_table_get_row(
self_: *const tsk_individual_table_t,
index: tsk_id_t,
row: *mut tsk_individual_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Set the metadata schema\n\n@rst\nCopies the metadata schema string to this table, replacing any existing.\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param metadata_schema A pointer to a char array.\n@param metadata_schema_length The size of the metadata schema in bytes.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_individual_table_set_metadata_schema(
self_: *mut tsk_individual_table_t,
metadata_schema: *const ::std::os::raw::c_char,
metadata_schema_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Print out the state of this table to the specified stream.\n\nThis method is intended for debugging purposes and should not be used\nin production code. The format of the output should **not** be depended\non and may change arbitrarily between versions.\n\n@param self A pointer to a tsk_individual_table_t object.\n@param out The stream to write the summary to."]
pub fn tsk_individual_table_print_state(self_: *const tsk_individual_table_t, out: *mut FILE);
}
extern "C" {
#[doc = "@brief Replace this table's data by copying from a set of column arrays\n\n@rst\nClears the data columns of this table and then copies column data from the specified\nset of arrays. The supplied arrays should all contain data on the same number of rows.\nThe metadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param flags The array of tsk_flag_t flag values to be copied.\n@param location The array of double location values to be copied.\n@param location_offset The array of tsk_size_t location offset values to be copied.\n@param parents The array of tsk_id_t parent values to be copied.\n@param parents_offset The array of tsk_size_t parent offset values to be copied.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_individual_table_set_columns(
self_: *mut tsk_individual_table_t,
num_rows: tsk_size_t,
flags: *const tsk_flags_t,
location: *const f64,
location_offset: *const tsk_size_t,
parents: *const tsk_id_t,
parents_offset: *const tsk_size_t,
metadata: *const ::std::os::raw::c_char,
metadata_offset: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Extends this table by copying from a set of column arrays\n\n@rst\nCopies column data from the specified set of arrays to create new rows at the end of the\ntable. The supplied arrays should all contain data on the same number of rows. The\nmetadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays\n@param flags The array of tsk_flag_t flag values to be copied.\n@param location The array of double location values to be copied.\n@param location_offset The array of tsk_size_t location offset values to be copied.\n@param parents The array of tsk_id_t parent values to be copied.\n@param parents_offset The array of tsk_size_t parent offset values to be copied.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_individual_table_append_columns(
self_: *mut tsk_individual_table_t,
num_rows: tsk_size_t,
flags: *const tsk_flags_t,
location: *const f64,
location_offset: *const tsk_size_t,
parents: *const tsk_id_t,
parents_offset: *const tsk_size_t,
metadata: *const ::std::os::raw::c_char,
metadata_offset: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Controls the pre-allocation strategy for this table\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param max_rows_increment The number of rows to pre-allocate, or zero for the default\ndoubling strategy.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_individual_table_set_max_rows_increment(
self_: *mut tsk_individual_table_t,
max_rows_increment: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Controls the pre-allocation strategy for the metadata column\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param max_metadata_length_increment The number of bytes to pre-allocate, or zero for\nthe default doubling strategy.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_individual_table_set_max_metadata_length_increment(
self_: *mut tsk_individual_table_t,
max_metadata_length_increment: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Controls the pre-allocation strategy for the location column\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param max_location_length_increment The number of bytes to pre-allocate, or zero for\nthe default doubling strategy.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_individual_table_set_max_location_length_increment(
self_: *mut tsk_individual_table_t,
max_location_length_increment: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Controls the pre-allocation strategy for the parents column\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param max_parents_length_increment The number of bytes to pre-allocate, or zero for\nthe default doubling strategy.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_individual_table_set_max_parents_length_increment(
self_: *mut tsk_individual_table_t,
max_parents_length_increment: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = " @}"]
pub fn tsk_individual_table_dump_text(
self_: *const tsk_individual_table_t,
out: *mut FILE,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Initialises the table by allocating the internal memory.\n\n@rst\nThis must be called before any operations are performed on the table.\nSee the :ref:`sec_c_api_overview_structure` for details on how objects\nare initialised and freed.\n@endrst\n\n@param self A pointer to an uninitialised tsk_node_table_t object.\n@param options Allocation time options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_node_table_init(
self_: *mut tsk_node_table_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Free the internal memory for the specified table.\n\n@param self A pointer to an initialised tsk_node_table_t object.\n@return Always returns 0."]
pub fn tsk_node_table_free(self_: *mut tsk_node_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Adds a row to this node table.\n\n@rst\nAdd a new node with the specified ``flags``, ``time``, ``population``,\n``individual`` and ``metadata`` to the table. A copy of the ``metadata`` parameter\nis taken immediately. See the :ref:`table definition <sec_node_table_definition>`\nfor details of the columns in this table.\n@endrst\n\n@param self A pointer to a tsk_node_table_t object.\n@param flags The bitwise flags for the new node.\n@param time The time for the new node.\n@param population The population for the new node. Set to TSK_NULL if not\nknown.\n@param individual The individual for the new node. Set to TSK_NULL if not\nknown.\n@param metadata The metadata to be associated with the new node. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n@return Return the ID of the newly added node on success,\nor a negative value on failure."]
pub fn tsk_node_table_add_row(
self_: *mut tsk_node_table_t,
flags: tsk_flags_t,
time: f64,
population: tsk_id_t,
individual: tsk_id_t,
metadata: *const ::std::os::raw::c_char,
metadata_length: tsk_size_t,
) -> tsk_id_t;
}
extern "C" {
#[doc = "@brief Updates the row at the specified index.\n\n@rst\nRewrite the row at the specified index in this table to use the specified\nvalues. A copy of the ``metadata`` parameter is taken immediately. See the\n:ref:`table definition <sec_node_table_definition>` for details of the columns\nin this table.\n\n.. warning::\nBecause of the way that ragged columns are encoded, this method requires a\nfull rewrite of the internal column memory in worst case, and would\ntherefore be inefficient for bulk updates for such columns. However, if the\nsizes of all ragged column values are unchanged in the updated row, this\nmethod is guaranteed to only update the memory for the row in question.\n@endrst\n\n@param self A pointer to a tsk_node_table_t object.\n@param index The row to update.\n@param flags The bitwise flags for the node.\n@param time The time for the node.\n@param population The population for the node. Set to TSK_NULL if not known.\n@param individual The individual for the node. Set to TSK_NULL if not known.\n@param metadata The metadata to be associated with the node. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_node_table_update_row(
self_: *mut tsk_node_table_t,
index: tsk_id_t,
flags: tsk_flags_t,
time: f64,
population: tsk_id_t,
individual: tsk_id_t,
metadata: *const ::std::os::raw::c_char,
metadata_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Clears this table, setting the number of rows to zero.\n\n@rst\nNo memory is freed as a result of this operation; please use\n:c:func:`tsk_node_table_free` to free the table's internal resources. Note that the\nmetadata schema is not cleared.\n@endrst\n\n@param self A pointer to a tsk_node_table_t object.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_node_table_clear(self_: *mut tsk_node_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Truncates this table so that only the first num_rows are retained.\n\n@param self A pointer to a tsk_node_table_t object.\n@param num_rows The number of rows to retain in the table.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_node_table_truncate(
self_: *mut tsk_node_table_t,
num_rows: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Extends this table by appending rows copied from another table.\n\n@rst\nAppends the rows at the specified indexes from the table ``other`` to the end of this\ntable. Row indexes can be repeated and in any order. If ``row_indexes`` is NULL, append\nthe first ``num_rows`` from ``other`` to this table. Note that metadata is copied as-is\nand is not checked for compatibility with any existing schema on this table.\n@endrst\n\n@param self A pointer to a tsk_node_table_t object where rows are to be added.\n@param other A pointer to a tsk_node_table_t object where rows are copied from.\n@param num_rows The number of rows from ``other`` to append to this table.\n@param row_indexes Array of row indexes in ``other``. If ``NULL`` is passed then the\nfirst ``num_rows`` of ``other`` are used.\n@param options Bitwise option flags. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_node_table_extend(
self_: *mut tsk_node_table_t,
other: *const tsk_node_table_t,
num_rows: tsk_size_t,
row_indexes: *const tsk_id_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Returns true if the data in the specified table is identical to the data\nin this table.\n\n@rst\n\nOptions**\n\nOptions to control the comparison can be specified by providing one or\nmore of the following bitwise flags. By default (options=0) tables are\nconsidered equal if they are byte-wise identical in all columns,\nand their metadata schemas are byte-wise identical.\n\n- :c:macro:`TSK_CMP_IGNORE_METADATA`\n@endrst\n\n@param self A pointer to a tsk_node_table_t object.\n@param other A pointer to a tsk_node_table_t object.\n@param options Bitwise comparison options.\n@return Return true if the specified table is equal to this table."]
pub fn tsk_node_table_equals(
self_: *const tsk_node_table_t,
other: *const tsk_node_table_t,
options: tsk_flags_t,
) -> bool;
}
extern "C" {
#[doc = "@brief Copies the state of this table into the specified destination.\n\n@rst\nBy default the method initialises the specified destination table. If the\ndestination is already initialised, the TSK_NO_INIT option should\nbe supplied to avoid leaking memory.\n@endrst\n\n@param self A pointer to a tsk_node_table_t object.\n@param dest A pointer to a tsk_node_table_t object. If the TSK_NO_INIT option\nis specified, this must be an initialised node table. If not, it must\nbe an uninitialised node table.\n@param options Bitwise option flags.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_node_table_copy(
self_: *const tsk_node_table_t,
dest: *mut tsk_node_table_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Get the row at the specified index.\n\n@rst\nUpdates the specified node struct to reflect the values in the specified row.\nPointers to memory within this struct are handled by the table and should **not**\nbe freed by client code. These pointers are guaranteed to be valid until the\nnext operation that modifies the table (e.g., by adding a new row), but not afterwards.\n@endrst\n\n@param self A pointer to a tsk_node_table_t object.\n@param index The requested table row.\n@param row A pointer to a tsk_node_t struct that is updated to reflect the\nvalues in the specified row.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_node_table_get_row(
self_: *const tsk_node_table_t,
index: tsk_id_t,
row: *mut tsk_node_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Set the metadata schema\n@rst\nCopies the metadata schema string to this table, replacing any existing.\n@endrst\n@param self A pointer to a tsk_node_table_t object.\n@param metadata_schema A pointer to a char array.\n@param metadata_schema_length The size of the metadata schema in bytes.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_node_table_set_metadata_schema(
self_: *mut tsk_node_table_t,
metadata_schema: *const ::std::os::raw::c_char,
metadata_schema_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Print out the state of this table to the specified stream.\n\nThis method is intended for debugging purposes and should not be used\nin production code. The format of the output should **not** be depended\non and may change arbitrarily between versions.\n\n@param self A pointer to a tsk_node_table_t object.\n@param out The stream to write the summary to."]
pub fn tsk_node_table_print_state(self_: *const tsk_node_table_t, out: *mut FILE);
}
extern "C" {
#[doc = "@brief Replace this table's data by copying from a set of column arrays\n\n@rst\nClears the data columns of this table and then copies column data from the specified\nset of arrays. The supplied arrays should all contain data on the same number of rows.\nThe metadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_node_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param flags The array of tsk_flag_t values to be copied.\n@param time The array of double time values to be copied.\n@param population The array of tsk_id_t population values to be copied.\n@param individual The array of tsk_id_t individual values to be copied.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_node_table_set_columns(
self_: *mut tsk_node_table_t,
num_rows: tsk_size_t,
flags: *const tsk_flags_t,
time: *const f64,
population: *const tsk_id_t,
individual: *const tsk_id_t,
metadata: *const ::std::os::raw::c_char,
metadata_offset: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Extends this table by copying from a set of column arrays\n\n@rst\nCopies column data from the specified set of arrays to create new rows at the end of the\ntable. The supplied arrays should all contain data on the same number of rows. The\nmetadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_node_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays\n@param flags The array of tsk_flag_t values to be copied.\n@param time The array of double time values to be copied.\n@param population The array of tsk_id_t population values to be copied.\n@param individual The array of tsk_id_t individual values to be copied.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_node_table_append_columns(
self_: *mut tsk_node_table_t,
num_rows: tsk_size_t,
flags: *const tsk_flags_t,
time: *const f64,
population: *const tsk_id_t,
individual: *const tsk_id_t,
metadata: *const ::std::os::raw::c_char,
metadata_offset: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Controls the pre-allocation strategy for this table\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_node_table_t object.\n@param max_rows_increment The number of rows to pre-allocate, or zero for the default\ndoubling strategy.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_node_table_set_max_rows_increment(
self_: *mut tsk_node_table_t,
max_rows_increment: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Controls the pre-allocation strategy for the metadata column\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_node_table_t object.\n@param max_metadata_length_increment The number of bytes to pre-allocate, or zero for\nthe default doubling strategy.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_node_table_set_max_metadata_length_increment(
self_: *mut tsk_node_table_t,
max_metadata_length_increment: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = " @}"]
pub fn tsk_node_table_dump_text(
self_: *const tsk_node_table_t,
out: *mut FILE,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Initialises the table by allocating the internal memory.\n\n@rst\nThis must be called before any operations are performed on the table.\nSee the :ref:`sec_c_api_overview_structure` for details on how objects\nare initialised and freed.\n\nOptions**\n\nOptions can be specified by providing one or more of the following bitwise\nflags:\n\n- :c:macro:`TSK_TABLE_NO_METADATA`\n@endrst\n\n@param self A pointer to an uninitialised tsk_edge_table_t object.\n@param options Allocation time options.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_edge_table_init(
self_: *mut tsk_edge_table_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Free the internal memory for the specified table.\n\n@param self A pointer to an initialised tsk_edge_table_t object.\n@return Always returns 0."]
pub fn tsk_edge_table_free(self_: *mut tsk_edge_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Adds a row to this edge table.\n\n@rst\nAdd a new edge with the specified ``left``, ``right``, ``parent``, ``child`` and\n``metadata`` to the table. See the :ref:`table definition <sec_edge_table_definition>`\nfor details of the columns in this table.\n@endrst\n\n@param self A pointer to a tsk_edge_table_t object.\n@param left The left coordinate for the new edge.\n@param right The right coordinate for the new edge.\n@param parent The parent node for the new edge.\n@param child The child node for the new edge.\n@param metadata The metadata to be associated with the new edge. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n\n@return Return the ID of the newly added edge on success,\nor a negative value on failure."]
pub fn tsk_edge_table_add_row(
self_: *mut tsk_edge_table_t,
left: f64,
right: f64,
parent: tsk_id_t,
child: tsk_id_t,
metadata: *const ::std::os::raw::c_char,
metadata_length: tsk_size_t,
) -> tsk_id_t;
}
extern "C" {
#[doc = "@brief Updates the row at the specified index.\n\n@rst\nRewrite the row at the specified index in this table to use the specified\nvalues. A copy of the ``metadata`` parameter is taken immediately. See the\n:ref:`table definition <sec_edge_table_definition>` for details of the columns\nin this table.\n\n.. warning::\nBecause of the way that ragged columns are encoded, this method requires a\nfull rewrite of the internal column memory in worst case, and would\ntherefore be inefficient for bulk updates for such columns. However, if the\nsizes of all ragged column values are unchanged in the updated row, this\nmethod is guaranteed to only update the memory for the row in question.\n@endrst\n\n@param self A pointer to a tsk_edge_table_t object.\n@param index The row to update.\n@param left The left coordinate for the edge.\n@param right The right coordinate for the edge.\n@param parent The parent node for the edge.\n@param child The child node for the edge.\n@param metadata The metadata to be associated with the edge. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_edge_table_update_row(
self_: *mut tsk_edge_table_t,
index: tsk_id_t,
left: f64,
right: f64,
parent: tsk_id_t,
child: tsk_id_t,
metadata: *const ::std::os::raw::c_char,
metadata_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Clears this table, setting the number of rows to zero.\n\n@rst\nNo memory is freed as a result of this operation; please use\n:c:func:`tsk_edge_table_free` to free the table's internal resources. Note that the\nmetadata schema is not cleared.\n@endrst\n\n@param self A pointer to a tsk_edge_table_t object.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_edge_table_clear(self_: *mut tsk_edge_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Truncates this table so that only the first num_rows are retained.\n\n@param self A pointer to a tsk_edge_table_t object.\n@param num_rows The number of rows to retain in the table.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_edge_table_truncate(
self_: *mut tsk_edge_table_t,
num_rows: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Extends this table by appending rows copied from another table.\n\n@rst\nAppends the rows at the specified indexes from the table ``other`` to the end of this\ntable. Row indexes can be repeated and in any order. If ``row_indexes`` is ``NULL``,\nappend the first ``num_rows`` from ``other`` to this table. Note that metadata is copied\nas-is and is not checked for compatibility with any existing schema on this table.\n@endrst\n\n@param self A pointer to a tsk_edge_table_t object where rows are to be added.\n@param other A pointer to a tsk_edge_table_t object where rows are copied from.\n@param num_rows The number of rows from ``other`` to append to this table.\n@param row_indexes Array of row indexes in ``other``. If ``NULL`` is passed then the\nfirst ``num_rows`` of ``other`` are used.\n@param options Bitwise option flags. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_edge_table_extend(
self_: *mut tsk_edge_table_t,
other: *const tsk_edge_table_t,
num_rows: tsk_size_t,
row_indexes: *const tsk_id_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Returns true if the data in the specified table is identical to the data\nin this table.\n\n@rst\n\nOptions**\n\nOptions to control the comparison can be specified by providing one or\nmore of the following bitwise flags. By default (options=0) tables are\nconsidered equal if they are byte-wise identical in all columns,\nand their metadata schemas are byte-wise identical.\n\n- :c:macro:`TSK_CMP_IGNORE_METADATA`\n@endrst\n\n@param self A pointer to a tsk_edge_table_t object.\n@param other A pointer to a tsk_edge_table_t object.\n@param options Bitwise comparison options.\n@return Return true if the specified table is equal to this table."]
pub fn tsk_edge_table_equals(
self_: *const tsk_edge_table_t,
other: *const tsk_edge_table_t,
options: tsk_flags_t,
) -> bool;
}
extern "C" {
#[doc = "@brief Copies the state of this table into the specified destination.\n\n@rst\nBy default the method initialises the specified destination table. If the\ndestination is already initialised, the :c:macro:`TSK_NO_INIT` option should\nbe supplied to avoid leaking memory.\n@endrst\n\n@param self A pointer to a tsk_edge_table_t object.\n@param dest A pointer to a tsk_edge_table_t object. If the TSK_NO_INIT option\nis specified, this must be an initialised edge table. If not, it must\nbe an uninitialised edge table.\n@param options Bitwise option flags.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_edge_table_copy(
self_: *const tsk_edge_table_t,
dest: *mut tsk_edge_table_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Get the row at the specified index.\n\n@rst\nUpdates the specified edge struct to reflect the values in the specified row.\nPointers to memory within this struct are handled by the table and should **not**\nbe freed by client code. These pointers are guaranteed to be valid until the\nnext operation that modifies the table (e.g., by adding a new row), but not afterwards.\n@endrst\n\n@param self A pointer to a tsk_edge_table_t object.\n@param index The requested table row.\n@param row A pointer to a tsk_edge_t struct that is updated to reflect the\nvalues in the specified row.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_edge_table_get_row(
self_: *const tsk_edge_table_t,
index: tsk_id_t,
row: *mut tsk_edge_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Set the metadata schema\n@rst\nCopies the metadata schema string to this table, replacing any existing.\n@endrst\n@param self A pointer to a tsk_edge_table_t object.\n@param metadata_schema A pointer to a char array\n@param metadata_schema_length The size of the metadata schema in bytes.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_edge_table_set_metadata_schema(
self_: *mut tsk_edge_table_t,
metadata_schema: *const ::std::os::raw::c_char,
metadata_schema_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Print out the state of this table to the specified stream.\n\nThis method is intended for debugging purposes and should not be used\nin production code. The format of the output should **not** be depended\non and may change arbitrarily between versions.\n\n@param self A pointer to a tsk_edge_table_t object.\n@param out The stream to write the summary to."]
pub fn tsk_edge_table_print_state(self_: *const tsk_edge_table_t, out: *mut FILE);
}
extern "C" {
#[doc = "@brief Replace this table's data by copying from a set of column arrays\n\n@rst\nClears the data columns of this table and then copies column data from the specified\nset of arrays. The supplied arrays should all contain data on the same number of rows.\nThe metadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_edge_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param left The array of double left values to be copied.\n@param right The array of double right values to be copied.\n@param parent The array of tsk_id_t parent values to be copied.\n@param child The array of tsk_id_t child values to be copied.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_edge_table_set_columns(
self_: *mut tsk_edge_table_t,
num_rows: tsk_size_t,
left: *const f64,
right: *const f64,
parent: *const tsk_id_t,
child: *const tsk_id_t,
metadata: *const ::std::os::raw::c_char,
metadata_offset: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Extends this table by copying from a set of column arrays\n\n@rst\nCopies column data from the specified set of arrays to create new rows at the end of the\ntable. The supplied arrays should all contain data on the same number of rows. The\nmetadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_edge_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param left The array of double left values to be copied.\n@param right The array of double right values to be copied.\n@param parent The array of tsk_id_t parent values to be copied.\n@param child The array of tsk_id_t child values to be copied.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied."]
pub fn tsk_edge_table_append_columns(
self_: *mut tsk_edge_table_t,
num_rows: tsk_size_t,
left: *const f64,
right: *const f64,
parent: *const tsk_id_t,
child: *const tsk_id_t,
metadata: *const ::std::os::raw::c_char,
metadata_offset: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Controls the pre-allocation strategy for this table\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_edge_table_t object.\n@param max_rows_increment The number of rows to pre-allocate, or zero for the default\ndoubling strategy.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_edge_table_set_max_rows_increment(
self_: *mut tsk_edge_table_t,
max_rows_increment: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Controls the pre-allocation strategy for the metadata column\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_edge_table_t object.\n@param max_metadata_length_increment The number of bytes to pre-allocate, or zero for\nthe default doubling strategy.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_edge_table_set_max_metadata_length_increment(
self_: *mut tsk_edge_table_t,
max_metadata_length_increment: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Squash adjacent edges in-place\n\n@rst\nSorts, then condenses the table into the smallest possible number of rows by\ncombining any adjacent edges. A pair of edges is said to be `adjacent` if\nthey have the same parent and child nodes, and if the left coordinate of\none of the edges is equal to the right coordinate of the other edge.\nThis process is performed in-place so that any set of adjacent edges is\nreplaced by a single edge. The new edge will have the same parent and child\nnode, a left coordinate equal to the smallest left coordinate in the set,\nand a right coordinate equal to the largest right coordinate in the set.\nThe new edge table will be sorted in the canonical order (P, C, L, R).\n\n.. note::\nNote that this method will fail if any edges have non-empty metadata.\n\n@endrst\n\n@param self A pointer to a tsk_edge_table_t object.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_edge_table_squash(self_: *mut tsk_edge_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = " @}"]
pub fn tsk_edge_table_dump_text(
self_: *const tsk_edge_table_t,
out: *mut FILE,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Initialises the table by allocating the internal memory.\n\n@rst\nThis must be called before any operations are performed on the table.\nSee the :ref:`sec_c_api_overview_structure` for details on how objects\nare initialised and freed.\n@endrst\n\n@param self A pointer to an uninitialised tsk_migration_table_t object.\n@param options Allocation time options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_migration_table_init(
self_: *mut tsk_migration_table_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Free the internal memory for the specified table.\n\n@param self A pointer to an initialised tsk_migration_table_t object.\n@return Always returns 0."]
pub fn tsk_migration_table_free(self_: *mut tsk_migration_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Adds a row to this migration table.\n\n@rst\nAdd a new migration with the specified ``left``, ``right``, ``node``,\n``source``, ``dest``, ``time`` and ``metadata`` to the table.\nSee the :ref:`table definition <sec_migration_table_definition>`\nfor details of the columns in this table.\n@endrst\n\n@param self A pointer to a tsk_migration_table_t object.\n@param left The left coordinate for the new migration.\n@param right The right coordinate for the new migration.\n@param node The node ID for the new migration.\n@param source The source population ID for the new migration.\n@param dest The destination population ID for the new migration.\n@param time The time for the new migration.\n@param metadata The metadata to be associated with the new migration. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n\n@return Return the ID of the newly added migration on success,\nor a negative value on failure."]
pub fn tsk_migration_table_add_row(
self_: *mut tsk_migration_table_t,
left: f64,
right: f64,
node: tsk_id_t,
source: tsk_id_t,
dest: tsk_id_t,
time: f64,
metadata: *const ::std::os::raw::c_char,
metadata_length: tsk_size_t,
) -> tsk_id_t;
}
extern "C" {
#[doc = "@brief Updates the row at the specified index.\n\n@rst\nRewrite the row at the specified index in this table to use the specified\nvalues. A copy of the ``metadata`` parameter is taken immediately. See the\n:ref:`table definition <sec_migration_table_definition>` for details of the columns\nin this table.\n\n.. warning::\nBecause of the way that ragged columns are encoded, this method requires a\nfull rewrite of the internal column memory in worst case, and would\ntherefore be inefficient for bulk updates for such columns. However, if the\nsizes of all ragged column values are unchanged in the updated row, this\nmethod is guaranteed to only update the memory for the row in question.\n@endrst\n\n@param self A pointer to a tsk_migration_table_t object.\n@param index The row to update.\n@param left The left coordinate for the migration.\n@param right The right coordinate for the migration.\n@param node The node ID for the migration.\n@param source The source population ID for the migration.\n@param dest The destination population ID for the migration.\n@param time The time for the migration.\n@param metadata The metadata to be associated with the migration. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_migration_table_update_row(
self_: *mut tsk_migration_table_t,
index: tsk_id_t,
left: f64,
right: f64,
node: tsk_id_t,
source: tsk_id_t,
dest: tsk_id_t,
time: f64,
metadata: *const ::std::os::raw::c_char,
metadata_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Clears this table, setting the number of rows to zero.\n\n@rst\nNo memory is freed as a result of this operation; please use\n:c:func:`tsk_migration_table_free` to free the table's internal resources. Note that the\nmetadata schema is not cleared.\n@endrst\n\n@param self A pointer to a tsk_migration_table_t object.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_migration_table_clear(self_: *mut tsk_migration_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Truncates this table so that only the first num_rows are retained.\n\n@param self A pointer to a tsk_migration_table_t object.\n@param num_rows The number of rows to retain in the table.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_migration_table_truncate(
self_: *mut tsk_migration_table_t,
num_rows: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Extends this table by appending rows copied from another table.\n\n@rst\nAppends the rows at the specified indexes from the table ``other`` to the end of this\ntable. Row indexes can be repeated and in any order. If ``row_indexes`` is NULL, append\nthe first ``num_rows`` from ``other`` to this table. Note that metadata is copied as-is\nand is not checked for compatibility with any existing schema on this table.\n@endrst\n\n@param self A pointer to a tsk_migration_table_t object where rows are to be added.\n@param other A pointer to a tsk_migration_table_t object where rows are copied from.\n@param num_rows The number of rows from ``other`` to append to this table.\n@param row_indexes Array of row indexes in ``other``. If ``NULL`` is passed then the\nfirst ``num_rows`` of ``other`` are used.\n@param options Bitwise option flags. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_migration_table_extend(
self_: *mut tsk_migration_table_t,
other: *const tsk_migration_table_t,
num_rows: tsk_size_t,
row_indexes: *const tsk_id_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Returns true if the data in the specified table is identical to the data\nin this table.\n\n@rst\n\nOptions**\n\nOptions to control the comparison can be specified by providing one or\nmore of the following bitwise flags. By default (options=0) tables are\nconsidered equal if they are byte-wise identical in all columns,\nand their metadata schemas are byte-wise identical.\n\n- :c:macro:`TSK_CMP_IGNORE_METADATA`\n@endrst\n\n@param self A pointer to a tsk_migration_table_t object.\n@param other A pointer to a tsk_migration_table_t object.\n@param options Bitwise comparison options.\n@return Return true if the specified table is equal to this table."]
pub fn tsk_migration_table_equals(
self_: *const tsk_migration_table_t,
other: *const tsk_migration_table_t,
options: tsk_flags_t,
) -> bool;
}
extern "C" {
#[doc = "@brief Copies the state of this table into the specified destination.\n\n@rst\nBy default the method initialises the specified destination table. If the\ndestination is already initialised, the :c:macro:`TSK_NO_INIT` option should\nbe supplied to avoid leaking memory.\n@endrst\n\n@param self A pointer to a tsk_migration_table_t object.\n@param dest A pointer to a tsk_migration_table_t object. If the TSK_NO_INIT\noption is specified, this must be an initialised migration table. If not, it must be an\nuninitialised migration table.\n@param options Bitwise option flags.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_migration_table_copy(
self_: *const tsk_migration_table_t,
dest: *mut tsk_migration_table_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Get the row at the specified index.\n\n@rst\nUpdates the specified migration struct to reflect the values in the specified row.\nPointers to memory within this struct are handled by the table and should **not**\nbe freed by client code. These pointers are guaranteed to be valid until the\nnext operation that modifies the table (e.g., by adding a new row), but not afterwards.\n@endrst\n\n@param self A pointer to a tsk_migration_table_t object.\n@param index The requested table row.\n@param row A pointer to a tsk_migration_t struct that is updated to reflect the\nvalues in the specified row.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_migration_table_get_row(
self_: *const tsk_migration_table_t,
index: tsk_id_t,
row: *mut tsk_migration_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Set the metadata schema\n@rst\nCopies the metadata schema string to this table, replacing any existing.\n@endrst\n@param self A pointer to a tsk_migration_table_t object.\n@param metadata_schema A pointer to a char array.\n@param metadata_schema_length The size of the metadata schema in bytes.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_migration_table_set_metadata_schema(
self_: *mut tsk_migration_table_t,
metadata_schema: *const ::std::os::raw::c_char,
metadata_schema_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Print out the state of this table to the specified stream.\n\nThis method is intended for debugging purposes and should not be used\nin production code. The format of the output should **not** be depended\non and may change arbitrarily between versions.\n\n@param self A pointer to a tsk_migration_table_t object.\n@param out The stream to write the summary to."]
pub fn tsk_migration_table_print_state(self_: *const tsk_migration_table_t, out: *mut FILE);
}
extern "C" {
#[doc = "@brief Replace this table's data by copying from a set of column arrays\n\n@rst\nClears the data columns of this table and then copies column data from the specified\nset of arrays. The supplied arrays should all contain data on the same number of rows.\nThe metadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_migration_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param left The array of double left values to be copied.\n@param right The array of double right values to be copied.\n@param node The array of tsk_id_t node values to be copied.\n@param source The array of tsk_id_t source values to be copied.\n@param dest The array of tsk_id_t dest values to be copied.\n@param time The array of double time values to be copied.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_migration_table_set_columns(
self_: *mut tsk_migration_table_t,
num_rows: tsk_size_t,
left: *const f64,
right: *const f64,
node: *const tsk_id_t,
source: *const tsk_id_t,
dest: *const tsk_id_t,
time: *const f64,
metadata: *const ::std::os::raw::c_char,
metadata_offset: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Extends this table by copying from a set of column arrays\n\n@rst\nCopies column data from the specified set of arrays to create new rows at the end of the\ntable. The supplied arrays should all contain data on the same number of rows. The\nmetadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_migration_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays\n@param left The array of double left values to be copied.\n@param right The array of double right values to be copied.\n@param node The array of tsk_id_t node values to be copied.\n@param source The array of tsk_id_t source values to be copied.\n@param dest The array of tsk_id_t dest values to be copied.\n@param time The array of double time values to be copied.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_migration_table_append_columns(
self_: *mut tsk_migration_table_t,
num_rows: tsk_size_t,
left: *const f64,
right: *const f64,
node: *const tsk_id_t,
source: *const tsk_id_t,
dest: *const tsk_id_t,
time: *const f64,
metadata: *const ::std::os::raw::c_char,
metadata_offset: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Controls the pre-allocation strategy for this table\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_migration_table_t object.\n@param max_rows_increment The number of rows to pre-allocate, or zero for the default\ndoubling strategy.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_migration_table_set_max_rows_increment(
self_: *mut tsk_migration_table_t,
max_rows_increment: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Controls the pre-allocation strategy for the metadata column\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_migration_table_t object.\n@param max_metadata_length_increment The number of bytes to pre-allocate, or zero for\nthe default doubling strategy.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_migration_table_set_max_metadata_length_increment(
self_: *mut tsk_migration_table_t,
max_metadata_length_increment: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = " @}"]
pub fn tsk_migration_table_dump_text(
self_: *const tsk_migration_table_t,
out: *mut FILE,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Initialises the table by allocating the internal memory.\n\n@rst\nThis must be called before any operations are performed on the table.\nSee the :ref:`sec_c_api_overview_structure` for details on how objects\nare initialised and freed.\n@endrst\n\n@param self A pointer to an uninitialised tsk_site_table_t object.\n@param options Allocation time options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_site_table_init(
self_: *mut tsk_site_table_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Free the internal memory for the specified table.\n\n@param self A pointer to an initialised tsk_site_table_t object.\n@return Always returns 0."]
pub fn tsk_site_table_free(self_: *mut tsk_site_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Adds a row to this site table.\n\n@rst\nAdd a new site with the specified ``position``, ``ancestral_state``\nand ``metadata`` to the table. Copies of ``ancestral_state`` and ``metadata``\nare immediately taken. See the :ref:`table definition <sec_site_table_definition>`\nfor details of the columns in this table.\n@endrst\n\n@param self A pointer to a tsk_site_table_t object.\n@param position The position coordinate for the new site.\n@param ancestral_state The ancestral_state for the new site.\n@param ancestral_state_length The length of the ancestral_state in bytes.\n@param metadata The metadata to be associated with the new site. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n@return Return the ID of the newly added site on success,\nor a negative value on failure."]
pub fn tsk_site_table_add_row(
self_: *mut tsk_site_table_t,
position: f64,
ancestral_state: *const ::std::os::raw::c_char,
ancestral_state_length: tsk_size_t,
metadata: *const ::std::os::raw::c_char,
metadata_length: tsk_size_t,
) -> tsk_id_t;
}
extern "C" {
#[doc = "@brief Updates the row at the specified index.\n\n@rst\nRewrite the row at the specified index in this table to use the specified\nvalues. Copies of the ``ancestral_state`` and ``metadata`` parameters are taken\nimmediately. See the :ref:`table definition <sec_site_table_definition>` for\ndetails of the columns in this table.\n\n.. warning::\nBecause of the way that ragged columns are encoded, this method requires a\nfull rewrite of the internal column memory in worst case, and would\ntherefore be inefficient for bulk updates for such columns. However, if the\nsizes of all ragged column values are unchanged in the updated row, this\nmethod is guaranteed to only update the memory for the row in question.\n@endrst\n\n@param self A pointer to a tsk_site_table_t object.\n@param index The row to update.\n@param position The position coordinate for the site.\n@param ancestral_state The ancestral_state for the site.\n@param ancestral_state_length The length of the ancestral_state in bytes.\n@param metadata The metadata to be associated with the site. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_site_table_update_row(
self_: *mut tsk_site_table_t,
index: tsk_id_t,
position: f64,
ancestral_state: *const ::std::os::raw::c_char,
ancestral_state_length: tsk_size_t,
metadata: *const ::std::os::raw::c_char,
metadata_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Clears this table, setting the number of rows to zero.\n\n@rst\nNo memory is freed as a result of this operation; please use\n:c:func:`tsk_site_table_free` to free the table's internal resources. Note that the\nmetadata schema is not cleared.\n@endrst\n\n@param self A pointer to a tsk_site_table_t object.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_site_table_clear(self_: *mut tsk_site_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Truncates this table so that only the first num_rows are retained.\n\n@param self A pointer to a tsk_site_table_t object.\n@param num_rows The number of rows to retain in the table.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_site_table_truncate(
self_: *mut tsk_site_table_t,
num_rows: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Extends this table by appending rows copied from another table.\n\n@rst\nAppends the rows at the specified indexes from the table ``other`` to the end of this\ntable. Row indexes can be repeated and in any order. If ``row_indexes`` is NULL, append\nthe first ``num_rows`` from ``other`` to this table. Note that metadata is copied as-is\nand is not checked for compatibility with any existing schema on this table.\n@endrst\n\n@param self A pointer to a tsk_site_table_t object where rows are to be added.\n@param other A pointer to a tsk_site_table_t object where rows are copied from.\n@param num_rows The number of rows from ``other`` to append to this table.\n@param row_indexes Array of row indexes in ``other``. If ``NULL`` is passed then the\nfirst ``num_rows`` of ``other`` are used.\n@param options Bitwise option flags. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_site_table_extend(
self_: *mut tsk_site_table_t,
other: *const tsk_site_table_t,
num_rows: tsk_size_t,
row_indexes: *const tsk_id_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Returns true if the data in the specified table is identical to the data\nin this table.\n\n@rst\n\nOptions**\n\nOptions to control the comparison can be specified by providing one or\nmore of the following bitwise flags. By default (options=0) tables are\nconsidered equal if they are byte-wise identical in all columns,\nand their metadata schemas are byte-wise identical.\n\n- :c:macro:`TSK_CMP_IGNORE_METADATA`\n@endrst\n\n@param self A pointer to a tsk_site_table_t object.\n@param other A pointer to a tsk_site_table_t object.\n@param options Bitwise comparison options.\n@return Return true if the specified table is equal to this table."]
pub fn tsk_site_table_equals(
self_: *const tsk_site_table_t,
other: *const tsk_site_table_t,
options: tsk_flags_t,
) -> bool;
}
extern "C" {
#[doc = "@brief Copies the state of this table into the specified destination.\n\n@rst\nBy default the method initialises the specified destination table. If the\ndestination is already initialised, the :c:macro:`TSK_NO_INIT` option should\nbe supplied to avoid leaking memory.\n@endrst\n\n@param self A pointer to a tsk_site_table_t object.\n@param dest A pointer to a tsk_site_table_t object. If the TSK_NO_INIT option\nis specified, this must be an initialised site table. If not, it must\nbe an uninitialised site table.\n@param options Bitwise option flags.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_site_table_copy(
self_: *const tsk_site_table_t,
dest: *mut tsk_site_table_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Get the row at the specified index.\n\n@rst\nUpdates the specified site struct to reflect the values in the specified row.\n\nThis function always sets the ``mutations`` and ``mutations_length``\nfields in the parameter :c:struct:`tsk_site_t` to ``NULL`` and ``0`` respectively.\nTo get access to the mutations for a particular site, please use the\ntree sequence method, :c:func:`tsk_treeseq_get_site`.\n\nPointers to memory within this struct are handled by the table and should **not**\nbe freed by client code. These pointers are guaranteed to be valid until the\nnext operation that modifies the table (e.g., by adding a new row), but not afterwards.\n@endrst\n\n@param self A pointer to a tsk_site_table_t object.\n@param index The requested table row.\n@param row A pointer to a tsk_site_t struct that is updated to reflect the\nvalues in the specified row.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_site_table_get_row(
self_: *const tsk_site_table_t,
index: tsk_id_t,
row: *mut tsk_site_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Set the metadata schema\n@rst\nCopies the metadata schema string to this table, replacing any existing.\n@endrst\n@param self A pointer to a tsk_site_table_t object.\n@param metadata_schema A pointer to a char array.\n@param metadata_schema_length The size of the metadata schema in bytes.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_site_table_set_metadata_schema(
self_: *mut tsk_site_table_t,
metadata_schema: *const ::std::os::raw::c_char,
metadata_schema_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Print out the state of this table to the specified stream.\n\nThis method is intended for debugging purposes and should not be used\nin production code. The format of the output should **not** be depended\non and may change arbitrarily between versions.\n\n@param self A pointer to a tsk_site_table_t object.\n@param out The stream to write the summary to."]
pub fn tsk_site_table_print_state(self_: *const tsk_site_table_t, out: *mut FILE);
}
extern "C" {
#[doc = "@brief Replace this table's data by copying from a set of column arrays\n\n@rst\nClears the data columns of this table and then copies column data from the specified\nset of arrays. The supplied arrays should all contain data on the same number of rows.\nThe metadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_site_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param position The array of double position values to be copied.\n@param ancestral_state The array of char ancestral state values to be copied.\n@param ancestral_state_offset The array of tsk_size_t ancestral state offset values to be\ncopied.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_site_table_set_columns(
self_: *mut tsk_site_table_t,
num_rows: tsk_size_t,
position: *const f64,
ancestral_state: *const ::std::os::raw::c_char,
ancestral_state_offset: *const tsk_size_t,
metadata: *const ::std::os::raw::c_char,
metadata_offset: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Extends this table by copying from a set of column arrays\n\n@rst\nCopies column data from the specified set of arrays to create new rows at the end of the\ntable. The supplied arrays should all contain data on the same number of rows. The\nmetadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_site_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param position The array of double position values to be copied.\n@param ancestral_state The array of char ancestral state values to be copied.\n@param ancestral_state_offset The array of tsk_size_t ancestral state offset values to be\ncopied.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_site_table_append_columns(
self_: *mut tsk_site_table_t,
num_rows: tsk_size_t,
position: *const f64,
ancestral_state: *const ::std::os::raw::c_char,
ancestral_state_offset: *const tsk_size_t,
metadata: *const ::std::os::raw::c_char,
metadata_offset: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Controls the pre-allocation strategy for this table\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_site_table_t object.\n@param max_rows_increment The number of rows to pre-allocate, or zero for the default\ndoubling strategy.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_site_table_set_max_rows_increment(
self_: *mut tsk_site_table_t,
max_rows_increment: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Controls the pre-allocation strategy for the metadata column\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_site_table_t object.\n@param max_metadata_length_increment The number of bytes to pre-allocate, or zero for\nthe default doubling strategy.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_site_table_set_max_metadata_length_increment(
self_: *mut tsk_site_table_t,
max_metadata_length_increment: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Controls the pre-allocation strategy for the ancestral_state column\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_site_table_t object.\n@param max_ancestral_state_length_increment The number of bytes to pre-allocate, or zero\nfor the default doubling strategy.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_site_table_set_max_ancestral_state_length_increment(
self_: *mut tsk_site_table_t,
max_ancestral_state_length_increment: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = " @}"]
pub fn tsk_site_table_dump_text(
self_: *const tsk_site_table_t,
out: *mut FILE,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Initialises the table by allocating the internal memory.\n\n@rst\nThis must be called before any operations are performed on the table.\nSee the :ref:`sec_c_api_overview_structure` for details on how objects\nare initialised and freed.\n@endrst\n\n@param self A pointer to an uninitialised tsk_mutation_table_t object.\n@param options Allocation time options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_mutation_table_init(
self_: *mut tsk_mutation_table_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Free the internal memory for the specified table.\n\n@param self A pointer to an initialised tsk_mutation_table_t object.\n@return Always returns 0."]
pub fn tsk_mutation_table_free(self_: *mut tsk_mutation_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Adds a row to this mutation table.\n\n@rst\nAdd a new mutation with the specified ``site``, ``parent``, ``derived_state``\nand ``metadata`` to the table. Copies of ``derived_state`` and ``metadata``\nare immediately taken. See the :ref:`table definition <sec_mutation_table_definition>`\nfor details of the columns in this table.\n@endrst\n\n@param self A pointer to a tsk_mutation_table_t object.\n@param site The site ID for the new mutation.\n@param node The ID of the node this mutation occurs over.\n@param parent The ID of the parent mutation.\n@param time The time of the mutation.\n@param derived_state The derived_state for the new mutation.\n@param derived_state_length The length of the derived_state in bytes.\n@param metadata The metadata to be associated with the new mutation. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n@return Return the ID of the newly added mutation on success,\nor a negative value on failure."]
pub fn tsk_mutation_table_add_row(
self_: *mut tsk_mutation_table_t,
site: tsk_id_t,
node: tsk_id_t,
parent: tsk_id_t,
time: f64,
derived_state: *const ::std::os::raw::c_char,
derived_state_length: tsk_size_t,
metadata: *const ::std::os::raw::c_char,
metadata_length: tsk_size_t,
) -> tsk_id_t;
}
extern "C" {
#[doc = "@brief Updates the row at the specified index.\n\n@rst\nRewrite the row at the specified index in this table to use the specified\nvalues. Copies of the ``derived_state`` and ``metadata`` parameters are taken\nimmediately. See the :ref:`table definition <sec_mutation_table_definition>` for\ndetails of the columns in this table.\n\n.. warning::\nBecause of the way that ragged columns are encoded, this method requires a\nfull rewrite of the internal column memory in worst case, and would\ntherefore be inefficient for bulk updates for such columns. However, if the\nsizes of all ragged column values are unchanged in the updated row, this\nmethod is guaranteed to only update the memory for the row in question.\n@endrst\n\n@param self A pointer to a tsk_mutation_table_t object.\n@param index The row to update.\n@param site The site ID for the mutation.\n@param node The ID of the node this mutation occurs over.\n@param parent The ID of the parent mutation.\n@param time The time of the mutation.\n@param derived_state The derived_state for the mutation.\n@param derived_state_length The length of the derived_state in bytes.\n@param metadata The metadata to be associated with the mutation. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_mutation_table_update_row(
self_: *mut tsk_mutation_table_t,
index: tsk_id_t,
site: tsk_id_t,
node: tsk_id_t,
parent: tsk_id_t,
time: f64,
derived_state: *const ::std::os::raw::c_char,
derived_state_length: tsk_size_t,
metadata: *const ::std::os::raw::c_char,
metadata_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Clears this table, setting the number of rows to zero.\n\n@rst\nNo memory is freed as a result of this operation; please use\n:c:func:`tsk_mutation_table_free` to free the table's internal resources. Note that the\nmetadata schema is not cleared.\n@endrst\n\n@param self A pointer to a tsk_mutation_table_t object.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_mutation_table_clear(self_: *mut tsk_mutation_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Truncates this table so that only the first num_rows are retained.\n\n@param self A pointer to a tsk_mutation_table_t object.\n@param num_rows The number of rows to retain in the table.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_mutation_table_truncate(
self_: *mut tsk_mutation_table_t,
num_rows: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Extends this table by appending rows copied from another table.\n\n@rst\nAppends the rows at the specified indexes from the table ``other`` to the end of this\ntable. Row indexes can be repeated and in any order. If ``row_indexes`` is NULL, append\nthe first ``num_rows`` from ``other`` to this table. Note that metadata is copied as-is\nand is not checked for compatibility with any existing schema on this table.\n@endrst\n\n@param self A pointer to a tsk_mutation_table_t object where rows are to be added.\n@param other A pointer to a tsk_mutation_table_t object where rows are copied from.\n@param num_rows The number of rows from ``other`` to append to this table.\n@param row_indexes Array of row indexes in ``other``. If ``NULL`` is passed then the\nfirst ``num_rows`` of ``other`` are used.\n@param options Bitwise option flags. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_mutation_table_extend(
self_: *mut tsk_mutation_table_t,
other: *const tsk_mutation_table_t,
num_rows: tsk_size_t,
row_indexes: *const tsk_id_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Returns true if the data in the specified table is identical to the data\nin this table.\n\n@rst\n\nOptions**\n\nOptions to control the comparison can be specified by providing one or\nmore of the following bitwise flags. By default (options=0) tables are\nconsidered equal if they are byte-wise identical in all columns,\nand their metadata schemas are byte-wise identical.\n\n- :c:macro:`TSK_CMP_IGNORE_METADATA`\n@endrst\n\n@param self A pointer to a tsk_mutation_table_t object.\n@param other A pointer to a tsk_mutation_table_t object.\n@param options Bitwise comparison options.\n@return Return true if the specified table is equal to this table."]
pub fn tsk_mutation_table_equals(
self_: *const tsk_mutation_table_t,
other: *const tsk_mutation_table_t,
options: tsk_flags_t,
) -> bool;
}
extern "C" {
#[doc = "@brief Copies the state of this table into the specified destination.\n\n@rst\nBy default the method initialises the specified destination table. If the\ndestination is already initialised, the :c:macro:`TSK_NO_INIT` option should\nbe supplied to avoid leaking memory.\n@endrst\n\n@param self A pointer to a tsk_mutation_table_t object.\n@param dest A pointer to a tsk_mutation_table_t object. If the TSK_NO_INIT\noption is specified, this must be an initialised mutation table. If not, it must be an\nuninitialised mutation table.\n@param options Bitwise option flags.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_mutation_table_copy(
self_: *const tsk_mutation_table_t,
dest: *mut tsk_mutation_table_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Get the row at the specified index.\n\n@rst\nUpdates the specified mutation struct to reflect the values in the specified row.\n\nThis function always sets the ``edge`` field in parameter\n:c:struct:`tsk_mutation_t` to ``TSK_NULL``. To determine the ID of\nthe edge associated with a particular mutation, please use the\ntree sequence method, :c:func:`tsk_treeseq_get_mutation`.\n\nPointers to memory within this struct are handled by the table and should **not**\nbe freed by client code. These pointers are guaranteed to be valid until the\nnext operation that modifies the table (e.g., by adding a new row), but not afterwards.\n@endrst\n\n@param self A pointer to a tsk_mutation_table_t object.\n@param index The requested table row.\n@param row A pointer to a tsk_mutation_t struct that is updated to reflect the\nvalues in the specified row.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_mutation_table_get_row(
self_: *const tsk_mutation_table_t,
index: tsk_id_t,
row: *mut tsk_mutation_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Set the metadata schema\n@rst\nCopies the metadata schema string to this table, replacing any existing.\n@endrst\n@param self A pointer to a tsk_mutation_table_t object.\n@param metadata_schema A pointer to a char array.\n@param metadata_schema_length The size of the metadata schema in bytes.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_mutation_table_set_metadata_schema(
self_: *mut tsk_mutation_table_t,
metadata_schema: *const ::std::os::raw::c_char,
metadata_schema_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Print out the state of this table to the specified stream.\n\nThis method is intended for debugging purposes and should not be used\nin production code. The format of the output should **not** be depended\non and may change arbitrarily between versions.\n\n@param self A pointer to a tsk_mutation_table_t object.\n@param out The stream to write the summary to."]
pub fn tsk_mutation_table_print_state(self_: *const tsk_mutation_table_t, out: *mut FILE);
}
extern "C" {
#[doc = "@brief Replace this table's data by copying from a set of column arrays\n\n@rst\nClears the data columns of this table and then copies column data from the specified\nset of arrays. The supplied arrays should all contain data on the same number of rows.\nThe metadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_mutation_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param site The array of tsk_id_t site values to be copied.\n@param node The array of tsk_id_t node values to be copied.\n@param parent The array of tsk_id_t parent values to be copied.\n@param time The array of double time values to be copied.\n@param derived_state The array of char derived_state values to be copied.\n@param derived_state_offset The array of tsk_size_t derived state offset values to be\ncopied.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_mutation_table_set_columns(
self_: *mut tsk_mutation_table_t,
num_rows: tsk_size_t,
site: *const tsk_id_t,
node: *const tsk_id_t,
parent: *const tsk_id_t,
time: *const f64,
derived_state: *const ::std::os::raw::c_char,
derived_state_offset: *const tsk_size_t,
metadata: *const ::std::os::raw::c_char,
metadata_offset: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Extends this table by copying from a set of column arrays\n\n@rst\nCopies column data from the specified set of arrays to create new rows at the end of the\ntable. The supplied arrays should all contain data on the same number of rows. The\nmetadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_mutation_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param site The array of tsk_id_t site values to be copied.\n@param node The array of tsk_id_t node values to be copied.\n@param parent The array of tsk_id_t parent values to be copied.\n@param time The array of double time values to be copied.\n@param derived_state The array of char derived_state values to be copied.\n@param derived_state_offset The array of tsk_size_t derived state offset values to be\ncopied.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_mutation_table_append_columns(
self_: *mut tsk_mutation_table_t,
num_rows: tsk_size_t,
site: *const tsk_id_t,
node: *const tsk_id_t,
parent: *const tsk_id_t,
time: *const f64,
derived_state: *const ::std::os::raw::c_char,
derived_state_offset: *const tsk_size_t,
metadata: *const ::std::os::raw::c_char,
metadata_offset: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Controls the pre-allocation strategy for this table\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_mutation_table_t object.\n@param max_rows_increment The number of rows to pre-allocate, or zero for the default\ndoubling strategy.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_mutation_table_set_max_rows_increment(
self_: *mut tsk_mutation_table_t,
max_rows_increment: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Controls the pre-allocation strategy for the metadata column\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_mutation_table_t object.\n@param max_metadata_length_increment The number of bytes to pre-allocate, or zero for\nthe default doubling strategy.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_mutation_table_set_max_metadata_length_increment(
self_: *mut tsk_mutation_table_t,
max_metadata_length_increment: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Controls the pre-allocation strategy for the derived_state column\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_mutation_table_t object.\n@param max_derived_state_length_increment The number of bytes to pre-allocate, or zero\nfor the default doubling strategy.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_mutation_table_set_max_derived_state_length_increment(
self_: *mut tsk_mutation_table_t,
max_derived_state_length_increment: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = " @}"]
pub fn tsk_mutation_table_dump_text(
self_: *const tsk_mutation_table_t,
out: *mut FILE,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Initialises the table by allocating the internal memory.\n\n@rst\nThis must be called before any operations are performed on the table.\nSee the :ref:`sec_c_api_overview_structure` for details on how objects\nare initialised and freed.\n@endrst\n\n@param self A pointer to an uninitialised tsk_population_table_t object.\n@param options Allocation time options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_population_table_init(
self_: *mut tsk_population_table_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Free the internal memory for the specified table.\n\n@param self A pointer to an initialised tsk_population_table_t object.\n@return Always returns 0."]
pub fn tsk_population_table_free(self_: *mut tsk_population_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Adds a row to this population table.\n\n@rst\nAdd a new population with the specified ``metadata`` to the table. A copy of the\n``metadata`` is immediately taken. See the :ref:`table definition\n<sec_population_table_definition>` for details of the columns in this table.\n@endrst\n\n@param self A pointer to a tsk_population_table_t object.\n@param metadata The metadata to be associated with the new population. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n@return Return the ID of the newly added population on success,\nor a negative value on failure."]
pub fn tsk_population_table_add_row(
self_: *mut tsk_population_table_t,
metadata: *const ::std::os::raw::c_char,
metadata_length: tsk_size_t,
) -> tsk_id_t;
}
extern "C" {
#[doc = "@brief Updates the row at the specified index.\n\n@rst\nRewrite the row at the specified index in this table to use the specified\nvalues. A copy of the ``metadata`` parameter is taken immediately. See the\n:ref:`table definition <sec_population_table_definition>` for details of the\ncolumns in this table.\n\n.. warning::\nBecause of the way that ragged columns are encoded, this method requires a\nfull rewrite of the internal column memory in worst case, and would\ntherefore be inefficient for bulk updates for such columns. However, if the\nsizes of all ragged column values are unchanged in the updated row, this\nmethod is guaranteed to only update the memory for the row in question.\n@endrst\n\n@param self A pointer to a tsk_population_table_t object.\n@param index The row to update.\n@param metadata The metadata to be associated with the population. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_population_table_update_row(
self_: *mut tsk_population_table_t,
index: tsk_id_t,
metadata: *const ::std::os::raw::c_char,
metadata_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Clears this table, setting the number of rows to zero.\n\n@rst\nNo memory is freed as a result of this operation; please use\n:c:func:`tsk_population_table_free` to free the table's internal resources. Note that the\nmetadata schema is not cleared.\n@endrst\n\n@param self A pointer to a tsk_population_table_t object.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_population_table_clear(self_: *mut tsk_population_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Truncates this table so that only the first num_rows are retained.\n\n@param self A pointer to a tsk_population_table_t object.\n@param num_rows The number of rows to retain in the table.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_population_table_truncate(
self_: *mut tsk_population_table_t,
num_rows: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Extends this table by appending rows copied from another table.\n\n@rst\nAppends the rows at the specified indexes from the table ``other`` to the end of this\ntable. Row indexes can be repeated and in any order. If ``row_indexes`` is NULL, append\nthe first ``num_rows`` from ``other`` to this table. Note that metadata is copied as-is\nand is not checked for compatibility with any existing schema on this table.\n@endrst\n\n@param self A pointer to a tsk_population_table_t object where rows are to be added.\n@param other A pointer to a tsk_population_table_t object where rows are copied from.\n@param num_rows The number of rows from ``other`` to append to this table.\n@param row_indexes Array of row indexes in ``other``. If ``NULL`` is passed then the\nfirst ``num_rows`` of ``other`` are used.\n@param options Bitwise option flags. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_population_table_extend(
self_: *mut tsk_population_table_t,
other: *const tsk_population_table_t,
num_rows: tsk_size_t,
row_indexes: *const tsk_id_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Returns true if the data in the specified table is identical to the data\nin this table.\n\n@rst\n\nOptions**\n\nOptions to control the comparison can be specified by providing one or\nmore of the following bitwise flags. By default (options=0) tables are\nconsidered equal if they are byte-wise identical in all columns,\nand their metadata schemas are byte-wise identical.\n\n- :c:macro:`TSK_CMP_IGNORE_METADATA`\nDo not include metadata in the comparison. Note that as metadata is the\nonly column in the population table, two population tables are considered\nequal if they have the same number of rows if this flag is specified.\n@endrst\n\n@param self A pointer to a tsk_population_table_t object.\n@param other A pointer to a tsk_population_table_t object.\n@param options Bitwise comparison options.\n@return Return true if the specified table is equal to this table."]
pub fn tsk_population_table_equals(
self_: *const tsk_population_table_t,
other: *const tsk_population_table_t,
options: tsk_flags_t,
) -> bool;
}
extern "C" {
#[doc = "@brief Copies the state of this table into the specified destination.\n\n@rst\nBy default the method initialises the specified destination table. If the\ndestination is already initialised, the :c:macro:`TSK_NO_INIT` option should\nbe supplied to avoid leaking memory.\n@endrst\n\n@param self A pointer to a tsk_population_table_t object.\n@param dest A pointer to a tsk_population_table_t object. If the TSK_NO_INIT\noption is specified, this must be an initialised population table. If not, it must be an\nuninitialised population table.\n@param options Bitwise option flags.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_population_table_copy(
self_: *const tsk_population_table_t,
dest: *mut tsk_population_table_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Get the row at the specified index.\n\n@rst\nUpdates the specified population struct to reflect the values in the specified row.\nPointers to memory within this struct are handled by the table and should **not**\nbe freed by client code. These pointers are guaranteed to be valid until the\nnext operation that modifies the table (e.g., by adding a new row), but not afterwards.\n@endrst\n\n@param self A pointer to a tsk_population_table_t object.\n@param index The requested table row.\n@param row A pointer to a tsk_population_t struct that is updated to reflect the\nvalues in the specified row.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_population_table_get_row(
self_: *const tsk_population_table_t,
index: tsk_id_t,
row: *mut tsk_population_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Set the metadata schema\n@rst\nCopies the metadata schema string to this table, replacing any existing.\n@endrst\n@param self A pointer to a tsk_population_table_t object.\n@param metadata_schema A pointer to a char array.\n@param metadata_schema_length The size of the metadata schema in bytes.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_population_table_set_metadata_schema(
self_: *mut tsk_population_table_t,
metadata_schema: *const ::std::os::raw::c_char,
metadata_schema_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Print out the state of this table to the specified stream.\n\nThis method is intended for debugging purposes and should not be used\nin production code. The format of the output should **not** be depended\non and may change arbitrarily between versions.\n\n@param self A pointer to a tsk_population_table_t object.\n@param out The stream to write the summary to."]
pub fn tsk_population_table_print_state(self_: *const tsk_population_table_t, out: *mut FILE);
}
extern "C" {
#[doc = "@brief Replace this table's data by copying from a set of column arrays\n\n@rst\nClears the data columns of this table and then copies column data from the specified\nset of arrays. The supplied arrays should all contain data on the same number of rows.\nThe metadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_population_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_population_table_set_columns(
self_: *mut tsk_population_table_t,
num_rows: tsk_size_t,
metadata: *const ::std::os::raw::c_char,
metadata_offset: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Extends this table by copying from a set of column arrays\n\n@rst\nCopies column data from the specified set of arrays to create new rows at the end of the\ntable. The supplied arrays should all contain data on the same number of rows. The\nmetadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_population_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_population_table_append_columns(
self_: *mut tsk_population_table_t,
num_rows: tsk_size_t,
metadata: *const ::std::os::raw::c_char,
metadata_offset: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Controls the pre-allocation strategy for this table\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_population_table_t object.\n@param max_rows_increment The number of rows to pre-allocate, or zero for the default\ndoubling strategy.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_population_table_set_max_rows_increment(
self_: *mut tsk_population_table_t,
max_rows_increment: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Controls the pre-allocation strategy for the metadata column\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_population_table_t object.\n@param max_metadata_length_increment The number of bytes to pre-allocate, or zero for\nthe default doubling strategy.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_population_table_set_max_metadata_length_increment(
self_: *mut tsk_population_table_t,
max_metadata_length_increment: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = " @}"]
pub fn tsk_population_table_dump_text(
self_: *const tsk_population_table_t,
out: *mut FILE,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Initialises the table by allocating the internal memory.\n\n@rst\nThis must be called before any operations are performed on the table.\nSee the :ref:`sec_c_api_overview_structure` for details on how objects\nare initialised and freed.\n@endrst\n\n@param self A pointer to an uninitialised tsk_provenance_table_t object.\n@param options Allocation time options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_provenance_table_init(
self_: *mut tsk_provenance_table_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Free the internal memory for the specified table.\n\n@param self A pointer to an initialised tsk_provenance_table_t object.\n@return Always returns 0."]
pub fn tsk_provenance_table_free(self_: *mut tsk_provenance_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Adds a row to this provenance table.\n\n@rst\nAdd a new provenance with the specified ``timestamp`` and ``record`` to the table.\nCopies of the ``timestamp`` and ``record`` are immediately taken.\nSee the :ref:`table definition <sec_provenance_table_definition>`\nfor details of the columns in this table.\n@endrst\n\n@param self A pointer to a tsk_provenance_table_t object.\n@param timestamp The timestamp to be associated with the new provenance. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``timestamp_length`` is 0.\n@param timestamp_length The size of the timestamp array in bytes.\n@param record The record to be associated with the new provenance. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``record_length`` is 0.\n@param record_length The size of the record array in bytes.\n@return Return the ID of the newly added provenance on success,\nor a negative value on failure."]
pub fn tsk_provenance_table_add_row(
self_: *mut tsk_provenance_table_t,
timestamp: *const ::std::os::raw::c_char,
timestamp_length: tsk_size_t,
record: *const ::std::os::raw::c_char,
record_length: tsk_size_t,
) -> tsk_id_t;
}
extern "C" {
#[doc = "@brief Updates the row at the specified index.\n\n@rst\nRewrite the row at the specified index in this table to use the specified\nvalues. Copies of the ``timestamp`` and ``record`` parameters are taken\nimmediately. See the :ref:`table definition <sec_provenance_table_definition>`\nfor details of the columns in this table.\n\n.. warning::\nBecause of the way that ragged columns are encoded, this method requires a\nfull rewrite of the internal column memory in worst case, and would\ntherefore be inefficient for bulk updates for such columns. However, if the\nsizes of all ragged column values are unchanged in the updated row, this\nmethod is guaranteed to only update the memory for the row in question.\n@endrst\n\n@param self A pointer to a tsk_provenance_table_t object.\n@param index The row to update.\n@param timestamp The timestamp to be associated with new provenance. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``timestamp_length`` is 0.\n@param timestamp_length The size of the timestamp array in bytes.\n@param record The record to be associated with the provenance. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``record_length`` is 0.\n@param record_length The size of the record array in bytes.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_provenance_table_update_row(
self_: *mut tsk_provenance_table_t,
index: tsk_id_t,
timestamp: *const ::std::os::raw::c_char,
timestamp_length: tsk_size_t,
record: *const ::std::os::raw::c_char,
record_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Clears this table, setting the number of rows to zero.\n\n@rst\nNo memory is freed as a result of this operation; please use\n:c:func:`tsk_provenance_table_free` to free the table's internal resources.\n@endrst\n\n@param self A pointer to a tsk_provenance_table_t object.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_provenance_table_clear(self_: *mut tsk_provenance_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Truncates this table so that only the first num_rows are retained.\n\n@param self A pointer to a tsk_provenance_table_t object.\n@param num_rows The number of rows to retain in the table.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_provenance_table_truncate(
self_: *mut tsk_provenance_table_t,
num_rows: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Extends this table by appending rows copied from another table.\n\n@rst\nAppends the rows at the specified indexes from the table ``other`` to the end of this\ntable. Row indexes can be repeated and in any order. If ``row_indexes`` is NULL, append\nthe first ``num_rows`` from ``other`` to this table.\n@endrst\n\n@param self A pointer to a tsk_provenance_table_t object where rows are to be added.\n@param other A pointer to a tsk_provenance_table_t object where rows are copied from.\n@param num_rows The number of rows from ``other`` to append to this table.\n@param row_indexes Array of row indexes in ``other``. If ``NULL`` is passed then the\nfirst ``num_rows`` of ``other`` are used.\n@param options Bitwise option flags. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_provenance_table_extend(
self_: *mut tsk_provenance_table_t,
other: *const tsk_provenance_table_t,
num_rows: tsk_size_t,
row_indexes: *const tsk_id_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Returns true if the data in the specified table is identical to the data\nin this table.\n\n@rst\n\nOptions**\n\nOptions to control the comparison can be specified by providing one or\nmore of the following bitwise flags. By default (options=0) tables are\nconsidered equal if they are byte-wise identical in all columns.\n\n- :c:macro:`TSK_CMP_IGNORE_TIMESTAMPS`\n@endrst\n\n@param self A pointer to a tsk_provenance_table_t object.\n@param other A pointer to a tsk_provenance_table_t object.\n@param options Bitwise comparison options.\n@return Return true if the specified table is equal to this table."]
pub fn tsk_provenance_table_equals(
self_: *const tsk_provenance_table_t,
other: *const tsk_provenance_table_t,
options: tsk_flags_t,
) -> bool;
}
extern "C" {
#[doc = "@brief Copies the state of this table into the specified destination.\n\n@rst\nBy default the method initialises the specified destination table. If the\ndestination is already initialised, the :c:macro:`TSK_NO_INIT` option should\nbe supplied to avoid leaking memory.\n@endrst\n\n@param self A pointer to a tsk_provenance_table_t object.\n@param dest A pointer to a tsk_provenance_table_t object. If the TSK_NO_INIT\noption is specified, this must be an initialised provenance table. If not, it must be an\nuninitialised provenance table.\n@param options Bitwise option flags.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_provenance_table_copy(
self_: *const tsk_provenance_table_t,
dest: *mut tsk_provenance_table_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Get the row at the specified index.\n\n@rst\nUpdates the specified provenance struct to reflect the values in the specified row.\nPointers to memory within this struct are handled by the table and should **not**\nbe freed by client code. These pointers are guaranteed to be valid until the\nnext operation that modifies the table (e.g., by adding a new row), but not afterwards.\n@endrst\n\n@param self A pointer to a tsk_provenance_table_t object.\n@param index The requested table row.\n@param row A pointer to a tsk_provenance_t struct that is updated to reflect the\nvalues in the specified row.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_provenance_table_get_row(
self_: *const tsk_provenance_table_t,
index: tsk_id_t,
row: *mut tsk_provenance_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Print out the state of this table to the specified stream.\n\nThis method is intended for debugging purposes and should not be used\nin production code. The format of the output should **not** be depended\non and may change arbitrarily between versions.\n\n@param self A pointer to a tsk_provenance_table_t object.\n@param out The stream to write the summary to."]
pub fn tsk_provenance_table_print_state(self_: *const tsk_provenance_table_t, out: *mut FILE);
}
extern "C" {
#[doc = "@brief Replace this table's data by copying from a set of column arrays\n\n@rst\nClears the data columns of this table and then copies column data from the specified\nset of arrays. The supplied arrays should all contain data on the same number of rows.\nThe metadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_provenance_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param timestamp The array of char timestamp values to be copied.\n@param timestamp_offset The array of tsk_size_t timestamp offset values to be copied.\n@param record The array of char record values to be copied.\n@param record_offset The array of tsk_size_t record offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_provenance_table_set_columns(
self_: *mut tsk_provenance_table_t,
num_rows: tsk_size_t,
timestamp: *const ::std::os::raw::c_char,
timestamp_offset: *const tsk_size_t,
record: *const ::std::os::raw::c_char,
record_offset: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Extends this table by copying from a set of column arrays\n\n@rst\nCopies column data from the specified set of arrays to create new rows at the end of the\ntable. The supplied arrays should all contain data on the same number of rows. The\nmetadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_provenance_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param timestamp The array of char timestamp values to be copied.\n@param timestamp_offset The array of tsk_size_t timestamp offset values to be copied.\n@param record The array of char record values to be copied.\n@param record_offset The array of tsk_size_t record offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_provenance_table_append_columns(
self_: *mut tsk_provenance_table_t,
num_rows: tsk_size_t,
timestamp: *const ::std::os::raw::c_char,
timestamp_offset: *const tsk_size_t,
record: *const ::std::os::raw::c_char,
record_offset: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Controls the pre-allocation strategy for this table\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_provenance_table_t object.\n@param max_rows_increment The number of rows to pre-allocate, or zero for the default\ndoubling strategy.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_provenance_table_set_max_rows_increment(
self_: *mut tsk_provenance_table_t,
max_rows_increment: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Controls the pre-allocation strategy for the timestamp column\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_provenance_table_t object.\n@param max_timestamp_length_increment The number of bytes to pre-allocate, or zero for\nthe default doubling strategy.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_provenance_table_set_max_timestamp_length_increment(
self_: *mut tsk_provenance_table_t,
max_timestamp_length_increment: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Controls the pre-allocation strategy for the record column\n\n@rst\nSet a fixed pre-allocation size, use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_provenance_table_t object.\n@param max_record_length_increment The number of bytes to pre-allocate, or zero for the\ndefault doubling strategy.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_provenance_table_set_max_record_length_increment(
self_: *mut tsk_provenance_table_t,
max_record_length_increment: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = " @}"]
pub fn tsk_provenance_table_dump_text(
self_: *const tsk_provenance_table_t,
out: *mut FILE,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Initialises the table collection by allocating the internal memory\nand initialising all the constituent tables.\n\n@rst\nThis must be called before any operations are performed on the table\ncollection. See the :ref:`sec_c_api_overview_structure` for details on how objects\nare initialised and freed.\n\nOptions**\n\nOptions can be specified by providing bitwise flags:\n\n- :c:macro:`TSK_TC_NO_EDGE_METADATA`\n@endrst\n\n@param self A pointer to an uninitialised tsk_table_collection_t object.\n@param options Allocation time options as above.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_table_collection_init(
self_: *mut tsk_table_collection_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Free the internal memory for the specified table collection.\n\n@param self A pointer to an initialised tsk_table_collection_t object.\n@return Always returns 0."]
pub fn tsk_table_collection_free(self_: *mut tsk_table_collection_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Clears data tables (and optionally provenances and metadata) in\nthis table collection.\n\n@rst\nBy default this operation clears all tables except the provenance table, retaining\ntable metadata schemas and the tree-sequence level metadata and schema.\n\nNo memory is freed as a result of this operation; please use\n:c:func:`tsk_table_collection_free` to free internal resources.\n\nOptions**\n\nOptions can be specified by providing one or more of the following bitwise\nflags:\n\n- :c:macro:`TSK_CLEAR_PROVENANCE`\n- :c:macro:`TSK_CLEAR_METADATA_SCHEMAS`\n- :c:macro:`TSK_CLEAR_TS_METADATA_AND_SCHEMA`\n@endrst\n\n@param self A pointer to a tsk_table_collection_t object.\n@param options Bitwise clearing options.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_table_collection_clear(
self_: *mut tsk_table_collection_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Returns true if the data in the specified table collection is equal\nto the data in this table collection.\n\n@rst\n\nReturns true if the two table collections are equal. The indexes are\nnot considered as these are derived from the tables. We also do not\nconsider the ``file_uuid``, since it is a property of the file that set\nof tables is stored in.\n\nOptions**\n\nOptions to control the comparison can be specified by providing one or\nmore of the following bitwise flags. By default (options=0) two table\ncollections are considered equal if all of the tables are byte-wise\nidentical, and the sequence lengths, metadata and metadata schemas\nof the two table collections are identical.\n\n- :c:macro:`TSK_CMP_IGNORE_PROVENANCE`\n- :c:macro:`TSK_CMP_IGNORE_METADATA`\n- :c:macro:`TSK_CMP_IGNORE_TS_METADATA`\n- :c:macro:`TSK_CMP_IGNORE_TIMESTAMPS`\n- :c:macro:`TSK_CMP_IGNORE_TABLES`\n- :c:macro:`TSK_CMP_IGNORE_REFERENCE_SEQUENCE`\n@endrst\n\n@param self A pointer to a tsk_table_collection_t object.\n@param other A pointer to a tsk_table_collection_t object.\n@param options Bitwise comparison options.\n@return Return true if the specified table collection is equal to this table."]
pub fn tsk_table_collection_equals(
self_: *const tsk_table_collection_t,
other: *const tsk_table_collection_t,
options: tsk_flags_t,
) -> bool;
}
extern "C" {
#[doc = "@brief Copies the state of this table collection into the specified destination.\n\n@rst\nBy default the method initialises the specified destination table collection. If the\ndestination is already initialised, the :c:macro:`TSK_NO_INIT` option should\nbe supplied to avoid leaking memory.\n\nOptions**\n\nOptions can be specified by providing bitwise flags:\n\n:c:macro:`TSK_COPY_FILE_UUID`\n@endrst\n\n@param self A pointer to a tsk_table_collection_t object.\n@param dest A pointer to a tsk_table_collection_t object. If the TSK_NO_INIT\noption is specified, this must be an initialised table collection. If not, it must be an\nuninitialised table collection.\n@param options Bitwise option flags.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_table_collection_copy(
self_: *const tsk_table_collection_t,
dest: *mut tsk_table_collection_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Print out the state of this table collection to the specified stream.\n\nThis method is intended for debugging purposes and should not be used\nin production code. The format of the output should **not** be depended\non and may change arbitrarily between versions.\n\n@param self A pointer to a tsk_table_collection_t object.\n@param out The stream to write the summary to."]
pub fn tsk_table_collection_print_state(self_: *const tsk_table_collection_t, out: *mut FILE);
}
extern "C" {
#[doc = "@brief Load a table collection from a file path.\n\n@rst\nLoads the data from the specified file into this table collection.\nBy default, the table collection is also initialised.\nThe resources allocated must be freed using\n:c:func:`tsk_table_collection_free` even in error conditions.\n\nIf the :c:macro:`TSK_NO_INIT` option is set, the table collection is\nnot initialised, allowing an already initialised table collection to\nbe overwritten with the data from a file.\n\nIf the file contains multiple table collections, this function will load\nthe first. Please see the :c:func:`tsk_table_collection_loadf` for details\non how to sequentially load table collections from a stream.\n\nIf the :c:macro:`TSK_LOAD_SKIP_TABLES` option is set, only the non-table information from\nthe table collection will be read, leaving all tables with zero rows and no\nmetadata or schema.\nIf the :c:macro:`TSK_LOAD_SKIP_REFERENCE_SEQUENCE` option is set, the table collection is\nread without loading the reference sequence.\n\nOptions**\n\nOptions can be specified by providing one or more of the following bitwise\nflags:\n\n- :c:macro:`TSK_NO_INIT`\n- :c:macro:`TSK_LOAD_SKIP_TABLES`\n- :c:macro:`TSK_LOAD_SKIP_REFERENCE_SEQUENCE`\n\nExamples**\n\n.. code-block:: c\n\nint ret;\ntsk_table_collection_t tables;\nret = tsk_table_collection_load(&tables, \"data.trees\", 0);\nif (ret != 0) {\nfprintf(stderr, \"Load error:%s\\n\", tsk_strerror(ret));\nexit(EXIT_FAILURE);\n}\n\n@endrst\n\n@param self A pointer to an uninitialised tsk_table_collection_t object\nif the TSK_NO_INIT option is not set (default), or an initialised\ntsk_table_collection_t otherwise.\n@param filename A NULL terminated string containing the filename.\n@param options Bitwise options. See above for details.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_table_collection_load(
self_: *mut tsk_table_collection_t,
filename: *const ::std::os::raw::c_char,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Load a table collection from a stream.\n\n@rst\nLoads a tables definition from the specified file stream to this table\ncollection. By default, the table collection is also initialised.\nThe resources allocated must be freed using\n:c:func:`tsk_table_collection_free` even in error conditions.\n\nIf the :c:macro:`TSK_NO_INIT` option is set, the table collection is\nnot initialised, allowing an already initialised table collection to\nbe overwritten with the data from a file.\n\nThe stream can be an arbitrary file descriptor, for example a network socket.\nNo seek operations are performed.\n\nIf the stream contains multiple table collection definitions, this function\nwill load the next table collection from the stream. If the stream contains no\nmore table collection definitions the error value :c:macro:`TSK_ERR_EOF` will\nbe returned. Note that EOF is only returned in the case where zero bytes are\nread from the stream --- malformed files or other errors will result in\ndifferent error conditions. Please see the\n:ref:`sec_c_api_examples_file_streaming` section for an example of how to\nsequentially load tree sequences from a stream.\n\nPlease note that this streaming behaviour is not supported if the\n:c:macro:`TSK_LOAD_SKIP_TABLES` or :c:macro:`TSK_LOAD_SKIP_REFERENCE_SEQUENCE` option is\nset. If the :c:macro:`TSK_LOAD_SKIP_TABLES` option is set, only the non-table information\nfrom the table collection will be read, leaving all tables with zero rows and no metadata\nor schema. If the :c:macro:`TSK_LOAD_SKIP_REFERENCE_SEQUENCE` option is set, the table\ncollection is read without loading the reference sequence. When attempting to read from a\nstream with multiple table collection definitions and either of these two options set,\nthe requested information from the first table collection will be read on the first call\nto :c:func:`tsk_table_collection_loadf`, with subsequent calls leading to errors.\n\nOptions**\n\nOptions can be specified by providing one or more of the following bitwise\nflags:\n\n- :c:macro:`TSK_NO_INIT`\n- :c:macro:`TSK_LOAD_SKIP_TABLES`\n- :c:macro:`TSK_LOAD_SKIP_REFERENCE_SEQUENCE`\n@endrst\n\n@param self A pointer to an uninitialised tsk_table_collection_t object\nif the TSK_NO_INIT option is not set (default), or an initialised\ntsk_table_collection_t otherwise.\n@param file A FILE stream opened in an appropriate mode for reading (e.g.\n\"r\", \"r+\" or \"w+\") positioned at the beginning of a table collection\ndefinition.\n@param options Bitwise options. See above for details.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_table_collection_loadf(
self_: *mut tsk_table_collection_t,
file: *mut FILE,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Write a table collection to file.\n\n@rst\nWrites the data from this table collection to the specified file.\n\nIf an error occurs the file path is deleted, ensuring that only complete\nand well formed files will be written.\n\nExamples**\n\n.. code-block:: c\n\nint ret;\ntsk_table_collection_t tables;\n\nret = tsk_table_collection_init(&tables, 0);\nerror_check(ret);\ntables.sequence_length = 1.0;\n// Write out the empty tree sequence\nret = tsk_table_collection_dump(&tables, \"empty.trees\", 0);\nerror_check(ret);\n\n@endrst\n\n@param self A pointer to an initialised tsk_table_collection_t object.\n@param filename A NULL terminated string containing the filename.\n@param options Bitwise options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_table_collection_dump(
self_: *const tsk_table_collection_t,
filename: *const ::std::os::raw::c_char,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Write a table collection to a stream.\n\n@rst\nWrites the data from this table collection to the specified FILE stream.\nSemantics are identical to :c:func:`tsk_table_collection_dump`.\n\nPlease see the :ref:`sec_c_api_examples_file_streaming` section for an example\nof how to sequentially dump and load tree sequences from a stream.\n\n@endrst\n\n@param self A pointer to an initialised tsk_table_collection_t object.\n@param file A FILE stream opened in an appropriate mode for writing (e.g.\n\"w\", \"a\", \"r+\" or \"w+\").\n@param options Bitwise options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_table_collection_dumpf(
self_: *const tsk_table_collection_t,
file: *mut FILE,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Record the number of rows in each table in the specified tsk_bookmark_t object.\n\n@param self A pointer to an initialised tsk_table_collection_t object.\n@param bookmark A pointer to a tsk_bookmark_t which is updated to contain the number of\nrows in all tables.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_table_collection_record_num_rows(
self_: *const tsk_table_collection_t,
bookmark: *mut tsk_bookmark_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Truncates the tables in this table collection according to the specified bookmark.\n\n@rst\nTruncate the tables in this collection so that each one has the number\nof rows specified in the parameter :c:type:`tsk_bookmark_t`. Use the\n:c:func:`tsk_table_collection_record_num_rows` function to record the\nnumber rows for each table in a table collection at a particular time.\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param bookmark The number of rows to retain in each table.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_table_collection_truncate(
self_: *mut tsk_table_collection_t,
bookmark: *mut tsk_bookmark_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Sorts the tables in this collection.\n\n@rst\nSome of the tables in a table collection must satisfy specific sortedness requirements\nin order to define a :ref:`valid tree sequence <sec_valid_tree_sequence_requirements>`.\nThis method sorts the ``edge``, ``site``, ``mutation`` and ``individual`` tables such\nthat these requirements are guaranteed to be fulfilled. The ``node``, ``population``\nand ``provenance`` tables do not have any sortedness requirements, and are therefore\nignored by this method.\n\n.. note:: The current implementation **may** sort in such a way that exceeds\nthese requirements, but this behaviour should not be relied upon and later\nversions may weaken the level of sortedness. However, the method does **guarantee**\nthat the resulting tables describes a valid tree sequence.\n\n.. warning:: Sorting migrations is currently not supported and an error will be raised\nif a table collection containing a non-empty migration table is specified.\n\nThe specified :c:type:`tsk_bookmark_t` allows us to specify a start position\nfor sorting in each of the tables; rows before this value are assumed to already be\nin sorted order and this information is used to make sorting more efficient.\nPositions in tables that are not sorted (``node``, ``population``\nand ``provenance``) are ignored and can be set to arbitrary values.\n\n.. warning:: The current implementation only supports specifying a start\nposition for the ``edge`` table and in a limited form for the\n``site``, ``mutation`` and ``individual`` tables. Specifying a non-zero\n``migration``, start position results in an error. The start positions for the\n``site``, ``mutation`` and ``individual`` tables can either be 0 or the length of the\nrespective tables, allowing these tables to either be fully sorted, or not sorted at\nall.\n\nThe table collection will always be unindexed after sort successfully completes.\n\nFor more control over the sorting process, see the :ref:`sec_c_api_low_level_sorting`\nsection.\n\nOptions**\n\nOptions can be specified by providing one or more of the following bitwise\nflags:\n\n:c:macro:`TSK_NO_CHECK_INTEGRITY`\nDo not run integrity checks using\n:c:func:`tsk_table_collection_check_integrity` before sorting,\npotentially leading to a small reduction in execution time. This\nperformance optimisation should not be used unless the calling code can\nguarantee reference integrity within the table collection. References\nto rows not in the table or bad offsets will result in undefined\nbehaviour.\n@endrst\n\n@param self A pointer to a tsk_table_collection_t object.\n@param start The position to begin sorting in each table; all rows less than this\nposition must fulfill the tree sequence sortedness requirements. If this is\nNULL, sort all rows.\n@param options Sort options.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_table_collection_sort(
self_: *mut tsk_table_collection_t,
start: *const tsk_bookmark_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Sorts the individual table in this collection.\n\n@rst\nSorts the individual table in place, so that parents come before children,\nand the parent column is remapped as required. Node references to individuals\nare also updated.\n@endrst\n\n@param self A pointer to a tsk_table_collection_t object.\n@param options Sort options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_table_collection_individual_topological_sort(
self_: *mut tsk_table_collection_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Puts the tables into canonical form.\n\n@rst\nPut tables into canonical form such that randomly reshuffled tables\nare guaranteed to always be sorted in the same order, and redundant\ninformation is removed. The canonical sorting exceeds the usual\ntree sequence sortedness requirements.\n\nOptions**:\n\nOptions can be specified by providing one or more of the following bitwise\nflags:\n\n- :c:macro:`TSK_SUBSET_KEEP_UNREFERENCED`\n\n@endrst\n\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_table_collection_canonicalise(
self_: *mut tsk_table_collection_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Simplify the tables to remove redundant information.\n\n@rst\nSimplification transforms the tables to remove redundancy and canonicalise\ntree sequence data. See the :ref:`simplification <sec_simplification>` tutorial for\nmore details.\n\nA mapping from the node IDs in the table before simplification to their equivalent\nvalues after simplification can be obtained via the ``node_map`` argument. If this\nis non NULL, ``node_map[u]`` will contain the new ID for node ``u`` after simplification,\nor :c:macro:`TSK_NULL` if the node has been removed. Thus, ``node_map`` must be an array\nof at least ``self->nodes.num_rows`` :c:type:`tsk_id_t` values. The table collection will\nalways be unindexed after simplify successfully completes.\n\n.. note:: Migrations are currently not supported by simplify, and an error will\nbe raised if we attempt call simplify on a table collection with greater\nthan zero migrations. See `<https://github.com/tskit-dev/tskit/issues/20>`_\n\nOptions**:\n\nOptions can be specified by providing one or more of the following bitwise\nflags:\n\n- :c:macro:`TSK_SIMPLIFY_FILTER_SITES`\n- :c:macro:`TSK_SIMPLIFY_FILTER_POPULATIONS`\n- :c:macro:`TSK_SIMPLIFY_FILTER_INDIVIDUALS`\n- :c:macro:`TSK_SIMPLIFY_REDUCE_TO_SITE_TOPOLOGY`\n- :c:macro:`TSK_SIMPLIFY_KEEP_UNARY`\n- :c:macro:`TSK_SIMPLIFY_KEEP_INPUT_ROOTS`\n- :c:macro:`TSK_SIMPLIFY_KEEP_UNARY_IN_INDIVIDUALS`\n@endrst\n\n@param self A pointer to a tsk_table_collection_t object.\n@param samples Either NULL or an array of num_samples distinct and valid node IDs.\nIf non-null the nodes in this array will be marked as samples in the output.\nIf NULL, the num_samples parameter is ignored and the samples in the output\nwill be the same as the samples in the input. This is equivalent to populating\nthe samples array with all of the sample nodes in the input in increasing\norder of ID.\n@param num_samples The number of node IDs in the input samples array. Ignored\nif the samples array is NULL.\n@param options Simplify options; see above for the available bitwise flags.\nFor the default behaviour, a value of 0 should be provided.\n@param node_map If not NULL, this array will be filled to define the mapping\nbetween nodes IDs in the table collection before and after simplification.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_table_collection_simplify(
self_: *mut tsk_table_collection_t,
samples: *const tsk_id_t,
num_samples: tsk_size_t,
options: tsk_flags_t,
node_map: *mut tsk_id_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Subsets and reorders a table collection according to an array of nodes.\n\n@rst\nReduces the table collection to contain only the entries referring to\nthe provided list of nodes, with nodes reordered according to the order\nthey appear in the ``nodes`` argument. Specifically, this subsets and reorders\neach of the tables as follows (but see options, below):\n\n1. Nodes: if in the list of nodes, and in the order provided.\n2. Individuals: if referred to by a retained node.\n3. Populations: if referred to by a retained node, and in the order first seen\nwhen traversing the list of retained nodes.\n4. Edges: if both parent and child are retained nodes.\n5. Mutations: if the mutation's node is a retained node.\n6. Sites: if any mutations remain at the site after removing mutations.\n\nRetained individuals, edges, mutations, and sites appear in the same\norder as in the original tables. Note that only the information *directly*\nassociated with the provided nodes is retained - for instance,\nsubsetting to nodes=[A, B] does not retain nodes ancestral to A and B,\nand only retains the individuals A and B are in, and not their parents.\n\nThis function does *not* require the tables to be sorted.\n\n.. note:: Migrations are currently not supported by subset, and an error will\nbe raised if we attempt call subset on a table collection with greater\nthan zero migrations.\n\nOptions**:\n\nOptions can be specified by providing one or more of the following bitwise\nflags:\n\n- :c:macro:`TSK_SUBSET_NO_CHANGE_POPULATIONS`\n- :c:macro:`TSK_SUBSET_KEEP_UNREFERENCED`\n@endrst\n\n@param self A pointer to a tsk_table_collection_t object.\n@param nodes An array of num_nodes valid node IDs.\n@param num_nodes The number of node IDs in the input nodes array.\n@param options Bitwise option flags.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_table_collection_subset(
self_: *mut tsk_table_collection_t,
nodes: *const tsk_id_t,
num_nodes: tsk_size_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Forms the node-wise union of two table collections.\n\n@rst\nExpands this table collection by adding the non-shared portions of another table\ncollection to itself. The ``other_node_mapping`` encodes which nodes in ``other`` are\nequivalent to a node in ``self``. The positions in the ``other_node_mapping`` array\ncorrespond to node ids in ``other``, and the elements encode the equivalent\nnode id in ``self`` or :c:macro:`TSK_NULL` if the node is exclusive to ``other``. Nodes\nthat are exclusive ``other`` are added to ``self``, along with:\n\n1. Individuals which are new to ``self``.\n2. Edges whose parent or child are new to ``self``.\n3. Sites which were not present in ``self``.\n4. Mutations whose nodes are new to ``self``.\n\nBy default, populations of newly added nodes are assumed to be new populations,\nand added to the population table as well.\n\nThis operation will also sort the resulting tables, so the tables may change\neven if nothing new is added, if the original tables were not sorted.\n\n.. note:: Migrations are currently not supported by union, and an error will\nbe raised if we attempt call union on a table collection with migrations.\n\nOptions**:\n\nOptions can be specified by providing one or more of the following bitwise\nflags:\n\n- :c:macro:`TSK_UNION_NO_CHECK_SHARED`\n- :c:macro:`TSK_UNION_NO_ADD_POP`\n@endrst\n\n@param self A pointer to a tsk_table_collection_t object.\n@param other A pointer to a tsk_table_collection_t object.\n@param other_node_mapping An array of node IDs that relate nodes in other to nodes in\nself: the k-th element of other_node_mapping should be the index of the equivalent\nnode in self, or TSK_NULL if the node is not present in self (in which case it\nwill be added to self).\n@param options Union options; see above for the available bitwise flags.\nFor the default behaviour, a value of 0 should be provided.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_table_collection_union(
self_: *mut tsk_table_collection_t,
other: *const tsk_table_collection_t,
other_node_mapping: *const tsk_id_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Set the time_units\n@rst\nCopies the time_units string to this table collection, replacing any existing.\n@endrst\n@param self A pointer to a tsk_table_collection_t object.\n@param time_units A pointer to a char array.\n@param time_units_length The size of the time units string in bytes.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_table_collection_set_time_units(
self_: *mut tsk_table_collection_t,
time_units: *const ::std::os::raw::c_char,
time_units_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Set the metadata\n@rst\nCopies the metadata string to this table collection, replacing any existing.\n@endrst\n@param self A pointer to a tsk_table_collection_t object.\n@param metadata A pointer to a char array.\n@param metadata_length The size of the metadata in bytes.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_table_collection_set_metadata(
self_: *mut tsk_table_collection_t,
metadata: *const ::std::os::raw::c_char,
metadata_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Set the metadata schema\n@rst\nCopies the metadata schema string to this table collection, replacing any existing.\n@endrst\n@param self A pointer to a tsk_table_collection_t object.\n@param metadata_schema A pointer to a char array.\n@param metadata_schema_length The size of the metadata schema in bytes.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_table_collection_set_metadata_schema(
self_: *mut tsk_table_collection_t,
metadata_schema: *const ::std::os::raw::c_char,
metadata_schema_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Returns true if this table collection is indexed.\n\n@rst\nThis method returns true if the table collection has an index\nfor the edge table. It guarantees that the index exists, and that\nit is for the same number of edges that are in the edge table. It\ndoes *not* guarantee that the index is valid (i.e., if the rows\nin the edge have been permuted in some way since the index was built).\n\nSee the :ref:`sec_c_api_table_indexes` section for details on the index\nlife-cycle.\n@endrst\n\n@param self A pointer to a tsk_table_collection_t object.\n@param options Bitwise options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return true if there is an index present for this table collection."]
pub fn tsk_table_collection_has_index(
self_: *const tsk_table_collection_t,
options: tsk_flags_t,
) -> bool;
}
extern "C" {
#[doc = "@brief Deletes the indexes for this table collection.\n\n@rst\nUnconditionally drop the indexes that may be present for this table collection. It\nis not an error to call this method on an unindexed table collection.\nSee the :ref:`sec_c_api_table_indexes` section for details on the index\nlife-cycle.\n@endrst\n\n@param self A pointer to a tsk_table_collection_t object.\n@param options Bitwise options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Always returns 0."]
pub fn tsk_table_collection_drop_index(
self_: *mut tsk_table_collection_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Builds indexes for this table collection.\n\n@rst\nBuilds the tree traversal :ref:`indexes <sec_table_indexes>` for this table\ncollection. Any existing index is first dropped using\n:c:func:`tsk_table_collection_drop_index`. See the\n:ref:`sec_c_api_table_indexes` section for details on the index life-cycle.\n@endrst\n\n@param self A pointer to a tsk_table_collection_t object.\n@param options Bitwise options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_table_collection_build_index(
self_: *mut tsk_table_collection_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Runs integrity checks on this table collection.\n\n@rst\n\nChecks the integrity of this table collection. The default checks (i.e., with\noptions = 0) guarantee the integrity of memory and entity references within the\ntable collection. All positions along the genome are checked\nto see if they are finite values and within the required bounds. Time values\nare checked to see if they are finite or marked as unknown.\nConsistency of the direction of inheritance is also checked: whether\nparents are more recent than children, mutations are not more recent\nthan their nodes or their mutation parents, etcetera.\n\nTo check if a set of tables fulfills the :ref:`requirements\n<sec_valid_tree_sequence_requirements>` needed for a valid tree sequence, use\nthe :c:macro:`TSK_CHECK_TREES` option. When this method is called with\n:c:macro:`TSK_CHECK_TREES`, the number of trees in the tree sequence is returned. Thus,\nto check for errors client code should verify that the return value is less than zero.\nAll other options will return zero on success and a negative value on failure.\n\nMore fine-grained checks can be achieved using bitwise combinations of the\nother options.\n\nOptions**:\n\nOptions can be specified by providing one or more of the following bitwise\nflags:\n\n- :c:macro:`TSK_CHECK_EDGE_ORDERING`\n- :c:macro:`TSK_CHECK_SITE_ORDERING`\n- :c:macro:`TSK_CHECK_SITE_DUPLICATES`\n- :c:macro:`TSK_CHECK_MUTATION_ORDERING`\n- :c:macro:`TSK_CHECK_INDIVIDUAL_ORDERING`\n- :c:macro:`TSK_CHECK_MIGRATION_ORDERING`\n- :c:macro:`TSK_CHECK_INDEXES`\n- :c:macro:`TSK_CHECK_TREES`\n- :c:macro:`TSK_NO_CHECK_POPULATION_REFS`\n@endrst\n\n@param self A pointer to a tsk_table_collection_t object.\n@param options Bitwise options.\n@return Return a negative error value on if any problems are detected\nin the tree sequence. If the TSK_CHECK_TREES option is provided,\nthe number of trees in the tree sequence will be returned, on\nsuccess."]
pub fn tsk_table_collection_check_integrity(
self_: *const tsk_table_collection_t,
options: tsk_flags_t,
) -> tsk_id_t;
}
extern "C" {
pub fn tsk_table_collection_ibd_within(
self_: *const tsk_table_collection_t,
result: *mut tsk_identity_segments_t,
samples: *const tsk_id_t,
num_samples: tsk_size_t,
min_span: f64,
max_time: f64,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_table_collection_ibd_between(
self_: *const tsk_table_collection_t,
result: *mut tsk_identity_segments_t,
num_sample_sets: tsk_size_t,
sample_set_sizes: *const tsk_size_t,
sample_sets: *const tsk_id_t,
min_span: f64,
max_time: f64,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_table_collection_link_ancestors(
self_: *mut tsk_table_collection_t,
samples: *mut tsk_id_t,
num_samples: tsk_size_t,
ancestors: *mut tsk_id_t,
num_ancestors: tsk_size_t,
options: tsk_flags_t,
result: *mut tsk_edge_table_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_table_collection_deduplicate_sites(
tables: *mut tsk_table_collection_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_table_collection_compute_mutation_parents(
self_: *mut tsk_table_collection_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_table_collection_compute_mutation_times(
self_: *mut tsk_table_collection_t,
random: *mut f64,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_table_collection_delete_older(
self_: *mut tsk_table_collection_t,
time: f64,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_table_collection_set_indexes(
self_: *mut tsk_table_collection_t,
edge_insertion_order: *mut tsk_id_t,
edge_removal_order: *mut tsk_id_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_table_collection_takeset_metadata(
self_: *mut tsk_table_collection_t,
metadata: *mut ::std::os::raw::c_char,
metadata_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_table_collection_takeset_indexes(
self_: *mut tsk_table_collection_t,
edge_insertion_order: *mut tsk_id_t,
edge_removal_order: *mut tsk_id_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_individual_table_takeset_columns(
self_: *mut tsk_individual_table_t,
num_rows: tsk_size_t,
flags: *mut tsk_flags_t,
location: *mut f64,
location_offset: *mut tsk_size_t,
parents: *mut tsk_id_t,
parents_offset: *mut tsk_size_t,
metadata: *mut ::std::os::raw::c_char,
metadata_offset: *mut tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_node_table_takeset_columns(
self_: *mut tsk_node_table_t,
num_rows: tsk_size_t,
flags: *mut tsk_flags_t,
time: *mut f64,
population: *mut tsk_id_t,
individual: *mut tsk_id_t,
metadata: *mut ::std::os::raw::c_char,
metadata_offset: *mut tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_edge_table_takeset_columns(
self_: *mut tsk_edge_table_t,
num_rows: tsk_size_t,
left: *mut f64,
right: *mut f64,
parent: *mut tsk_id_t,
child: *mut tsk_id_t,
metadata: *mut ::std::os::raw::c_char,
metadata_offset: *mut tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_migration_table_takeset_columns(
self_: *mut tsk_migration_table_t,
num_rows: tsk_size_t,
left: *mut f64,
right: *mut f64,
node: *mut tsk_id_t,
source: *mut tsk_id_t,
dest: *mut tsk_id_t,
time: *mut f64,
metadata: *mut ::std::os::raw::c_char,
metadata_offset: *mut tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_site_table_takeset_columns(
self_: *mut tsk_site_table_t,
num_rows: tsk_size_t,
position: *mut f64,
ancestral_state: *mut ::std::os::raw::c_char,
ancestral_state_offset: *mut tsk_size_t,
metadata: *mut ::std::os::raw::c_char,
metadata_offset: *mut tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_mutation_table_takeset_columns(
self_: *mut tsk_mutation_table_t,
num_rows: tsk_size_t,
site: *mut tsk_id_t,
node: *mut tsk_id_t,
parent: *mut tsk_id_t,
time: *mut f64,
derived_state: *mut ::std::os::raw::c_char,
derived_state_offset: *mut tsk_size_t,
metadata: *mut ::std::os::raw::c_char,
metadata_offset: *mut tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_population_table_takeset_columns(
self_: *mut tsk_population_table_t,
num_rows: tsk_size_t,
metadata: *mut ::std::os::raw::c_char,
metadata_offset: *mut tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_provenance_table_takeset_columns(
self_: *mut tsk_provenance_table_t,
num_rows: tsk_size_t,
timestamp: *mut ::std::os::raw::c_char,
timestamp_offset: *mut tsk_size_t,
record: *mut ::std::os::raw::c_char,
record_offset: *mut tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_table_collection_has_reference_sequence(
self_: *const tsk_table_collection_t,
) -> bool;
}
extern "C" {
pub fn tsk_reference_sequence_init(
self_: *mut tsk_reference_sequence_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_reference_sequence_free(
self_: *mut tsk_reference_sequence_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_reference_sequence_is_null(self_: *const tsk_reference_sequence_t) -> bool;
}
extern "C" {
pub fn tsk_reference_sequence_equals(
self_: *const tsk_reference_sequence_t,
other: *const tsk_reference_sequence_t,
options: tsk_flags_t,
) -> bool;
}
extern "C" {
pub fn tsk_reference_sequence_copy(
self_: *const tsk_reference_sequence_t,
dest: *mut tsk_reference_sequence_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_reference_sequence_set_data(
self_: *mut tsk_reference_sequence_t,
data: *const ::std::os::raw::c_char,
data_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_reference_sequence_set_url(
self_: *mut tsk_reference_sequence_t,
url: *const ::std::os::raw::c_char,
url_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_reference_sequence_set_metadata(
self_: *mut tsk_reference_sequence_t,
metadata: *const ::std::os::raw::c_char,
metadata_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_reference_sequence_set_metadata_schema(
self_: *mut tsk_reference_sequence_t,
metadata_schema: *const ::std::os::raw::c_char,
metadata_schema_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_reference_sequence_takeset_data(
self_: *mut tsk_reference_sequence_t,
data: *mut ::std::os::raw::c_char,
data_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_reference_sequence_takeset_metadata(
self_: *mut tsk_reference_sequence_t,
metadata: *mut ::std::os::raw::c_char,
metadata_length: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Initialises the memory for the sorter object.\n\n@rst\nThis must be called before any operations are performed on the\ntable sorter and initialises all fields. The ``edge_sort`` function\nis set to the default method using qsort. The ``user_data``\nfield is set to NULL.\nThis method supports the same options as\n:c:func:`tsk_table_collection_sort`.\n\n@endrst\n\n@param self A pointer to an uninitialised tsk_table_sorter_t object.\n@param tables The table collection to sort.\n@param options Sorting options.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_table_sorter_init(
self_: *mut _tsk_table_sorter_t,
tables: *mut tsk_table_collection_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Runs the sort using the configured functions.\n\n@rst\nRuns the sorting process:\n\n1. Drop the table indexes.\n2. If the ``sort_edges`` function pointer is not NULL, run it. The\nfirst parameter to the called function will be a pointer to this\ntable_sorter_t object. The second parameter will be the value\n``start.edges``. This specifies the offset at which sorting should\nstart in the edge table. This offset is guaranteed to be within the\nbounds of the edge table.\n3. Sort the site table, building the mapping between site IDs in the\ncurrent and sorted tables.\n4. Sort the mutation table, using the ``sort_mutations`` pointer.\n\nIf an error occurs during the execution of a user-supplied\nsorting function a non-zero value must be returned. This value\nwill then be returned by ``tsk_table_sorter_run``. The error\nreturn value should be chosen to avoid conflicts with tskit error\ncodes.\n\nSee :c:func:`tsk_table_collection_sort` for details on the ``start`` parameter.\n\n@endrst\n\n@param self A pointer to a tsk_table_sorter_t object.\n@param start The position in the tables at which sorting starts.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_table_sorter_run(
self_: *mut _tsk_table_sorter_t,
start: *const tsk_bookmark_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Free the internal memory for the specified table sorter.\n\n@param self A pointer to an initialised tsk_table_sorter_t object.\n@return Always returns 0."]
pub fn tsk_table_sorter_free(self_: *mut _tsk_table_sorter_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = " @}"]
pub fn tsk_squash_edges(
edges: *mut tsk_edge_t,
num_edges: tsk_size_t,
num_output_edges: *mut tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_identity_segments_get_num_segments(
self_: *const tsk_identity_segments_t,
) -> tsk_size_t;
}
extern "C" {
pub fn tsk_identity_segments_get_total_span(self_: *const tsk_identity_segments_t) -> f64;
}
extern "C" {
pub fn tsk_identity_segments_get_num_pairs(self_: *const tsk_identity_segments_t)
-> tsk_size_t;
}
extern "C" {
pub fn tsk_identity_segments_get_keys(
result: *const tsk_identity_segments_t,
pairs: *mut tsk_id_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_identity_segments_get_items(
self_: *const tsk_identity_segments_t,
pairs: *mut tsk_id_t,
lists: *mut *mut tsk_identity_segment_list_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_identity_segments_get(
self_: *const tsk_identity_segments_t,
a: tsk_id_t,
b: tsk_id_t,
ret_list: *mut *mut tsk_identity_segment_list_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_identity_segments_print_state(self_: *mut tsk_identity_segments_t, out: *mut FILE);
}
extern "C" {
pub fn tsk_identity_segments_free(self_: *mut tsk_identity_segments_t)
-> ::std::os::raw::c_int;
}
#[doc = "@brief The tree sequence object."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_treeseq_t {
pub num_trees: tsk_size_t,
pub num_samples: tsk_size_t,
pub samples: *mut tsk_id_t,
pub time_uncalibrated: bool,
pub discrete_genome: bool,
pub discrete_time: bool,
pub breakpoints: *mut f64,
pub sample_index_map: *mut tsk_id_t,
pub individual_nodes_mem: *mut tsk_id_t,
pub individual_nodes: *mut *mut tsk_id_t,
pub individual_nodes_length: *mut tsk_size_t,
pub tree_sites_mem: *mut tsk_site_t,
pub tree_sites: *mut *mut tsk_site_t,
pub tree_sites_length: *mut tsk_size_t,
pub site_mutations_mem: *mut tsk_mutation_t,
pub site_mutations: *mut *mut tsk_mutation_t,
pub site_mutations_length: *mut tsk_size_t,
#[doc = " @brief The table collection underlying this tree sequence, This table\n collection must be treated as read-only, and any changes to it will\n lead to undefined behaviour."]
pub tables: *mut tsk_table_collection_t,
}
#[test]
fn bindgen_test_layout_tsk_treeseq_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_treeseq_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_treeseq_t>(),
128usize,
concat!("Size of: ", stringify!(tsk_treeseq_t))
);
assert_eq!(
::std::mem::align_of::<tsk_treeseq_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_treeseq_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_trees) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(num_trees)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_samples) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(num_samples)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).samples) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(samples)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).time_uncalibrated) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(time_uncalibrated)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).discrete_genome) as usize - ptr as usize },
25usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(discrete_genome)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).discrete_time) as usize - ptr as usize },
26usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(discrete_time)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).breakpoints) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(breakpoints)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).sample_index_map) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(sample_index_map)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).individual_nodes_mem) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(individual_nodes_mem)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).individual_nodes) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(individual_nodes)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).individual_nodes_length) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(individual_nodes_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).tree_sites_mem) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(tree_sites_mem)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).tree_sites) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(tree_sites)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).tree_sites_length) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(tree_sites_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).site_mutations_mem) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(site_mutations_mem)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).site_mutations) as usize - ptr as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(site_mutations)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).site_mutations_length) as usize - ptr as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(site_mutations_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).tables) as usize - ptr as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(tables)
)
);
}
#[doc = "@brief A single tree in a tree sequence.\n\n@rst\nA ``tsk_tree_t`` object has two basic functions:\n\n1. Represent the state of a single tree in a tree sequence;\n2. Provide methods to transform this state into different trees in the sequence.\n\nThe state of a single tree in the tree sequence is represented using the\nquintuply linked encoding: please see the\n:ref:`data model <sec_data_model_tree_structure>` section for details on\nhow this works. The left-to-right ordering of nodes in this encoding\nis arbitrary, and may change depending on the order in which trees are\naccessed within the sequence. Please see the\n:ref:`sec_c_api_examples_tree_traversals` examples for recommended\nusage.\n\nOn initialisation, a tree is in the :ref:`null state<sec_c_api_trees_null>` and\nwe must call one of the :ref:`seeking<sec_c_api_trees_seeking>` methods to make\nthe state of the tree object correspond to a particular tree in the sequence.\nPlease see the :ref:`sec_c_api_examples_tree_iteration` examples for\nrecommended usage.\n\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_tree_t {
#[doc = " @brief The parent tree sequence."]
pub tree_sequence: *const tsk_treeseq_t,
#[doc = "@brief The ID of the \"virtual root\" whose children are the roots of the\ntree."]
pub virtual_root: tsk_id_t,
#[doc = "@brief The parent of node u is parent[u]. Equal to ``TSK_NULL`` if node u is\na root or is not a node in the current tree."]
pub parent: *mut tsk_id_t,
#[doc = "@brief The leftmost child of node u is left_child[u]. Equal to ``TSK_NULL``\nif node u is a leaf or is not a node in the current tree."]
pub left_child: *mut tsk_id_t,
#[doc = "@brief The rightmost child of node u is right_child[u]. Equal to ``TSK_NULL``\nif node u is a leaf or is not a node in the current tree."]
pub right_child: *mut tsk_id_t,
#[doc = "@brief The sibling to the left of node u is left_sib[u]. Equal to\n``TSK_NULL`` if node u has no siblings to its left."]
pub left_sib: *mut tsk_id_t,
#[doc = "@brief The sibling to the right of node u is right_sib[u]. Equal to\n``TSK_NULL`` if node u has no siblings to its right."]
pub right_sib: *mut tsk_id_t,
#[doc = "@brief The number of children of node u is num_children[u]."]
pub num_children: *mut tsk_id_t,
#[doc = "@brief Array of edge ids where ``edge[u]`` is the edge that encodes the\nrelationship between the child node ``u`` and its parent. Equal to\n``TSK_NULL`` if node ``u`` is a root, virtual root or is not a node in the\ncurrent tree."]
pub edge: *mut tsk_id_t,
#[doc = "@brief The total number of edges defining the topology of this tree.\nThis is equal to the number of tree sequence edges that intersect with\nthe tree's genomic interval."]
pub num_edges: tsk_size_t,
pub interval: tsk_tree_t__bindgen_ty_1,
#[doc = "@brief The index of this tree in the tree sequence.\n\n@rst\nThis attribute provides the zero-based index of the tree represented by the\ncurrent state of the struct within the parent tree sequence. For example,\nimmediately after we call ``tsk_tree_first(&tree)``, ``tree.index`` will\nbe zero, and after we call ``tsk_tree_last(&tree)``, ``tree.index`` will\nbe the number of trees - 1 (see :c:func:`tsk_treeseq_get_num_trees`)\nWhen the tree is in the null state (immediately after initialisation,\nor after, e.g., calling :c:func:`tsk_tree_prev` on the first tree)\nthe value of the ``index`` is -1.\n@endrst"]
pub index: tsk_id_t,
pub num_nodes: tsk_size_t,
pub options: tsk_flags_t,
pub root_threshold: tsk_size_t,
pub samples: *const tsk_id_t,
pub num_samples: *mut tsk_size_t,
pub num_tracked_samples: *mut tsk_size_t,
pub left_sample: *mut tsk_id_t,
pub right_sample: *mut tsk_id_t,
pub next_sample: *mut tsk_id_t,
pub sites: *const tsk_site_t,
pub sites_length: tsk_size_t,
pub direction: ::std::os::raw::c_int,
pub left_index: tsk_id_t,
pub right_index: tsk_id_t,
}
#[doc = "@brief Left and right coordinates of the genomic interval that this\ntree covers. The left coordinate is inclusive and the right coordinate\nexclusive.\n\n@rst\n\nExample:\n\n.. code-block:: c\n\ntsk_tree_t tree;\nint ret;\n// initialise etc\nret = tsk_tree_first(&tree);\n// Check for error\nassert(ret == TSK_TREE_OK);\nprintf(\"Coordinates covered by first tree are left=%f, right=%f\\n\",\ntree.interval.left, tree.interval.right);\n\n@endrst\n"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_tree_t__bindgen_ty_1 {
pub left: f64,
pub right: f64,
}
#[test]
fn bindgen_test_layout_tsk_tree_t__bindgen_ty_1() {
const UNINIT: ::std::mem::MaybeUninit<tsk_tree_t__bindgen_ty_1> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_tree_t__bindgen_ty_1>(),
16usize,
concat!("Size of: ", stringify!(tsk_tree_t__bindgen_ty_1))
);
assert_eq!(
::std::mem::align_of::<tsk_tree_t__bindgen_ty_1>(),
8usize,
concat!("Alignment of ", stringify!(tsk_tree_t__bindgen_ty_1))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).left) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t__bindgen_ty_1),
"::",
stringify!(left)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).right) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t__bindgen_ty_1),
"::",
stringify!(right)
)
);
}
#[test]
fn bindgen_test_layout_tsk_tree_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_tree_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_tree_t>(),
208usize,
concat!("Size of: ", stringify!(tsk_tree_t))
);
assert_eq!(
::std::mem::align_of::<tsk_tree_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_tree_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).tree_sequence) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(tree_sequence)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).virtual_root) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(virtual_root)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).parent) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(parent)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).left_child) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(left_child)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).right_child) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(right_child)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).left_sib) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(left_sib)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).right_sib) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(right_sib)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_children) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(num_children)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).edge) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(edge)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_edges) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(num_edges)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).interval) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(interval)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).index) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(index)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_nodes) as usize - ptr as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(num_nodes)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).options) as usize - ptr as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(options)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).root_threshold) as usize - ptr as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(root_threshold)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).samples) as usize - ptr as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(samples)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_samples) as usize - ptr as usize },
136usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(num_samples)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_tracked_samples) as usize - ptr as usize },
144usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(num_tracked_samples)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).left_sample) as usize - ptr as usize },
152usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(left_sample)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).right_sample) as usize - ptr as usize },
160usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(right_sample)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).next_sample) as usize - ptr as usize },
168usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(next_sample)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).sites) as usize - ptr as usize },
176usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(sites)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).sites_length) as usize - ptr as usize },
184usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(sites_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).direction) as usize - ptr as usize },
192usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(direction)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).left_index) as usize - ptr as usize },
196usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(left_index)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).right_index) as usize - ptr as usize },
200usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(right_index)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _tsk_edge_list_node_t {
pub edge: tsk_edge_t,
pub next: *mut _tsk_edge_list_node_t,
pub prev: *mut _tsk_edge_list_node_t,
}
#[test]
fn bindgen_test_layout__tsk_edge_list_node_t() {
const UNINIT: ::std::mem::MaybeUninit<_tsk_edge_list_node_t> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<_tsk_edge_list_node_t>(),
64usize,
concat!("Size of: ", stringify!(_tsk_edge_list_node_t))
);
assert_eq!(
::std::mem::align_of::<_tsk_edge_list_node_t>(),
8usize,
concat!("Alignment of ", stringify!(_tsk_edge_list_node_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).edge) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_tsk_edge_list_node_t),
"::",
stringify!(edge)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(_tsk_edge_list_node_t),
"::",
stringify!(next)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(_tsk_edge_list_node_t),
"::",
stringify!(prev)
)
);
}
pub type tsk_edge_list_node_t = _tsk_edge_list_node_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_edge_list_t {
pub head: *mut tsk_edge_list_node_t,
pub tail: *mut tsk_edge_list_node_t,
}
#[test]
fn bindgen_test_layout_tsk_edge_list_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_edge_list_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_edge_list_t>(),
16usize,
concat!("Size of: ", stringify!(tsk_edge_list_t))
);
assert_eq!(
::std::mem::align_of::<tsk_edge_list_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_edge_list_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_list_t),
"::",
stringify!(head)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_list_t),
"::",
stringify!(tail)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_diff_iter_t {
pub num_nodes: tsk_size_t,
pub num_edges: tsk_size_t,
pub tree_left: f64,
pub tree_sequence: *const tsk_treeseq_t,
pub insertion_index: tsk_id_t,
pub removal_index: tsk_id_t,
pub tree_index: tsk_id_t,
pub last_index: tsk_id_t,
pub edge_list_nodes: *mut tsk_edge_list_node_t,
}
#[test]
fn bindgen_test_layout_tsk_diff_iter_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_diff_iter_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_diff_iter_t>(),
56usize,
concat!("Size of: ", stringify!(tsk_diff_iter_t))
);
assert_eq!(
::std::mem::align_of::<tsk_diff_iter_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_diff_iter_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_nodes) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_diff_iter_t),
"::",
stringify!(num_nodes)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_edges) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_diff_iter_t),
"::",
stringify!(num_edges)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).tree_left) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_diff_iter_t),
"::",
stringify!(tree_left)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).tree_sequence) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_diff_iter_t),
"::",
stringify!(tree_sequence)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).insertion_index) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_diff_iter_t),
"::",
stringify!(insertion_index)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).removal_index) as usize - ptr as usize },
36usize,
concat!(
"Offset of field: ",
stringify!(tsk_diff_iter_t),
"::",
stringify!(removal_index)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).tree_index) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_diff_iter_t),
"::",
stringify!(tree_index)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).last_index) as usize - ptr as usize },
44usize,
concat!(
"Offset of field: ",
stringify!(tsk_diff_iter_t),
"::",
stringify!(last_index)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).edge_list_nodes) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_diff_iter_t),
"::",
stringify!(edge_list_nodes)
)
);
}
extern "C" {
#[doc = "@brief Initialises the tree sequence based on the specified table collection.\n\n@rst\nThis method will copy the supplied table collection unless :c:macro:`TSK_TAKE_OWNERSHIP`\nis specified. The table collection will be checked for integrity and index maps built.\n\nThis must be called before any operations are performed on the tree sequence.\nSee the :ref:`sec_c_api_overview_structure` for details on how objects\nare initialised and freed.\n\nIf specified, TSK_TAKE_OWNERSHIP takes immediate ownership of the tables, regardless\nof error conditions.\n\nOptions**\n\n- :c:macro:`TSK_TS_INIT_BUILD_INDEXES`\n- :c:macro:`TSK_TAKE_OWNERSHIP` (applies to the table collection).\n@endrst\n\n@param self A pointer to an uninitialised tsk_table_collection_t object.\n@param tables A pointer to a tsk_table_collection_t object.\n@param options Allocation time options. See above for details.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_treeseq_init(
self_: *mut tsk_treeseq_t,
tables: *mut tsk_table_collection_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Load a tree sequence from a file path.\n\n@rst\nLoads the data from the specified file into this tree sequence.\nThe tree sequence is also initialised.\nThe resources allocated must be freed using\n:c:func:`tsk_treeseq_free` even in error conditions.\n\nWorks similarly to :c:func:`tsk_table_collection_load` please see\nthat function's documentation for details and options.\n\nExamples**\n\n.. code-block:: c\n\nint ret;\ntsk_treeseq_t ts;\nret = tsk_treeseq_load(&ts, \"data.trees\", 0);\nif (ret != 0) {\nfprintf(stderr, \"Load error:%s\\n\", tsk_strerror(ret));\nexit(EXIT_FAILURE);\n}\n\n@endrst\n\n@param self A pointer to an uninitialised tsk_treeseq_t object\n@param filename A NULL terminated string containing the filename.\n@param options Bitwise options. See above for details.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_treeseq_load(
self_: *mut tsk_treeseq_t,
filename: *const ::std::os::raw::c_char,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Load a tree sequence from a stream.\n\n@rst\nLoads a tree sequence from the specified file stream. The tree sequence\nis also initialised. The resources allocated must be freed using\n:c:func:`tsk_treeseq_free` even in error conditions.\n\nWorks similarly to :c:func:`tsk_table_collection_loadf` please\nsee that function's documentation for details and options.\n\n@endrst\n\n@param self A pointer to an uninitialised tsk_treeseq_t object.\n@param file A FILE stream opened in an appropriate mode for reading (e.g.\n\"r\", \"r+\" or \"w+\") positioned at the beginning of a tree sequence\ndefinition.\n@param options Bitwise options. See above for details.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_treeseq_loadf(
self_: *mut tsk_treeseq_t,
file: *mut FILE,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Write a tree sequence to file.\n\n@rst\nWrites the data from this tree sequence to the specified file.\n\nIf an error occurs the file path is deleted, ensuring that only complete\nand well formed files will be written.\n@endrst\n\n@param self A pointer to an initialised tsk_treeseq_t object.\n@param filename A NULL terminated string containing the filename.\n@param options Bitwise options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_treeseq_dump(
self_: *const tsk_treeseq_t,
filename: *const ::std::os::raw::c_char,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Write a tree sequence to a stream.\n\n@rst\nWrites the data from this tree sequence to the specified FILE stream.\nSemantics are identical to :c:func:`tsk_treeseq_dump`.\n\nPlease see the :ref:`sec_c_api_examples_file_streaming` section for an example\nof how to sequentially dump and load tree sequences from a stream.\n@endrst\n\n@param self A pointer to an initialised tsk_treeseq_t object.\n@param file A FILE stream opened in an appropriate mode for writing (e.g.\n\"w\", \"a\", \"r+\" or \"w+\").\n@param options Bitwise options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_treeseq_dumpf(
self_: *const tsk_treeseq_t,
file: *mut FILE,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Copies the state of the table collection underlying this tree sequence\ninto the specified destination table collection.\n\n@rst\nBy default the method initialises the specified destination table collection. If the\ndestination is already initialised, the :c:macro:`TSK_NO_INIT` option should\nbe supplied to avoid leaking memory.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@param tables A pointer to a tsk_table_collection_t object. If the TSK_NO_INIT\noption is specified, this must be an initialised table collection. If not, it must be an\nuninitialised table collection.\n@param options Bitwise option flags.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_treeseq_copy_tables(
self_: *const tsk_treeseq_t,
tables: *mut tsk_table_collection_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Free the internal memory for the specified tree sequence.\n\n@param self A pointer to an initialised tsk_treeseq_t object.\n@return Always returns 0."]
pub fn tsk_treeseq_free(self_: *mut tsk_treeseq_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Print out the state of this tree sequence to the specified stream.\n\nThis method is intended for debugging purposes and should not be used\nin production code. The format of the output should **not** be depended\non and may change arbitrarily between versions.\n\n@param self A pointer to a tsk_treeseq_t object.\n@param out The stream to write the summary to."]
pub fn tsk_treeseq_print_state(self_: *const tsk_treeseq_t, out: *mut FILE);
}
extern "C" {
#[doc = "@brief Get the number of nodes\n\n@rst\nReturns the number of nodes in this tree sequence.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the number of nodes."]
pub fn tsk_treeseq_get_num_nodes(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
#[doc = "@brief Get the number of edges\n\n@rst\nReturns the number of edges in this tree sequence.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the number of edges."]
pub fn tsk_treeseq_get_num_edges(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
#[doc = "@brief Get the number of migrations\n\n@rst\nReturns the number of migrations in this tree sequence.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the number of migrations."]
pub fn tsk_treeseq_get_num_migrations(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
#[doc = "@brief Get the number of sites\n\n@rst\nReturns the number of sites in this tree sequence.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the number of sites."]
pub fn tsk_treeseq_get_num_sites(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
#[doc = "@brief Get the number of mutations\n\n@rst\nReturns the number of mutations in this tree sequence.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the number of mutations."]
pub fn tsk_treeseq_get_num_mutations(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
#[doc = "@brief Get the number of provenances\n\n@rst\nReturns the number of provenances in this tree sequence.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the number of provenances."]
pub fn tsk_treeseq_get_num_provenances(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
#[doc = "@brief Get the number of populations\n\n@rst\nReturns the number of populations in this tree sequence.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the number of populations."]
pub fn tsk_treeseq_get_num_populations(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
#[doc = "@brief Get the number of individuals\n\n@rst\nReturns the number of individuals in this tree sequence.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the number of individuals."]
pub fn tsk_treeseq_get_num_individuals(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
#[doc = "@brief Return the number of trees in this tree sequence.\n\n@rst\nThis is a constant time operation.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return The number of trees in the tree sequence."]
pub fn tsk_treeseq_get_num_trees(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
#[doc = "@brief Get the number of samples\n\n@rst\nReturns the number of nodes marked as samples in this tree sequence.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the number of samples."]
pub fn tsk_treeseq_get_num_samples(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
#[doc = "@brief Get the top-level tree sequence metadata.\n\n@rst\nReturns a pointer to the metadata string, which is owned by the tree sequence and\nnot null-terminated.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns a pointer to the metadata."]
pub fn tsk_treeseq_get_metadata(self_: *const tsk_treeseq_t) -> *const ::std::os::raw::c_char;
}
extern "C" {
#[doc = "@brief Get the length of top-level tree sequence metadata\n\n@rst\nReturns the length of the metadata string.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the length of the metadata."]
pub fn tsk_treeseq_get_metadata_length(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
#[doc = "@brief Get the top-level tree sequence metadata schema.\n\n@rst\nReturns a pointer to the metadata schema string, which is owned by the tree sequence and\nnot null-terminated.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns a pointer to the metadata schema."]
pub fn tsk_treeseq_get_metadata_schema(
self_: *const tsk_treeseq_t,
) -> *const ::std::os::raw::c_char;
}
extern "C" {
#[doc = "@brief Get the length of the top-level tree sequence metadata schema.\n\n@rst\nReturns the length of the metadata schema string.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the length of the metadata schema."]
pub fn tsk_treeseq_get_metadata_schema_length(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
#[doc = "@brief Get the time units string\n\n@rst\nReturns a pointer to the time units string, which is owned by the tree sequence and\nnot null-terminated.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns a pointer to the time units."]
pub fn tsk_treeseq_get_time_units(self_: *const tsk_treeseq_t)
-> *const ::std::os::raw::c_char;
}
extern "C" {
#[doc = "@brief Get the length of time units string\n@rst\nReturns the length of the time units string.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the length of the time units."]
pub fn tsk_treeseq_get_time_units_length(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
#[doc = "@brief Get the file uuid\n\n@rst\nReturns a pointer to the null-terminated file uuid string, which is owned by the tree\nsequence.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns a pointer to the time units."]
pub fn tsk_treeseq_get_file_uuid(self_: *const tsk_treeseq_t) -> *const ::std::os::raw::c_char;
}
extern "C" {
#[doc = "@brief Get the sequence length\n\n@rst\nReturns the sequence length of this tree sequence\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the sequence length."]
pub fn tsk_treeseq_get_sequence_length(self_: *const tsk_treeseq_t) -> f64;
}
extern "C" {
#[doc = "@brief Get the breakpoints\n\n@rst\nReturns an array of breakpoint locations, the array is owned by the tree sequence.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the pointer to the breakpoint array."]
pub fn tsk_treeseq_get_breakpoints(self_: *const tsk_treeseq_t) -> *const f64;
}
extern "C" {
#[doc = "@brief Get the samples\n\n@rst\nReturns an array of ids of sample nodes in this tree sequence.\nI.e. nodes that have the :c:macro:`TSK_NODE_IS_SAMPLE` flag set.\nThe array is owned by the tree sequence and should not be modified or free'd.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the pointer to the sample node id array."]
pub fn tsk_treeseq_get_samples(self_: *const tsk_treeseq_t) -> *const tsk_id_t;
}
extern "C" {
#[doc = "@brief Get the map of node id to sample index\n\n@rst\nReturns the location of each node in the list of samples or\n:c:macro:`TSK_NULL` for nodes that are not samples.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the pointer to the array of sample indexes."]
pub fn tsk_treeseq_get_sample_index_map(self_: *const tsk_treeseq_t) -> *const tsk_id_t;
}
extern "C" {
#[doc = "@brief Check if a node is a sample\n\n@rst\nReturns the sample status of a given node id.\n@endrst\n@param self A pointer to a tsk_treeseq_t object.\n@param u The id of the node to be checked.\n@return Returns true if the node is a sample."]
pub fn tsk_treeseq_is_sample(self_: *const tsk_treeseq_t, u: tsk_id_t) -> bool;
}
extern "C" {
#[doc = "@brief Get the discrete genome status\n\n@rst\nIf all the genomic locations in the tree sequence are discrete integer values\nthen this flag will be true.\n@endrst\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns true if all genomic locations are discrete."]
pub fn tsk_treeseq_get_discrete_genome(self_: *const tsk_treeseq_t) -> bool;
}
extern "C" {
#[doc = "@brief Get the discrete time status\n\n@rst\nIf all times in the tree sequence are discrete integer values\nthen this flag will be true\n@endrst\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns true if all times are discrete."]
pub fn tsk_treeseq_get_discrete_time(self_: *const tsk_treeseq_t) -> bool;
}
extern "C" {
#[doc = "@brief Get a node by its index\n\n@rst\nCopies a node from this tree sequence to the specified destination.\n@endrst\n@param self A pointer to a tsk_treeseq_t object.\n@param index The node index to copy\n@param node A pointer to a tsk_node_t object.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_treeseq_get_node(
self_: *const tsk_treeseq_t,
index: tsk_id_t,
node: *mut tsk_node_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Get a edge by its index\n\n@rst\nCopies a edge from this tree sequence to the specified destination.\n@endrst\n@param self A pointer to a tsk_treeseq_t object.\n@param index The edge index to copy\n@param edge A pointer to a tsk_edge_t object.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_treeseq_get_edge(
self_: *const tsk_treeseq_t,
index: tsk_id_t,
edge: *mut tsk_edge_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Get a edge by its index\n\n@rst\nCopies a migration from this tree sequence to the specified destination.\n@endrst\n@param self A pointer to a tsk_treeseq_t object.\n@param index The migration index to copy\n@param migration A pointer to a tsk_migration_t object.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_treeseq_get_migration(
self_: *const tsk_treeseq_t,
index: tsk_id_t,
migration: *mut tsk_migration_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Get a site by its index\n\n@rst\nCopies a site from this tree sequence to the specified destination.\n@endrst\n@param self A pointer to a tsk_treeseq_t object.\n@param index The site index to copy\n@param site A pointer to a tsk_site_t object.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_treeseq_get_site(
self_: *const tsk_treeseq_t,
index: tsk_id_t,
site: *mut tsk_site_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Get a mutation by its index\n\n@rst\nCopies a mutation from this tree sequence to the specified destination.\n@endrst\n@param self A pointer to a tsk_treeseq_t object.\n@param index The mutation index to copy\n@param mutation A pointer to a tsk_mutation_t object.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_treeseq_get_mutation(
self_: *const tsk_treeseq_t,
index: tsk_id_t,
mutation: *mut tsk_mutation_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Get a provenance by its index\n\n@rst\nCopies a provenance from this tree sequence to the specified destination.\n@endrst\n@param self A pointer to a tsk_treeseq_t object.\n@param index The provenance index to copy\n@param provenance A pointer to a tsk_provenance_t object.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_treeseq_get_provenance(
self_: *const tsk_treeseq_t,
index: tsk_id_t,
provenance: *mut tsk_provenance_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Get a population by its index\n\n@rst\nCopies a population from this tree sequence to the specified destination.\n@endrst\n@param self A pointer to a tsk_treeseq_t object.\n@param index The population index to copy\n@param population A pointer to a tsk_population_t object.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_treeseq_get_population(
self_: *const tsk_treeseq_t,
index: tsk_id_t,
population: *mut tsk_population_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Get a individual by its index\n\n@rst\nCopies a individual from this tree sequence to the specified destination.\n@endrst\n@param self A pointer to a tsk_treeseq_t object.\n@param index The individual index to copy\n@param individual A pointer to a tsk_individual_t object.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_treeseq_get_individual(
self_: *const tsk_treeseq_t,
index: tsk_id_t,
individual: *mut tsk_individual_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Create a simplified instance of this tree sequence\n\n@rst\nCopies this tree sequence to the specified destination and performs simplification.\nThe destination tree sequence should be uninitialised.\nSimplification transforms the tables to remove redundancy and canonicalise\ntree sequence data. See the :ref:`simplification <sec_simplification>` tutorial for\nmore details.\n\nFor full details and flags see :c:func:`tsk_table_collection_simplify` which performs\nthe same operation in place.\n\n@endrst\n@param self A pointer to a uninitialised tsk_treeseq_t object.\n@param samples Either NULL or an array of num_samples distinct and valid node IDs.\nIf non-null the nodes in this array will be marked as samples in the output.\nIf NULL, the num_samples parameter is ignored and the samples in the output\nwill be the same as the samples in the input. This is equivalent to populating\nthe samples array with all of the sample nodes in the input in increasing\norder of ID.\n@param num_samples The number of node IDs in the input samples array. Ignored\nif the samples array is NULL.\n@param options Simplify options; see above for the available bitwise flags.\nFor the default behaviour, a value of 0 should be provided.\n@param output A pointer to an uninitialised tsk_treeseq_t object.\n@param node_map If not NULL, this array will be filled to define the mapping\nbetween nodes IDs in the table collection before and after simplification.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_treeseq_simplify(
self_: *const tsk_treeseq_t,
samples: *const tsk_id_t,
num_samples: tsk_size_t,
options: tsk_flags_t,
output: *mut tsk_treeseq_t,
node_map: *mut tsk_id_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = " @}"]
pub fn tsk_treeseq_split_edges(
self_: *const tsk_treeseq_t,
time: f64,
flags: tsk_flags_t,
population: tsk_id_t,
metadata: *const ::std::os::raw::c_char,
metadata_length: tsk_size_t,
options: tsk_flags_t,
output: *mut tsk_treeseq_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_treeseq_has_reference_sequence(self_: *const tsk_treeseq_t) -> bool;
}
extern "C" {
pub fn tsk_treeseq_get_individuals_population(
self_: *const tsk_treeseq_t,
output: *mut tsk_id_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_treeseq_get_individuals_time(
self_: *const tsk_treeseq_t,
output: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_treeseq_kc_distance(
self_: *const tsk_treeseq_t,
other: *const tsk_treeseq_t,
lambda_: f64,
result: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_treeseq_genealogical_nearest_neighbours(
self_: *const tsk_treeseq_t,
focal: *const tsk_id_t,
num_focal: tsk_size_t,
reference_sets: *const *const tsk_id_t,
reference_set_size: *const tsk_size_t,
num_reference_sets: tsk_size_t,
options: tsk_flags_t,
ret_array: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_treeseq_mean_descendants(
self_: *const tsk_treeseq_t,
reference_sets: *const *const tsk_id_t,
reference_set_size: *const tsk_size_t,
num_reference_sets: tsk_size_t,
options: tsk_flags_t,
ret_array: *mut f64,
) -> ::std::os::raw::c_int;
}
pub type general_stat_func_t = ::std::option::Option<
unsafe extern "C" fn(
state_dim: tsk_size_t,
state: *const f64,
result_dim: tsk_size_t,
result: *mut f64,
params: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int,
>;
extern "C" {
pub fn tsk_treeseq_general_stat(
self_: *const tsk_treeseq_t,
K: tsk_size_t,
W: *const f64,
M: tsk_size_t,
f: general_stat_func_t,
f_params: *mut ::std::os::raw::c_void,
num_windows: tsk_size_t,
windows: *const f64,
options: tsk_flags_t,
result: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_treeseq_trait_covariance(
self_: *const tsk_treeseq_t,
num_weights: tsk_size_t,
weights: *const f64,
num_windows: tsk_size_t,
windows: *const f64,
options: tsk_flags_t,
result: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_treeseq_trait_correlation(
self_: *const tsk_treeseq_t,
num_weights: tsk_size_t,
weights: *const f64,
num_windows: tsk_size_t,
windows: *const f64,
options: tsk_flags_t,
result: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_treeseq_trait_linear_model(
self_: *const tsk_treeseq_t,
num_weights: tsk_size_t,
weights: *const f64,
num_covariates: tsk_size_t,
covariates: *const f64,
num_windows: tsk_size_t,
windows: *const f64,
options: tsk_flags_t,
result: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_treeseq_diversity(
self_: *const tsk_treeseq_t,
num_sample_sets: tsk_size_t,
sample_set_sizes: *const tsk_size_t,
sample_sets: *const tsk_id_t,
num_windows: tsk_size_t,
windows: *const f64,
options: tsk_flags_t,
result: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_treeseq_segregating_sites(
self_: *const tsk_treeseq_t,
num_sample_sets: tsk_size_t,
sample_set_sizes: *const tsk_size_t,
sample_sets: *const tsk_id_t,
num_windows: tsk_size_t,
windows: *const f64,
options: tsk_flags_t,
result: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_treeseq_Y1(
self_: *const tsk_treeseq_t,
num_sample_sets: tsk_size_t,
sample_set_sizes: *const tsk_size_t,
sample_sets: *const tsk_id_t,
num_windows: tsk_size_t,
windows: *const f64,
options: tsk_flags_t,
result: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_treeseq_allele_frequency_spectrum(
self_: *const tsk_treeseq_t,
num_sample_sets: tsk_size_t,
sample_set_sizes: *const tsk_size_t,
sample_sets: *const tsk_id_t,
num_windows: tsk_size_t,
windows: *const f64,
options: tsk_flags_t,
result: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_treeseq_divergence(
self_: *const tsk_treeseq_t,
num_sample_sets: tsk_size_t,
sample_set_sizes: *const tsk_size_t,
sample_sets: *const tsk_id_t,
num_index_tuples: tsk_size_t,
index_tuples: *const tsk_id_t,
num_windows: tsk_size_t,
windows: *const f64,
options: tsk_flags_t,
result: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_treeseq_Y2(
self_: *const tsk_treeseq_t,
num_sample_sets: tsk_size_t,
sample_set_sizes: *const tsk_size_t,
sample_sets: *const tsk_id_t,
num_index_tuples: tsk_size_t,
index_tuples: *const tsk_id_t,
num_windows: tsk_size_t,
windows: *const f64,
options: tsk_flags_t,
result: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_treeseq_f2(
self_: *const tsk_treeseq_t,
num_sample_sets: tsk_size_t,
sample_set_sizes: *const tsk_size_t,
sample_sets: *const tsk_id_t,
num_index_tuples: tsk_size_t,
index_tuples: *const tsk_id_t,
num_windows: tsk_size_t,
windows: *const f64,
options: tsk_flags_t,
result: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_treeseq_genetic_relatedness(
self_: *const tsk_treeseq_t,
num_sample_sets: tsk_size_t,
sample_set_sizes: *const tsk_size_t,
sample_sets: *const tsk_id_t,
num_index_tuples: tsk_size_t,
index_tuples: *const tsk_id_t,
num_windows: tsk_size_t,
windows: *const f64,
options: tsk_flags_t,
result: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_treeseq_Y3(
self_: *const tsk_treeseq_t,
num_sample_sets: tsk_size_t,
sample_set_sizes: *const tsk_size_t,
sample_sets: *const tsk_id_t,
num_index_tuples: tsk_size_t,
index_tuples: *const tsk_id_t,
num_windows: tsk_size_t,
windows: *const f64,
options: tsk_flags_t,
result: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_treeseq_f3(
self_: *const tsk_treeseq_t,
num_sample_sets: tsk_size_t,
sample_set_sizes: *const tsk_size_t,
sample_sets: *const tsk_id_t,
num_index_tuples: tsk_size_t,
index_tuples: *const tsk_id_t,
num_windows: tsk_size_t,
windows: *const f64,
options: tsk_flags_t,
result: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_treeseq_f4(
self_: *const tsk_treeseq_t,
num_sample_sets: tsk_size_t,
sample_set_sizes: *const tsk_size_t,
sample_sets: *const tsk_id_t,
num_index_tuples: tsk_size_t,
index_tuples: *const tsk_id_t,
num_windows: tsk_size_t,
windows: *const f64,
options: tsk_flags_t,
result: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Initialises the tree by allocating internal memory and associating\nwith the specified tree sequence.\n\n@rst\nThis must be called before any operations are performed on the tree.\n\nThe specified tree sequence object must be initialised, and must be\nvalid for the full lifetime of this tree.\n\nSee the :ref:`sec_c_api_overview_structure` for details on how objects\nare initialised and freed.\n\nThe ``options`` parameter is provided to support future expansions\nof the API. A number of undocumented internal features are controlled\nvia this parameter, and it **must** be set to 0 to ensure that operations\nwork as expected and for compatibility with future versions of tskit.\n@endrst\n\n@param self A pointer to an uninitialised tsk_tree_t object.\n@param tree_sequence A pointer to an initialised tsk_treeseq_t object.\n@param options Allocation time options. Must be 0, or behaviour is undefined.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_tree_init(
self_: *mut tsk_tree_t,
tree_sequence: *const tsk_treeseq_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Free the internal memory for the specified tree.\n\n@param self A pointer to an initialised tsk_tree_t object.\n@return Always returns 0."]
pub fn tsk_tree_free(self_: *mut tsk_tree_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Copies the state of this tree into the specified destination.\n\n@rst\nBy default (``options`` = 0) the method initialises the specified destination\ntree by calling :c:func:`tsk_tree_init`. If the destination is already\ninitialised, the :c:macro:`TSK_NO_INIT` option should be supplied to avoid\nleaking memory. If :c:macro:`TSK_NO_INIT` is supplied and the tree sequence associated\nwith the ``dest`` tree is not equal to the tree sequence associated\nwith ``self``, an error is raised.\n\nThe destination tree will keep a reference to the tree sequence object\nassociated with the source tree, and this tree sequence must be\nvalid for the full lifetime of the destination tree.\n\nOptions**\n\n- :c:macro:`TSK_NO_INIT`\n\nIf :c:macro:`TSK_NO_INIT` is not specified, options for :c:func:`tsk_tree_init`\ncan be provided and will be passed on.\n\n@endrst\n\n@param self A pointer to an initialised tsk_tree_t object.\n@param dest A pointer to a tsk_tree_t object. If the TSK_NO_INIT option\nis specified, this must be an initialised tree. If not, it must\nbe an uninitialised tree.\n@param options Copy and allocation time options. See the notes above for details.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_tree_copy(
self_: *const tsk_tree_t,
dest: *mut tsk_tree_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Seek to the first tree in the sequence.\n\n@rst\nSet the state of this tree to reflect the first tree in parent\ntree sequence.\n@endrst\n\n@param self A pointer to an initialised tsk_tree_t object.\n@return Return TSK_TREE_OK on success; or a negative value if an error occurs."]
pub fn tsk_tree_first(self_: *mut tsk_tree_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Seek to the last tree in the sequence.\n\n@rst\nSet the state of this tree to reflect the last tree in parent\ntree sequence.\n@endrst\n\n@param self A pointer to an initialised tsk_tree_t object.\n@return Return TSK_TREE_OK on success; or a negative value if an error occurs."]
pub fn tsk_tree_last(self_: *mut tsk_tree_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Seek to the next tree in the sequence.\n\n@rst\nSet the state of this tree to reflect the next tree in parent\ntree sequence. If the index of the current tree is ``j``,\nthen the after this operation the index will be ``j + 1``.\n\nCalling :c:func:`tsk_tree_next` a tree in the\n:ref:`null state<sec_c_api_trees_null>` is equivalent to calling\n:c:func:`tsk_tree_first`.\n\nCalling :c:func:`tsk_tree_next` on the last tree in the\nsequence will transform it into the\n:ref:`null state<sec_c_api_trees_null>` (equivalent to\ncalling :c:func:`tsk_tree_clear`).\n\nPlease see the :ref:`sec_c_api_examples_tree_iteration` examples for\nrecommended usage.\n@endrst\n\n@param self A pointer to an initialised tsk_tree_t object.\n@return Return TSK_TREE_OK on successfully transforming to a\nnon-null tree; 0 on successfully transforming into the null\ntree; or a negative value if an error occurs."]
pub fn tsk_tree_next(self_: *mut tsk_tree_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Seek to the previous tree in the sequence.\n\n@rst\nSet the state of this tree to reflect the previous tree in parent\ntree sequence. If the index of the current tree is ``j``,\nthen the after this operation the index will be ``j - 1``.\n\nCalling :c:func:`tsk_tree_prev` a tree in the\n:ref:`null state<sec_c_api_trees_null>` is equivalent to calling\n:c:func:`tsk_tree_last`.\n\nCalling :c:func:`tsk_tree_prev` on the first tree in the\nsequence will transform it into the\n:ref:`null state<sec_c_api_trees_null>` (equivalent to\ncalling :c:func:`tsk_tree_clear`).\n\nPlease see the :ref:`sec_c_api_examples_tree_iteration` examples for\nrecommended usage.\n@endrst\n\n@param self A pointer to an initialised tsk_tree_t object.\n@return Return TSK_TREE_OK on successfully transforming to a\nnon-null tree; 0 on successfully transforming into the null\ntree; or a negative value if an error occurs."]
pub fn tsk_tree_prev(self_: *mut tsk_tree_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Set the tree into the null state.\n\n@rst\nTransform this tree into the :ref:`null state<sec_c_api_trees_null>`.\n@endrst\n\n@param self A pointer to an initialised tsk_tree_t object.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_tree_clear(self_: *mut tsk_tree_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Seek to a particular position on the genome.\n\n@rst\nSet the state of this tree to reflect the tree in parent\ntree sequence covering the specified ``position``. That is, on success\nwe will have ``tree.interval.left <= position`` and\nwe will have ``position < tree.interval.right``.\n\nSeeking to a position currently covered by the tree is\na constant time operation.\n\n.. warning::\nThe current implementation of ``seek`` does **not** provide efficient\nrandom access to arbitrary positions along the genome. However,\nsequentially seeking in either direction is as efficient as calling\n:c:func:`tsk_tree_next` or :c:func:`tsk_tree_prev` directly.\n@endrst\n\n@param self A pointer to an initialised tsk_tree_t object.\n@param position The position in genome coordinates\n@param options Seek options. Currently unused. Set to 0 for compatibility\nwith future versions of tskit.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_tree_seek(
self_: *mut tsk_tree_t,
position: f64,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Returns the number of roots in this tree.\n\n@rst\nSee the :ref:`sec_data_model_tree_roots` section for more information\non how the roots of a tree are defined.\n@endrst\n\n@param self A pointer to an initialised tsk_tree_t object.\n@return Returns the number roots in this tree."]
pub fn tsk_tree_get_num_roots(self_: *const tsk_tree_t) -> tsk_size_t;
}
extern "C" {
#[doc = "@brief Returns the leftmost root in this tree.\n\n@rst\nSee the :ref:`sec_data_model_tree_roots` section for more information\non how the roots of a tree are defined.\n\nThis function is equivalent to ``tree.left_child[tree.virtual_root]``.\n@endrst\n\n@param self A pointer to an initialised tsk_tree_t object.\n@return Returns the leftmost root in the tree."]
pub fn tsk_tree_get_left_root(self_: *const tsk_tree_t) -> tsk_id_t;
}
extern "C" {
#[doc = "@brief Returns the rightmost root in this tree.\n\n@rst\nSee the :ref:`sec_data_model_tree_roots` section for more information\non how the roots of a tree are defined.\n\nThis function is equivalent to ``tree.right_child[tree.virtual_root]``.\n@endrst\n\n@param self A pointer to an initialised tsk_tree_t object.\n@return Returns the rightmost root in the tree."]
pub fn tsk_tree_get_right_root(self_: *const tsk_tree_t) -> tsk_id_t;
}
extern "C" {
#[doc = "@brief Get the list of sites for this tree.\n\n@rst\nGets the list of :c:data:`tsk_site_t` objects in the parent tree sequence\nfor which the position lies within this tree's genomic interval.\n\nThe memory pointed to by the ``sites`` parameter is managed by the\n``tsk_tree_t`` object and must not be altered or freed by client code.\n\n.. code-block:: c\n\nstatic void\nprint_sites(const tsk_tree_t *tree)\n{\nint ret;\ntsk_size_t j, num_sites;\nconst tsk_site_t *sites;\n\nret = tsk_tree_get_sites(tree, &sites, &num_sites);\ncheck_tsk_error(ret);\nfor (j = 0; j < num_sites; j++) {\nprintf(\"position = %f\\n\", sites[j].position);\n}\n}\n\nThis is a constant time operation.\n\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param sites The destination pointer for the list of sites.\n@param sites_length A pointer to a tsk_size_t value in which the number\nof sites is stored.\n@return 0 on success or a negative value on failure."]
pub fn tsk_tree_get_sites(
self_: *const tsk_tree_t,
sites: *mut *const tsk_site_t,
sites_length: *mut tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Return an upper bound on the number of nodes reachable\nfrom the roots of this tree.\n\n@rst\nThis function provides an upper bound on the number of nodes that\ncan be reached in tree traversals, and is intended to be used\nfor memory allocation purposes. If ``num_nodes`` is the number\nof nodes visited in a tree traversal from the\n:ref:`virtual root<sec_data_model_tree_roots>`\n(e.g., ``tsk_tree_preorder_from(tree, tree->virtual_root, nodes,\n&num_nodes)``), the bound ``N`` returned here is guaranteed to\nbe greater than or equal to ``num_nodes``.\n\n.. warning:: The precise value returned is not defined and should\nnot be depended on, as it may change from version-to-version.\n\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@return An upper bound on the number nodes reachable from the roots\nof this tree, or zero if this tree has not been initialised."]
pub fn tsk_tree_get_size_bound(self_: *const tsk_tree_t) -> tsk_size_t;
}
extern "C" {
#[doc = "@brief Print out the state of this tree to the specified stream.\n\nThis method is intended for debugging purposes and should not be used\nin production code. The format of the output should **not** be depended\non and may change arbitrarily between versions.\n\n@param self A pointer to a tsk_tree_t object.\n@param out The stream to write the summary to."]
pub fn tsk_tree_print_state(self_: *const tsk_tree_t, out: *mut FILE);
}
extern "C" {
#[doc = "@brief Returns the parent of the specified node.\n\n@rst\nEquivalent to ``tree.parent[u]`` with bounds checking for the node u.\nPerformance sensitive code which can guarantee that the node u is\nvalid should use the direct array access in preference to this method.\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param u The tree node.\n@param parent A tsk_id_t pointer to store the returned parent node.\n@return 0 on success or a negative value on failure."]
pub fn tsk_tree_get_parent(
self_: *const tsk_tree_t,
u: tsk_id_t,
parent: *mut tsk_id_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Returns the time of the specified node.\n\n@rst\nEquivalent to ``tables->nodes.time[u]`` with bounds checking for the node u.\nPerformance sensitive code which can guarantee that the node u is\nvalid should use the direct array access in preference to this method,\nfor example:\n\n.. code-block:: c\n\nstatic void\nprint_times(const tsk_tree_t *tree)\n{\nint ret;\ntsk_size_t num_nodes, j;\nconst double *node_time = tree->tree_sequence->tables->nodes.time;\ntsk_id_t *nodes = malloc(tsk_tree_get_size_bound(tree) * sizeof(*nodes));\n\nif (nodes == NULL) {\nerrx(EXIT_FAILURE, \"Out of memory\");\n}\nret = tsk_tree_preorder(tree, nodes, &num_nodes);\ncheck_tsk_error(ret);\nfor (j = 0; j < num_nodes; j++) {\nprintf(\"time = %f\\n\", node_time[nodes[j]]);\n}\nfree(nodes);\n}\n\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param u The tree node.\n@param ret_time A double pointer to store the returned node time.\n@return 0 on success or a negative value on failure."]
pub fn tsk_tree_get_time(
self_: *const tsk_tree_t,
u: tsk_id_t,
ret_time: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Return number of nodes on the path from the specified node to root.\n\n@rst\nReturn the number of nodes on the path from u to root, not including u.\nThe depth of a root is therefore zero.\n\nAs a special case, the depth of the\n:ref:`virtual root <sec_data_model_tree_roots>` is defined as -1.\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param u The tree node.\n@param ret_depth An int pointer to store the returned node depth.\n@return 0 on success or a negative value on failure."]
pub fn tsk_tree_get_depth(
self_: *const tsk_tree_t,
u: tsk_id_t,
ret_depth: *mut ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Return the length of the branch ancestral to the specified node.\n\n@rst\nReturn the length of the branch ancestral to the specified node.\nBranch length is defined as difference between the time\nof a node and its parent. The branch length of a root is zero.\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param u The tree node.\n@param ret_branch_length A double pointer to store the returned branch length.\n@return 0 on success or a negative value on failure."]
pub fn tsk_tree_get_branch_length(
self_: *const tsk_tree_t,
u: tsk_id_t,
ret_branch_length: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Computes the sum of the lengths of all branches reachable from\nthe specified node, or from all roots if ``u=TSK_NULL``.\n\n@rst\nReturn the total branch length in a particular subtree or of the\nentire tree. If the specified node is :c:macro:`TSK_NULL` (or the\n:ref:`virtual root<sec_data_model_tree_roots>`)\nthe sum of the lengths of all branches reachable from roots\nis returned. Branch length is defined as difference between the time\nof a node and its parent. The branch length of a root is zero.\n\nNote that if the specified node is internal its branch length is\nnot* included, so that, e.g., the total branch length of a\nleaf node is zero.\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param u The root of the subtree of interest, or ``TSK_NULL`` to return the\ntotal branch length of the tree.\n@param ret_tbl A double pointer to store the returned total branch length.\n@return 0 on success or a negative value on failure."]
pub fn tsk_tree_get_total_branch_length(
self_: *const tsk_tree_t,
u: tsk_id_t,
ret_tbl: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Counts the number of samples in the subtree rooted at a node.\n\n@rst\nReturns the number of samples descending from a particular node,\nincluding the node itself.\n\nThis is a constant time operation.\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param u The tree node.\n@param ret_num_samples A tsk_size_t pointer to store the returned\nnumber of samples.\n@return 0 on success or a negative value on failure."]
pub fn tsk_tree_get_num_samples(
self_: *const tsk_tree_t,
u: tsk_id_t,
ret_num_samples: *mut tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Compute the most recent common ancestor of two nodes.\n\n@rst\nIf two nodes do not share a common ancestor in the current tree, the MRCA\nnode is :c:macro:`TSK_NULL`.\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param u A tree node.\n@param v A tree node.\n@param mrca A tsk_id_t pointer to store the returned most recent common ancestor node.\n@return 0 on success or a negative value on failure."]
pub fn tsk_tree_get_mrca(
self_: *const tsk_tree_t,
u: tsk_id_t,
v: tsk_id_t,
mrca: *mut tsk_id_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Returns true if u is a descendant of v.\n\n@rst\nReturns true if u and v are both valid nodes in the tree sequence\nand v lies on the path from u to root, and false otherwise.\n\nAny node is a descendant of itself.\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param u The descendant node.\n@param v The ancestral node.\n@return true if u is a descendant of v, and false otherwise."]
pub fn tsk_tree_is_descendant(self_: *const tsk_tree_t, u: tsk_id_t, v: tsk_id_t) -> bool;
}
extern "C" {
#[doc = "@brief Fill an array with the nodes of this tree in preorder.\n\n@rst\nPopulate an array with the nodes in this tree in preorder. The array\nmust be pre-allocated and be sufficiently large to hold the array\nof nodes visited. The recommended approach is to use the\n:c:func:`tsk_tree_get_size_bound` function, as in the following example:\n\n.. code-block:: c\n\nstatic void\nprint_preorder(tsk_tree_t *tree)\n{\nint ret;\ntsk_size_t num_nodes, j;\ntsk_id_t *nodes = malloc(tsk_tree_get_size_bound(tree) * sizeof(*nodes));\n\nif (nodes == NULL) {\nerrx(EXIT_FAILURE, \"Out of memory\");\n}\nret = tsk_tree_preorder(tree, nodes, &num_nodes);\ncheck_tsk_error(ret);\nfor (j = 0; j < num_nodes; j++) {\nprintf(\"Visit preorder %lld\\n\", (long long) nodes[j]);\n}\nfree(nodes);\n}\n\n.. seealso::\nSee the :ref:`sec_c_api_examples_tree_traversals` section for\nmore examples.\n\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param nodes The tsk_id_t array to store nodes in. See notes above for\ndetails.\n@param num_nodes A pointer to a tsk_size_t value where we store the number\nof nodes in the traversal.\n@return 0 on success or a negative value on failure."]
pub fn tsk_tree_preorder(
self_: *const tsk_tree_t,
nodes: *mut tsk_id_t,
num_nodes: *mut tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Fill an array with the nodes of this tree starting from a particular node.\n\n@rst\nAs for :c:func:`tsk_tree_preorder` but starting the traversal at a particular node\n(which will be the first node in the traversal list). The\n:ref:`virtual root<sec_data_model_tree_roots>` is a valid input for this function\nand will be treated like any other tree node. The value ``-1`` is a special case,\nin which we visit all nodes reachable from the roots, and equivalent to\ncalling :c:func:`tsk_tree_preorder`.\n\nSee :c:func:`tsk_tree_preorder` for details the requirements for the ``nodes``\narray.\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param root The root of the subtree to traverse, or -1 to visit all nodes.\n@param nodes The tsk_id_t array to store nodes in.\n@param num_nodes A pointer to a tsk_size_t value where we store the number\nof nodes in the traversal.\n@return 0 on success or a negative value on failure."]
pub fn tsk_tree_preorder_from(
self_: *const tsk_tree_t,
root: tsk_id_t,
nodes: *mut tsk_id_t,
num_nodes: *mut tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Fill an array with the nodes of this tree in postorder.\n\n@rst\nPopulate an array with the nodes in this tree in postorder. The array\nmust be pre-allocated and be sufficiently large to hold the array\nof nodes visited. The recommended approach is to use the\n:c:func:`tsk_tree_get_size_bound` function, as in the following example:\n\n.. code-block:: c\n\nstatic void\nprint_postorder(tsk_tree_t *tree)\n{\nint ret;\ntsk_size_t num_nodes, j;\ntsk_id_t *nodes = malloc(tsk_tree_get_size_bound(tree) * sizeof(*nodes));\n\nif (nodes == NULL) {\nerrx(EXIT_FAILURE, \"Out of memory\");\n}\nret = tsk_tree_postorder(tree, nodes, &num_nodes);\ncheck_tsk_error(ret);\nfor (j = 0; j < num_nodes; j++) {\nprintf(\"Visit postorder %lld\\n\", (long long) nodes[j]);\n}\nfree(nodes);\n}\n\n.. seealso::\nSee the :ref:`sec_c_api_examples_tree_traversals` section for\nmore examples.\n\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param nodes The tsk_id_t array to store nodes in. See notes above for\ndetails.\n@param num_nodes A pointer to a tsk_size_t value where we store the number\nof nodes in the traversal.\n@return 0 on success or a negative value on failure."]
pub fn tsk_tree_postorder(
self_: *const tsk_tree_t,
nodes: *mut tsk_id_t,
num_nodes: *mut tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Fill an array with the nodes of this tree starting from a particular node.\n\n@rst\nAs for :c:func:`tsk_tree_postorder` but starting the traversal at a particular node\n(which will be the last node in the traversal list). The\n:ref:`virtual root<sec_data_model_tree_roots>` is a valid input for this function\nand will be treated like any other tree node. The value ``-1`` is a special case,\nin which we visit all nodes reachable from the roots, and equivalent to\ncalling :c:func:`tsk_tree_postorder`.\n\nSee :c:func:`tsk_tree_postorder` for details the requirements for the ``nodes``\narray.\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param root The root of the subtree to traverse, or -1 to visit all nodes.\n@param nodes The tsk_id_t array to store nodes in. See\n:c:func:`tsk_tree_postorder` for more details.\n@param num_nodes A pointer to a tsk_size_t value where we store the number\nof nodes in the traversal.\n@return 0 on success or a negative value on failure."]
pub fn tsk_tree_postorder_from(
self_: *const tsk_tree_t,
root: tsk_id_t,
nodes: *mut tsk_id_t,
num_nodes: *mut tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = " @}"]
pub fn tsk_tree_preorder_samples_from(
self_: *const tsk_tree_t,
root: tsk_id_t,
nodes: *mut tsk_id_t,
num_nodes: *mut tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_tree_set_root_threshold(
self_: *mut tsk_tree_t,
root_threshold: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_tree_get_root_threshold(self_: *const tsk_tree_t) -> tsk_size_t;
}
extern "C" {
pub fn tsk_tree_has_sample_counts(self_: *const tsk_tree_t) -> bool;
}
extern "C" {
pub fn tsk_tree_has_sample_lists(self_: *const tsk_tree_t) -> bool;
}
extern "C" {
pub fn tsk_tree_get_num_tracked_samples(
self_: *const tsk_tree_t,
u: tsk_id_t,
num_tracked_samples: *mut tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_tree_set_tracked_samples(
self_: *mut tsk_tree_t,
num_tracked_samples: tsk_size_t,
tracked_samples: *const tsk_id_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_tree_track_descendant_samples(
self_: *mut tsk_tree_t,
node: tsk_id_t,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_state_transition_t {
pub node: tsk_id_t,
pub parent: tsk_id_t,
pub state: i32,
}
#[test]
fn bindgen_test_layout_tsk_state_transition_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_state_transition_t> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_state_transition_t>(),
12usize,
concat!("Size of: ", stringify!(tsk_state_transition_t))
);
assert_eq!(
::std::mem::align_of::<tsk_state_transition_t>(),
4usize,
concat!("Alignment of ", stringify!(tsk_state_transition_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).node) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_state_transition_t),
"::",
stringify!(node)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).parent) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_state_transition_t),
"::",
stringify!(parent)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_state_transition_t),
"::",
stringify!(state)
)
);
}
extern "C" {
pub fn tsk_tree_map_mutations(
self_: *mut tsk_tree_t,
genotypes: *mut i32,
cost_matrix: *mut f64,
options: tsk_flags_t,
ancestral_state: *mut i32,
num_transitions: *mut tsk_size_t,
transitions: *mut *mut tsk_state_transition_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_tree_kc_distance(
self_: *const tsk_tree_t,
other: *const tsk_tree_t,
lambda: f64,
result: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_tree_sackin_index(
self_: *const tsk_tree_t,
result: *mut tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_tree_colless_index(
self_: *const tsk_tree_t,
result: *mut tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_tree_b1_index(self_: *const tsk_tree_t, result: *mut f64) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_tree_b2_index(
self_: *const tsk_tree_t,
base: f64,
result: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_tree_num_lineages(
self_: *const tsk_tree_t,
t: f64,
result: *mut tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_tree_is_sample(self_: *const tsk_tree_t, u: tsk_id_t) -> bool;
}
extern "C" {
pub fn tsk_tree_equals(self_: *const tsk_tree_t, other: *const tsk_tree_t) -> bool;
}
extern "C" {
pub fn tsk_diff_iter_init(
self_: *mut tsk_diff_iter_t,
tree_sequence: *const tsk_treeseq_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_diff_iter_free(self_: *mut tsk_diff_iter_t) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_diff_iter_next(
self_: *mut tsk_diff_iter_t,
left: *mut f64,
right: *mut f64,
edges_out: *mut tsk_edge_list_t,
edges_in: *mut tsk_edge_list_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_diff_iter_print_state(self_: *const tsk_diff_iter_t, out: *mut FILE);
}
#[doc = "@brief A variant at a specific site.\n\n@rst\nUsed to generate the genotypes for a given set of samples at a given\nsite.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_variant_t {
#[doc = " @brief Unowned reference to the tree sequence of the variant"]
pub tree_sequence: *const tsk_treeseq_t,
#[doc = " @brief The site this variant is currently decoded at"]
pub site: tsk_site_t,
pub tree: tsk_tree_t,
#[doc = " @brief Array of allele strings that the genotypes of the variant refer to\n These are not NULL terminated - use `allele_lengths` for example:.\n `printf(\"%.*s\", (int) var->allele_lengths[j], var->alleles[j]);`"]
pub alleles: *mut *const ::std::os::raw::c_char,
#[doc = " @brief Lengths of the allele strings"]
pub allele_lengths: *mut tsk_size_t,
#[doc = " @brief Length of the allele array"]
pub num_alleles: tsk_size_t,
pub max_alleles: tsk_size_t,
#[doc = " @brief If True the genotypes of isolated nodes have been decoded to the \"missing\"\n genotype. If False they are set to the ancestral state (in the absence of\n mutations above them)"]
pub has_missing_data: bool,
#[doc = " @brief Array of genotypes for the current site"]
pub genotypes: *mut i32,
#[doc = " @brief Number of samples"]
pub num_samples: tsk_size_t,
#[doc = " @brief Array of sample ids used"]
pub samples: *mut tsk_id_t,
pub sample_index_map: *const tsk_id_t,
pub user_alleles: bool,
pub user_alleles_mem: *mut ::std::os::raw::c_char,
pub traversal_stack: *mut tsk_id_t,
pub options: tsk_flags_t,
pub alt_samples: *mut tsk_id_t,
pub alt_sample_index_map: *mut tsk_id_t,
}
#[test]
fn bindgen_test_layout_tsk_variant_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_variant_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_variant_t>(),
400usize,
concat!("Size of: ", stringify!(tsk_variant_t))
);
assert_eq!(
::std::mem::align_of::<tsk_variant_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_variant_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).tree_sequence) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(tree_sequence)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).site) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(site)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).tree) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(tree)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).alleles) as usize - ptr as usize },
280usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(alleles)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).allele_lengths) as usize - ptr as usize },
288usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(allele_lengths)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_alleles) as usize - ptr as usize },
296usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(num_alleles)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_alleles) as usize - ptr as usize },
304usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(max_alleles)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).has_missing_data) as usize - ptr as usize },
312usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(has_missing_data)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).genotypes) as usize - ptr as usize },
320usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(genotypes)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_samples) as usize - ptr as usize },
328usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(num_samples)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).samples) as usize - ptr as usize },
336usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(samples)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).sample_index_map) as usize - ptr as usize },
344usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(sample_index_map)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).user_alleles) as usize - ptr as usize },
352usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(user_alleles)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).user_alleles_mem) as usize - ptr as usize },
360usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(user_alleles_mem)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).traversal_stack) as usize - ptr as usize },
368usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(traversal_stack)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).options) as usize - ptr as usize },
376usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(options)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).alt_samples) as usize - ptr as usize },
384usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(alt_samples)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).alt_sample_index_map) as usize - ptr as usize },
392usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(alt_sample_index_map)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_vargen_t {
pub tree_sequence: *const tsk_treeseq_t,
pub site_index: tsk_id_t,
pub variant: tsk_variant_t,
}
#[test]
fn bindgen_test_layout_tsk_vargen_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_vargen_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_vargen_t>(),
416usize,
concat!("Size of: ", stringify!(tsk_vargen_t))
);
assert_eq!(
::std::mem::align_of::<tsk_vargen_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_vargen_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).tree_sequence) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_vargen_t),
"::",
stringify!(tree_sequence)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).site_index) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_vargen_t),
"::",
stringify!(site_index)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).variant) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_vargen_t),
"::",
stringify!(variant)
)
);
}
extern "C" {
#[doc = "@brief Initialises the variant by allocating the internal memory\n\n@rst\nThis must be called before any operations are performed on the variant.\nSee the :ref:`sec_c_api_overview_structure` for details on how objects\nare initialised and freed.\n@endrst\n\n@param self A pointer to an uninitialised tsk_variant_t object.\n@param tree_sequence A pointer to the tree sequence from which this variant\nwill decode genotypes. No copy is taken, so this tree sequence must persist\nfor the lifetime of the variant.\n@param samples Optional. Either `NULL` or an array of node ids of the samples that are to\nhave their genotypes decoded. A copy of this array will be taken by the variant. If\n`NULL` then the samples from the tree sequence will be used.\n@param num_samples The number of ids in the samples array, ignored if `samples` is `NULL`\n@param alleles Optional. Either ``NULL`` or an array of string alleles with a terminal\n``NULL`` sentinel value.\nIf specified, the genotypes will be decoded to match the index in this allele array.\nIf ``NULL`` then alleles will be automatically determined from the mutations encountered.\n@param options Variant options. Either ``0`` or ``TSK_ISOLATED_NOT_MISSING`` which\nif specified indicates that isolated sample nodes should not be decoded as the \"missing\"\nstate but as the ancestral state (or the state of any mutation above them).\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_variant_init(
self_: *mut tsk_variant_t,
tree_sequence: *const tsk_treeseq_t,
samples: *const tsk_id_t,
num_samples: tsk_size_t,
alleles: *mut *const ::std::os::raw::c_char,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Copies the state of this variant to another variant\n\n@rst\nCopies the site, genotypes and alleles from this variant to another. Note that\nthe other variant should be uninitialised as this method does not free any\nmemory that the other variant owns. After copying `other` is frozen and\nthis restricts it from being further decoded at any site. `self` remains unchanged.\n@endrst\n\n@param self A pointer to an initialised and decoded tsk_variant_t object.\n@param other A pointer to an uninitialised tsk_variant_t object.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_variant_restricted_copy(
self_: *const tsk_variant_t,
other: *mut tsk_variant_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Decode the genotypes at the given site, storing them in this variant.\n\n@rst\nDecodes the genotypes for this variant's samples, indexed to this variant's alleles,\nat the specified site.\nThis method is most efficient at decoding sites in-order, either forwards or backwards\nalong the tree sequence. Resulting genotypes are stored in the ``genotypes`` member of\nthis variant.\n@endrst\n\n@param self A pointer to an initialised tsk_variant_t object.\n@param site_id A valid site id for the tree sequence of this variant.\n@param options Bitwise option flags. Currently unused; should be\nset to zero to ensure compatibility with later versions of `tskit`.\n@return Return 0 on success or a negative value on failure."]
pub fn tsk_variant_decode(
self_: *mut tsk_variant_t,
site_id: tsk_id_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Free the internal memory for the specified variant.\n\n@param self A pointer to an initialised tsk_variant_t object.\n@return Always returns 0."]
pub fn tsk_variant_free(self_: *mut tsk_variant_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Print out the state of this variant to the specified stream.\n\nThis method is intended for debugging purposes and should not be used\nin production code. The format of the output should **not** be depended\non and may change arbitrarily between versions.\n\n@param self A pointer to a tsk_variant_t object.\n@param out The stream to write the summary to."]
pub fn tsk_variant_print_state(self_: *const tsk_variant_t, out: *mut FILE);
}
extern "C" {
#[doc = " @}"]
pub fn tsk_vargen_init(
self_: *mut tsk_vargen_t,
tree_sequence: *const tsk_treeseq_t,
samples: *const tsk_id_t,
num_samples: tsk_size_t,
alleles: *mut *const ::std::os::raw::c_char,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_vargen_next(
self_: *mut tsk_vargen_t,
variant: *mut *mut tsk_variant_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_vargen_free(self_: *mut tsk_vargen_t) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_vargen_print_state(self_: *const tsk_vargen_t, out: *mut FILE);
}
extern "C" {
pub fn tsk_convert_newick(
tree: *const tsk_tree_t,
root: tsk_id_t,
precision: ::std::os::raw::c_uint,
options: tsk_flags_t,
buffer_size: usize,
buffer: *mut ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_ld_calc_t {
pub tree_sequence: *const tsk_treeseq_t,
pub focal_site: tsk_site_t,
pub total_samples: tsk_size_t,
pub focal_samples: tsk_size_t,
pub max_distance: f64,
pub max_sites: tsk_size_t,
pub tree: tsk_tree_t,
pub sample_buffer: *mut tsk_id_t,
pub result: *mut f64,
pub result_length: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_ld_calc_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_ld_calc_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_ld_calc_t>(),
336usize,
concat!("Size of: ", stringify!(tsk_ld_calc_t))
);
assert_eq!(
::std::mem::align_of::<tsk_ld_calc_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_ld_calc_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).tree_sequence) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_ld_calc_t),
"::",
stringify!(tree_sequence)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).focal_site) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_ld_calc_t),
"::",
stringify!(focal_site)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).total_samples) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(tsk_ld_calc_t),
"::",
stringify!(total_samples)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).focal_samples) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(tsk_ld_calc_t),
"::",
stringify!(focal_samples)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_distance) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(tsk_ld_calc_t),
"::",
stringify!(max_distance)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_sites) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(tsk_ld_calc_t),
"::",
stringify!(max_sites)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).tree) as usize - ptr as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(tsk_ld_calc_t),
"::",
stringify!(tree)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).sample_buffer) as usize - ptr as usize },
312usize,
concat!(
"Offset of field: ",
stringify!(tsk_ld_calc_t),
"::",
stringify!(sample_buffer)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).result) as usize - ptr as usize },
320usize,
concat!(
"Offset of field: ",
stringify!(tsk_ld_calc_t),
"::",
stringify!(result)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).result_length) as usize - ptr as usize },
328usize,
concat!(
"Offset of field: ",
stringify!(tsk_ld_calc_t),
"::",
stringify!(result_length)
)
);
}
extern "C" {
pub fn tsk_ld_calc_init(
self_: *mut tsk_ld_calc_t,
tree_sequence: *const tsk_treeseq_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_ld_calc_free(self_: *mut tsk_ld_calc_t) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_ld_calc_print_state(self_: *const tsk_ld_calc_t, out: *mut FILE);
}
extern "C" {
pub fn tsk_ld_calc_get_r2(
self_: *mut tsk_ld_calc_t,
a: tsk_id_t,
b: tsk_id_t,
r2: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_ld_calc_get_r2_array(
self_: *mut tsk_ld_calc_t,
a: tsk_id_t,
direction: ::std::os::raw::c_int,
max_sites: tsk_size_t,
max_distance: f64,
r2: *mut f64,
num_r2_values: *mut tsk_size_t,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_value_transition_t {
pub tree_node: tsk_id_t,
pub value_index: tsk_id_t,
pub value: f64,
}
#[test]
fn bindgen_test_layout_tsk_value_transition_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_value_transition_t> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_value_transition_t>(),
16usize,
concat!("Size of: ", stringify!(tsk_value_transition_t))
);
assert_eq!(
::std::mem::align_of::<tsk_value_transition_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_value_transition_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).tree_node) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_value_transition_t),
"::",
stringify!(tree_node)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).value_index) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_value_transition_t),
"::",
stringify!(value_index)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_value_transition_t),
"::",
stringify!(value)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_argsort_t {
pub index: tsk_size_t,
pub value: f64,
}
#[test]
fn bindgen_test_layout_tsk_argsort_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_argsort_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_argsort_t>(),
16usize,
concat!("Size of: ", stringify!(tsk_argsort_t))
);
assert_eq!(
::std::mem::align_of::<tsk_argsort_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_argsort_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).index) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_argsort_t),
"::",
stringify!(index)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_argsort_t),
"::",
stringify!(value)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_transition_stack_t {
pub tree_node: tsk_id_t,
pub old_state: tsk_id_t,
pub new_state: tsk_id_t,
pub transition_parent: tsk_id_t,
}
#[test]
fn bindgen_test_layout_tsk_transition_stack_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_transition_stack_t> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_transition_stack_t>(),
16usize,
concat!("Size of: ", stringify!(tsk_transition_stack_t))
);
assert_eq!(
::std::mem::align_of::<tsk_transition_stack_t>(),
4usize,
concat!("Alignment of ", stringify!(tsk_transition_stack_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).tree_node) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_transition_stack_t),
"::",
stringify!(tree_node)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).old_state) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_transition_stack_t),
"::",
stringify!(old_state)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).new_state) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_transition_stack_t),
"::",
stringify!(new_state)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).transition_parent) as usize - ptr as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(tsk_transition_stack_t),
"::",
stringify!(transition_parent)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_site_probability_t {
pub normalisation_factor: f64,
pub value: *mut f64,
pub node: *mut tsk_id_t,
pub num_values: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_site_probability_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_site_probability_t> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_site_probability_t>(),
32usize,
concat!("Size of: ", stringify!(tsk_site_probability_t))
);
assert_eq!(
::std::mem::align_of::<tsk_site_probability_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_site_probability_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).normalisation_factor) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_probability_t),
"::",
stringify!(normalisation_factor)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_probability_t),
"::",
stringify!(value)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).node) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_probability_t),
"::",
stringify!(node)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_values) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_probability_t),
"::",
stringify!(num_values)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_compressed_matrix_t {
pub tree_sequence: *mut tsk_treeseq_t,
pub options: tsk_flags_t,
pub num_sites: tsk_size_t,
pub num_samples: tsk_size_t,
pub normalisation_factor: *mut f64,
pub num_transitions: *mut tsk_size_t,
pub values: *mut *mut f64,
pub nodes: *mut *mut tsk_id_t,
pub memory: tsk_blkalloc_t,
}
#[test]
fn bindgen_test_layout_tsk_compressed_matrix_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_compressed_matrix_t> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_compressed_matrix_t>(),
120usize,
concat!("Size of: ", stringify!(tsk_compressed_matrix_t))
);
assert_eq!(
::std::mem::align_of::<tsk_compressed_matrix_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_compressed_matrix_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).tree_sequence) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_compressed_matrix_t),
"::",
stringify!(tree_sequence)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).options) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_compressed_matrix_t),
"::",
stringify!(options)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_sites) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_compressed_matrix_t),
"::",
stringify!(num_sites)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_samples) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_compressed_matrix_t),
"::",
stringify!(num_samples)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).normalisation_factor) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_compressed_matrix_t),
"::",
stringify!(normalisation_factor)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_transitions) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_compressed_matrix_t),
"::",
stringify!(num_transitions)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).values) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_compressed_matrix_t),
"::",
stringify!(values)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).nodes) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_compressed_matrix_t),
"::",
stringify!(nodes)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).memory) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_compressed_matrix_t),
"::",
stringify!(memory)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_recomb_required_record {
pub site: tsk_id_t,
pub node: tsk_id_t,
pub required: bool,
}
#[test]
fn bindgen_test_layout_tsk_recomb_required_record() {
const UNINIT: ::std::mem::MaybeUninit<tsk_recomb_required_record> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_recomb_required_record>(),
12usize,
concat!("Size of: ", stringify!(tsk_recomb_required_record))
);
assert_eq!(
::std::mem::align_of::<tsk_recomb_required_record>(),
4usize,
concat!("Alignment of ", stringify!(tsk_recomb_required_record))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).site) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_recomb_required_record),
"::",
stringify!(site)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).node) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_recomb_required_record),
"::",
stringify!(node)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).required) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_recomb_required_record),
"::",
stringify!(required)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_viterbi_matrix_t {
pub matrix: tsk_compressed_matrix_t,
pub recombination_required: *mut tsk_recomb_required_record,
pub num_recomb_records: tsk_size_t,
pub max_recomb_records: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_viterbi_matrix_t() {
const UNINIT: ::std::mem::MaybeUninit<tsk_viterbi_matrix_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<tsk_viterbi_matrix_t>(),
144usize,
concat!("Size of: ", stringify!(tsk_viterbi_matrix_t))
);
assert_eq!(
::std::mem::align_of::<tsk_viterbi_matrix_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_viterbi_matrix_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).matrix) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_viterbi_matrix_t),
"::",
stringify!(matrix)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).recombination_required) as usize - ptr as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(tsk_viterbi_matrix_t),
"::",
stringify!(recombination_required)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_recomb_records) as usize - ptr as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(tsk_viterbi_matrix_t),
"::",
stringify!(num_recomb_records)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_recomb_records) as usize - ptr as usize },
136usize,
concat!(
"Offset of field: ",
stringify!(tsk_viterbi_matrix_t),
"::",
stringify!(max_recomb_records)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _tsk_ls_hmm_t {
pub tree_sequence: *mut tsk_treeseq_t,
pub recombination_rate: *mut f64,
pub mutation_rate: *mut f64,
pub alleles: *mut *mut *const ::std::os::raw::c_char,
pub precision: ::std::os::raw::c_uint,
pub num_alleles: *mut u32,
pub num_samples: tsk_size_t,
pub num_sites: tsk_size_t,
pub num_nodes: tsk_size_t,
pub tree: tsk_tree_t,
pub diffs: tsk_diff_iter_t,
pub parent: *mut tsk_id_t,
pub transitions: *mut tsk_value_transition_t,
pub transitions_copy: *mut tsk_value_transition_t,
pub transition_stack: *mut tsk_transition_stack_t,
pub transition_index: *mut tsk_id_t,
pub transition_time_order: *mut tsk_argsort_t,
pub num_transitions: tsk_size_t,
pub max_transitions: tsk_size_t,
pub values: *mut f64,
pub num_values: tsk_size_t,
pub max_values: tsk_size_t,
pub max_parsimony_words: tsk_size_t,
pub num_optimal_value_set_words: tsk_size_t,
pub optimal_value_sets: *mut u64,
pub transition_parent: *mut tsk_id_t,
pub num_transition_samples: *mut tsk_size_t,
pub allelic_state: *mut i32,
pub next_probability: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut _tsk_ls_hmm_t,
arg2: tsk_id_t,
arg3: f64,
arg4: bool,
arg5: tsk_id_t,
arg6: *mut f64,
) -> ::std::os::raw::c_int,
>,
pub compute_normalisation_factor:
::std::option::Option<unsafe extern "C" fn(arg1: *mut _tsk_ls_hmm_t) -> f64>,
pub output: *mut ::std::os::raw::c_void,
}
#[test]
fn bindgen_test_layout__tsk_ls_hmm_t() {
const UNINIT: ::std::mem::MaybeUninit<_tsk_ls_hmm_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<_tsk_ls_hmm_t>(),
496usize,
concat!("Size of: ", stringify!(_tsk_ls_hmm_t))
);
assert_eq!(
::std::mem::align_of::<_tsk_ls_hmm_t>(),
8usize,
concat!("Alignment of ", stringify!(_tsk_ls_hmm_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).tree_sequence) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(tree_sequence)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).recombination_rate) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(recombination_rate)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).mutation_rate) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(mutation_rate)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).alleles) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(alleles)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).precision) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(precision)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_alleles) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(num_alleles)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_samples) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(num_samples)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_sites) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(num_sites)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_nodes) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(num_nodes)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).tree) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(tree)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).diffs) as usize - ptr as usize },
280usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(diffs)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).parent) as usize - ptr as usize },
336usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(parent)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).transitions) as usize - ptr as usize },
344usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(transitions)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).transitions_copy) as usize - ptr as usize },
352usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(transitions_copy)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).transition_stack) as usize - ptr as usize },
360usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(transition_stack)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).transition_index) as usize - ptr as usize },
368usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(transition_index)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).transition_time_order) as usize - ptr as usize },
376usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(transition_time_order)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_transitions) as usize - ptr as usize },
384usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(num_transitions)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_transitions) as usize - ptr as usize },
392usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(max_transitions)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).values) as usize - ptr as usize },
400usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(values)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_values) as usize - ptr as usize },
408usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(num_values)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_values) as usize - ptr as usize },
416usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(max_values)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_parsimony_words) as usize - ptr as usize },
424usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(max_parsimony_words)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_optimal_value_set_words) as usize - ptr as usize },
432usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(num_optimal_value_set_words)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).optimal_value_sets) as usize - ptr as usize },
440usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(optimal_value_sets)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).transition_parent) as usize - ptr as usize },
448usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(transition_parent)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_transition_samples) as usize - ptr as usize },
456usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(num_transition_samples)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).allelic_state) as usize - ptr as usize },
464usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(allelic_state)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).next_probability) as usize - ptr as usize },
472usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(next_probability)
)
);
assert_eq!(
unsafe {
::std::ptr::addr_of!((*ptr).compute_normalisation_factor) as usize - ptr as usize
},
480usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(compute_normalisation_factor)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).output) as usize - ptr as usize },
488usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(output)
)
);
}
pub type tsk_ls_hmm_t = _tsk_ls_hmm_t;
extern "C" {
pub fn tsk_ls_hmm_init(
self_: *mut tsk_ls_hmm_t,
tree_sequence: *mut tsk_treeseq_t,
recombination_rate: *mut f64,
mutation_rate: *mut f64,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_ls_hmm_set_precision(
self_: *mut tsk_ls_hmm_t,
precision: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_ls_hmm_free(self_: *mut tsk_ls_hmm_t) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_ls_hmm_print_state(self_: *mut tsk_ls_hmm_t, out: *mut FILE);
}
extern "C" {
pub fn tsk_ls_hmm_forward(
self_: *mut tsk_ls_hmm_t,
haplotype: *mut i32,
output: *mut tsk_compressed_matrix_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_ls_hmm_viterbi(
self_: *mut tsk_ls_hmm_t,
haplotype: *mut i32,
output: *mut tsk_viterbi_matrix_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_ls_hmm_run(
self_: *mut tsk_ls_hmm_t,
haplotype: *mut i32,
next_probability: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut tsk_ls_hmm_t,
arg2: tsk_id_t,
arg3: f64,
arg4: bool,
arg5: tsk_id_t,
arg6: *mut f64,
) -> ::std::os::raw::c_int,
>,
compute_normalisation_factor: ::std::option::Option<
unsafe extern "C" fn(arg1: *mut _tsk_ls_hmm_t) -> f64,
>,
output: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_compressed_matrix_init(
self_: *mut tsk_compressed_matrix_t,
tree_sequence: *mut tsk_treeseq_t,
block_size: tsk_size_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_compressed_matrix_free(self_: *mut tsk_compressed_matrix_t)
-> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_compressed_matrix_clear(
self_: *mut tsk_compressed_matrix_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_compressed_matrix_print_state(self_: *mut tsk_compressed_matrix_t, out: *mut FILE);
}
extern "C" {
pub fn tsk_compressed_matrix_store_site(
self_: *mut tsk_compressed_matrix_t,
site: tsk_id_t,
normalisation_factor: f64,
num_transitions: tsk_size_t,
transitions: *const tsk_value_transition_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_compressed_matrix_decode(
self_: *mut tsk_compressed_matrix_t,
values: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_viterbi_matrix_init(
self_: *mut tsk_viterbi_matrix_t,
tree_sequence: *mut tsk_treeseq_t,
block_size: tsk_size_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_viterbi_matrix_free(self_: *mut tsk_viterbi_matrix_t) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_viterbi_matrix_clear(self_: *mut tsk_viterbi_matrix_t) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_viterbi_matrix_print_state(self_: *mut tsk_viterbi_matrix_t, out: *mut FILE);
}
extern "C" {
pub fn tsk_viterbi_matrix_add_recombination_required(
self_: *mut tsk_viterbi_matrix_t,
site: tsk_id_t,
node: tsk_id_t,
required: bool,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_viterbi_matrix_traceback(
self_: *mut tsk_viterbi_matrix_t,
path: *mut tsk_id_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}