pub const TSK_UNKNOWN_TIME_HEX: u64 = 9221248276113224737;
pub const TSK_VERSION_MAJOR: u32 = 0;
pub const TSK_VERSION_MINOR: u32 = 99;
pub const TSK_VERSION_PATCH: u32 = 9;
pub const TSK_NODE_IS_SAMPLE: u32 = 1;
pub const TSK_MISSING_DATA: i32 = -1;
pub const TSK_FILE_FORMAT_NAME: &'static [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 = 3;
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_OFFSET: i32 = -200;
pub const TSK_ERR_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_INCONSISTENT_MUTATIONS: i32 = -503;
pub const TSK_ERR_UNSORTED_MUTATIONS: i32 = -505;
pub const TSK_ERR_NON_SINGLE_CHAR_MUTATION: i32 = -506;
pub const TSK_ERR_MUTATION_TIME_YOUNGER_THAN_NODE: i32 = -507;
pub const TSK_ERR_MUTATION_TIME_OLDER_THAN_PARENT_MUTATION: i32 = -508;
pub const TSK_ERR_MUTATION_TIME_OLDER_THAN_PARENT_NODE: i32 = -509;
pub const TSK_ERR_MUTATION_TIME_HAS_BOTH_KNOWN_AND_UNKNOWN: i32 = -510;
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_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_UNION_NOT_SUPPORTED: i32 = -806;
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_GENOTYPES_ALL_MISSING: i32 = -1000;
pub const TSK_ERR_BAD_GENOTYPE: i32 = -1001;
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_NO_SAMPLE_PAIRS: i32 = -1500;
pub const TSK_ERR_DUPLICATE_SAMPLE_PAIRS: i32 = -1501;
pub const TSK_KAS_ERR_BIT: u32 = 14;
pub const TSK_BUG_ASSERT_MESSAGE : & 'static [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_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 = 0;
pub const KAS_VERSION_PATCH: u32 = 0;
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 TSK_DEBUG: u32 = 2147483648;
pub const TSK_NO_INIT: u32 = 1073741824;
pub const TSK_NO_CHECK_INTEGRITY: u32 = 536870912;
pub const TSK_FILTER_SITES: u32 = 1;
pub const TSK_FILTER_POPULATIONS: u32 = 2;
pub const TSK_FILTER_INDIVIDUALS: u32 = 4;
pub const TSK_REDUCE_TO_SITE_TOPOLOGY: u32 = 8;
pub const TSK_KEEP_UNARY: u32 = 16;
pub const TSK_KEEP_INPUT_ROOTS: u32 = 32;
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_INDEXES: u32 = 16;
pub const TSK_CHECK_TREES: u32 = 32;
pub const TSK_NO_CHECK_POPULATION_REFS: u32 = 1024;
pub const TSK_NO_BUILD_INDEXES: u32 = 1;
pub const TSK_BUILD_INDEXES: u32 = 1;
pub const TSK_NO_EDGE_METADATA: u32 = 1;
pub const TSK_NO_METADATA: 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_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_SAMPLE_COUNTS: u32 = 1;
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_DIR_FORWARD: u32 = 1;
pub const TSK_DIR_REVERSE: i32 = -1;
pub const TSK_INCLUDE_TERMINAL: u32 = 1;
pub const TSK_16_BIT_GENOTYPES: u32 = 1;
pub const TSK_ISOLATED_NOT_MISSING: u32 = 2;
pub const TSK_ALLELES_ACGT: u32 = 65536;
pub type __int8_t = ::std::os::raw::c_schar;
pub type __uint8_t = ::std::os::raw::c_uchar;
pub type __int16_t = ::std::os::raw::c_short;
pub type __uint16_t = ::std::os::raw::c_ushort;
pub type __int32_t = ::std::os::raw::c_int;
pub type __uint32_t = ::std::os::raw::c_uint;
pub type __int64_t = ::std::os::raw::c_long;
pub type __uint64_t = ::std::os::raw::c_ulong;
pub type __off_t = ::std::os::raw::c_long;
pub type __off64_t = ::std::os::raw::c_long;
pub type size_t = ::std::os::raw::c_ulong;
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: size_t,
pub _mode: ::std::os::raw::c_int,
pub _unused2: [::std::os::raw::c_char; 20usize],
}
#[test]
fn bindgen_test_layout__IO_FILE() {
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::null::<_IO_FILE>()))._flags as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_flags)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_read_ptr as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_read_ptr)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_read_end as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_read_end)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_read_base as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_read_base)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_write_base as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_write_base)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_write_ptr as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_write_ptr)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_write_end as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_write_end)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_buf_base as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_buf_base)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_buf_end as *const _ as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_buf_end)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_save_base as *const _ as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_save_base)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_backup_base as *const _ as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_backup_base)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_save_end as *const _ as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_save_end)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._markers as *const _ as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_markers)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._chain as *const _ as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_chain)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._fileno as *const _ as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_fileno)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._flags2 as *const _ as usize },
116usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_flags2)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._old_offset as *const _ as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_old_offset)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._cur_column as *const _ as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_cur_column)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._vtable_offset as *const _ as usize },
130usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_vtable_offset)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._shortbuf as *const _ as usize },
131usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_shortbuf)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._lock as *const _ as usize },
136usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_lock)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._offset as *const _ as usize },
144usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_offset)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._codecvt as *const _ as usize },
152usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_codecvt)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._wide_data as *const _ as usize },
160usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_wide_data)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._freeres_list as *const _ as usize },
168usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_freeres_list)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._freeres_buf as *const _ as usize },
176usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_freeres_buf)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>())).__pad5 as *const _ as usize },
184usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(__pad5)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._mode as *const _ as usize },
192usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_mode)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._unused2 as *const _ as usize },
196usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_unused2)
)
);
}
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" {
#[doc = "@brief Return a description of the specified error."]
#[doc = ""]
#[doc = "The memory for the returned string is handled by the library and should"]
#[doc = "not be freed by client code."]
#[doc = ""]
#[doc = "@param err A tskit error code."]
#[doc = "@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: size_t,
pub top: size_t,
pub current_chunk: size_t,
pub total_size: size_t,
pub total_allocated: size_t,
pub num_chunks: size_t,
pub mem_chunks: *mut *mut ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_tsk_blkalloc_t() {
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::null::<tsk_blkalloc_t>())).chunk_size as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_blkalloc_t),
"::",
stringify!(chunk_size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_blkalloc_t>())).top as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_blkalloc_t),
"::",
stringify!(top)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_blkalloc_t>())).current_chunk as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_blkalloc_t),
"::",
stringify!(current_chunk)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_blkalloc_t>())).total_size as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_blkalloc_t),
"::",
stringify!(total_size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_blkalloc_t>())).total_allocated as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_blkalloc_t),
"::",
stringify!(total_allocated)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_blkalloc_t>())).num_chunks as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_blkalloc_t),
"::",
stringify!(num_chunks)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_blkalloc_t>())).mem_chunks as *const _ 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: size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_blkalloc_get(
self_: *mut tsk_blkalloc_t,
size: size_t,
) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn tsk_blkalloc_free(self_: *mut tsk_blkalloc_t);
}
extern "C" {
pub fn tsk_search_sorted(array: *const f64, size: size_t, value: f64) -> size_t;
}
extern "C" {
pub fn tsk_round(x: f64, ndigits: ::std::os::raw::c_uint) -> f64;
}
extern "C" {
pub fn tsk_is_unknown_time(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;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct kaitem_t {
pub type_: ::std::os::raw::c_int,
pub key_len: size_t,
pub array_len: size_t,
pub key: *mut ::std::os::raw::c_char,
pub array: *mut ::std::os::raw::c_void,
pub key_start: size_t,
pub array_start: size_t,
}
#[test]
fn bindgen_test_layout_kaitem_t() {
assert_eq!(
::std::mem::size_of::<kaitem_t>(),
56usize,
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::null::<kaitem_t>())).type_ as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(kaitem_t),
"::",
stringify!(type_)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<kaitem_t>())).key_len as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(kaitem_t),
"::",
stringify!(key_len)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<kaitem_t>())).array_len as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(kaitem_t),
"::",
stringify!(array_len)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<kaitem_t>())).key as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(kaitem_t),
"::",
stringify!(key)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<kaitem_t>())).array as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(kaitem_t),
"::",
stringify!(array)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<kaitem_t>())).key_start as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(kaitem_t),
"::",
stringify!(key_start)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<kaitem_t>())).array_start as *const _ as usize },
48usize,
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: size_t,
pub items: *mut kaitem_t,
pub file: *mut FILE,
pub file_size: size_t,
pub file_offset: ::std::os::raw::c_long,
pub read_buffer: *mut ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_kastore_t() {
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::null::<kastore_t>())).flags as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(kastore_t),
"::",
stringify!(flags)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<kastore_t>())).mode as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(kastore_t),
"::",
stringify!(mode)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<kastore_t>())).file_version as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(kastore_t),
"::",
stringify!(file_version)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<kastore_t>())).num_items as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(kastore_t),
"::",
stringify!(num_items)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<kastore_t>())).items as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(kastore_t),
"::",
stringify!(items)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<kastore_t>())).file as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(kastore_t),
"::",
stringify!(file)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<kastore_t>())).file_size as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(kastore_t),
"::",
stringify!(file_size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<kastore_t>())).file_offset as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(kastore_t),
"::",
stringify!(file_offset)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<kastore_t>())).read_buffer as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(kastore_t),
"::",
stringify!(read_buffer)
)
);
}
extern "C" {
#[doc = "@brief Open a store from a given file in read (\"r\"), write (\"w\") or"]
#[doc = "append (\"a\") mode."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "In read mode, a store can be queried using the :ref:`get functions"]
#[doc = "<sec_c_api_get>` and any attempts to write to the store will return an error."]
#[doc = "In write and append mode, the store can written to using the :ref:`put"]
#[doc = "functions <sec_c_api_put>` and any attempt to read will return an error."]
#[doc = ""]
#[doc = "After :c:func:`kastore_open` has been called on a particular store,"]
#[doc = ":c:func:`kastore_close` must be called to avoid leaking memory. This must also"]
#[doc = "be done when :c:func:`kastore_open` returns an error."]
#[doc = ""]
#[doc = "When opened in read-mode, the default is to read key/array values from file"]
#[doc = "on demand. This is useful when a subset of the data is required and we don't"]
#[doc = "wish to read the entire file. If the entire file is to be read, the"]
#[doc = "``KAS_READ_ALL`` flag may be specified to improve performance."]
#[doc = ""]
#[doc = "Flags**"]
#[doc = ""]
#[doc = "KAS_READ_ALL"]
#[doc = "If this option is specified, read the entire file at"]
#[doc = "open time. This will give slightly better performance as the file can"]
#[doc = "be read sequentially in a single pass."]
#[doc = ""]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a kastore object."]
#[doc = "@param filename The file path to open."]
#[doc = "@param mode The open mode: can be read (\"r\"), write (\"w\") or append (\"a\")."]
#[doc = "@param flags The open flags."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Behaviour, mode and flags follow that of :c:func:`kastore_open`,"]
#[doc = "except append mode is not supported."]
#[doc = "The ``file`` argument must be opened in an appropriate mode (e.g. \"r\""]
#[doc = "for a kastore in \"r\" mode). Files open with other modes will result"]
#[doc = "in KAS_ERR_IO being returned when read/write operations are attempted."]
#[doc = ""]
#[doc = "The FILE will not be closed when :c:func:`kastore_close` is called."]
#[doc = "If the KAS_READ_ALL flag is supplied, no ``seek`` operations will be"]
#[doc = "performed on the FILE and so streams such as stdin, FIFOs etc are"]
#[doc = "supported. The FILE pointer will be positioned exactly at the end"]
#[doc = "of the kastore encoded bytes once reading is completed, and reading"]
#[doc = "multiple stores from the same FILE sequentially is fully supported."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a kastore object."]
#[doc = "@param file The FILE* to read/write the store from/to."]
#[doc = "@param mode The open mode: can be read (\"r\") or write (\"w\")."]
#[doc = "@param flags The open flags."]
#[doc = "@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."]
#[doc = ""]
#[doc = "Any store that has been opened must be closed to avoid memory leaks"]
#[doc = "(including cases in which errors have occured). It is not an error to"]
#[doc = "call ``kastore_close`` multiple times on the same object, but"]
#[doc = "``kastore_open`` must be called before ``kastore_close``."]
#[doc = ""]
#[doc = "@param self A pointer to a kastore object."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Queries the store for the specified key and returns 1 if it exists. If the"]
#[doc = "key does not exist, 0 is returned. If an error occurs (for example, if querying"]
#[doc = "the store while it is in write-mode), a negative value is returned."]
#[doc = ""]
#[doc = "For keys that are standard NULL terminated strings, the :c:func:`kastore_containss`"]
#[doc = "function may be more convenient."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a kastore object."]
#[doc = "@param key The key."]
#[doc = "@param key_len The length of the key."]
#[doc = "@return Return 1 if the key is present and 0 if it does not. If an error occurs,"]
#[doc = "return a negative value."]
pub fn kastore_contains(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
key_len: size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Return 1 if the store contains the specified NULL terminated key"]
#[doc = "and 0 if it does not."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Queries the store for the specified key, which must be a NULL terminated string,"]
#[doc = "and returns 1 if it exists. If the"]
#[doc = "key does not exist, 0 is returned. If an error occurs (for example, if querying"]
#[doc = "the store while it is in write-mode), a negative value is returned."]
#[doc = "the array in the specified destination pointers."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a kastore object."]
#[doc = "@param key The key."]
#[doc = "@return Return 1 if the key is present and 0 if it does not. If an error occurs,"]
#[doc = "return 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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Queries the store for the specified key and stores pointers to the memory for"]
#[doc = "the corresponding array, the number of elements in this array and the type of"]
#[doc = "the array in the specified destination pointers. This is the most general form"]
#[doc = "of ``get`` query in kastore, as non NULL-terminated strings can be used as"]
#[doc = "keys and the resulting array is returned in a generic pointer. When standard C"]
#[doc = "strings are used as keys and the type of the array is known, it is more"]
#[doc = "convenient to use the :ref:`typed variants <sec_c_api_typed_get>` of this function."]
#[doc = ""]
#[doc = "The returned array points to memory that is internally managed by the store"]
#[doc = "and must not be freed or modified. The pointer is guaranteed to be valid"]
#[doc = "until :c:func:`kastore_close` is called."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a kastore object."]
#[doc = "@param key The key."]
#[doc = "@param key_len The length of the key."]
#[doc = "@param array The destination pointer for the array."]
#[doc = "@param array_len The destination pointer for the number of elements"]
#[doc = "in the array."]
#[doc = "@param type The destination pointer for the type code of the array."]
#[doc = "@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: size_t,
array: *mut *mut ::std::os::raw::c_void,
array_len: *mut size_t,
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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "As for :c:func:`kastore_get()` except the key is a NULL-terminated string."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a kastore object."]
#[doc = "@param key The key."]
#[doc = "@param array The destination pointer for the array."]
#[doc = "@param array_len The destination pointer for the number of elements"]
#[doc = "in the array."]
#[doc = "@param type The destination pointer for the type code of the array."]
#[doc = "@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 size_t,
type_: *mut ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@defgroup TYPED_GETS_GROUP Typed get functions."]
#[doc = "@{"]
pub fn kastore_gets_int8(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *mut *mut i8,
array_len: *mut size_t,
) -> ::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 size_t,
) -> ::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 size_t,
) -> ::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 size_t,
) -> ::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 size_t,
) -> ::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 size_t,
) -> ::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 size_t,
) -> ::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 size_t,
) -> ::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 size_t,
) -> ::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 size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Insert the specified key-array pair into the store."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "A key with the specified length is inserted into the store and associated with"]
#[doc = "an array of the specified type and number of elements. The contents of the"]
#[doc = "specified key and array are copied. Keys can be any sequence of bytes but must"]
#[doc = "be at least one byte long and be unique. There is no restriction on the"]
#[doc = "contents of arrays. This is the most general form of ``put`` operation in"]
#[doc = "kastore; when the type of the array is known and the keys are standard C"]
#[doc = "strings, it is usually more convenient to use the :ref:`typed variants"]
#[doc = "<sec_c_api_typed_put>` of this function."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a kastore object."]
#[doc = "@param key The key."]
#[doc = "@param key_len The length of the key."]
#[doc = "@param array The array."]
#[doc = "@param array_len The number of elements in the array."]
#[doc = "@param type The type of the array."]
#[doc = "@param flags The insertion flags. Currently unused."]
#[doc = "@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: size_t,
array: *const ::std::os::raw::c_void,
array_len: size_t,
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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "As for :c:func:`kastore_put` except the key must be NULL-terminated C string."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a kastore object."]
#[doc = "@param key The key."]
#[doc = "@param array The array."]
#[doc = "@param array_len The number of elements in the array."]
#[doc = "@param type The type of the array."]
#[doc = "@param flags The insertion flags. Currently unused."]
#[doc = "@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: size_t,
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."]
#[doc = "@{"]
pub fn kastore_puts_int8(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *const i8,
array_len: size_t,
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: size_t,
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: size_t,
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: size_t,
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: size_t,
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: size_t,
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: size_t,
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: size_t,
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: size_t,
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: size_t,
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"]
#[doc = "of the malloced array buffer to the store (own-put)."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "A key with the specified length is inserted into the store and associated with"]
#[doc = "an array of the specified type and number of elements. The contents of the"]
#[doc = "specified key is copied, but the array buffer is taken directly and freed when"]
#[doc = "the store is closed. The array buffer must be a pointer returned by ``malloc``"]
#[doc = "or ``calloc``. Ownership of the buffer is not taken unless the function returns"]
#[doc = "successfully."]
#[doc = ""]
#[doc = "Apart from taking ownership of the array buffer, the semantics of this"]
#[doc = "function are identical to :c:func:`kastore_put`."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a kastore object."]
#[doc = "@param key The key."]
#[doc = "@param key_len The length of the key."]
#[doc = "@param array The array. Must be a pointer returned by malloc/calloc."]
#[doc = "@param array_len The number of elements in the array."]
#[doc = "@param type The type of the array."]
#[doc = "@param flags The insertion flags. Currently unused."]
#[doc = "@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: size_t,
array: *mut ::std::os::raw::c_void,
array_len: size_t,
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,"]
#[doc = "transferring ownership of the malloced array buffer to the store (own-put)."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "As for :c:func:`kastore_oput` except the key must be NULL-terminated C string."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a kastore object."]
#[doc = "@param key The key."]
#[doc = "@param array The array. Must be a pointer returned by malloc/calloc."]
#[doc = "@param array_len The number of elements in the array."]
#[doc = "@param type The type of the array."]
#[doc = "@param flags The insertion flags. Currently unused."]
#[doc = "@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: size_t,
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."]
#[doc = "@{"]
pub fn kastore_oputs_int8(
self_: *mut kastore_t,
key: *const ::std::os::raw::c_char,
array: *mut i8,
array_len: size_t,
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: size_t,
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: size_t,
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: size_t,
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: size_t,
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: size_t,
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: size_t,
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: size_t,
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: size_t,
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: size_t,
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 Tskit Object IDs."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "All objects in tskit are referred to by integer IDs corresponding to the"]
#[doc = "row they occupy in the relevant table. The ``tsk_id_t`` type should be used"]
#[doc = "when manipulating these ID values. The reserved value ``TSK_NULL`` (-1) defines"]
#[doc = "missing data."]
#[doc = "@endrst"]
pub type tsk_id_t = i32;
#[doc = "@brief Tskit sizes."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Sizes in tskit are defined by the ``tsk_size_t`` type."]
#[doc = "@endrst"]
pub type tsk_size_t = u32;
#[doc = "@brief Container for bitwise flags."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Bitwise flags are used in tskit as a column type and also as a way to"]
#[doc = "specify options to API functions."]
#[doc = "@endrst"]
pub type tsk_flags_t = u32;
#[doc = "@brief A single individual defined by a row in the individual table."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "See the :ref:`data model <sec_data_model_definitions>` section for the definition of"]
#[doc = "an individual and its properties."]
#[doc = "@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"]
#[doc = " ``location_length``."]
pub location: *const f64,
#[doc = " @brief Number of spatial dimensions."]
pub location_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,
pub nodes: *const tsk_id_t,
pub nodes_length: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_individual_t() {
assert_eq!(
::std::mem::size_of::<tsk_individual_t>(),
56usize,
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::null::<tsk_individual_t>())).id as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_t),
"::",
stringify!(id)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_individual_t>())).flags as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_t),
"::",
stringify!(flags)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_individual_t>())).location as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_t),
"::",
stringify!(location)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_individual_t>())).location_length as *const _ as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_t),
"::",
stringify!(location_length)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_individual_t>())).metadata as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_individual_t>())).metadata_length as *const _ as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_t),
"::",
stringify!(metadata_length)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_individual_t>())).nodes as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_t),
"::",
stringify!(nodes)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_individual_t>())).nodes_length as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_t),
"::",
stringify!(nodes_length)
)
);
}
#[doc = "@brief A single node defined by a row in the node table."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "See the :ref:`data model <sec_data_model_definitions>` section for the definition of"]
#[doc = "a node and its properties."]
#[doc = "@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() {
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::null::<tsk_node_t>())).id as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_t),
"::",
stringify!(id)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_node_t>())).flags as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_t),
"::",
stringify!(flags)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_node_t>())).time as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_t),
"::",
stringify!(time)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_node_t>())).population as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_t),
"::",
stringify!(population)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_node_t>())).individual as *const _ as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_t),
"::",
stringify!(individual)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_node_t>())).metadata as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_node_t>())).metadata_length as *const _ 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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "See the :ref:`data model <sec_data_model_definitions>` section for the definition of"]
#[doc = "an edge and its properties."]
#[doc = "@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() {
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::null::<tsk_edge_t>())).id as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_t),
"::",
stringify!(id)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_edge_t>())).parent as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_t),
"::",
stringify!(parent)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_edge_t>())).child as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_t),
"::",
stringify!(child)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_edge_t>())).left as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_t),
"::",
stringify!(left)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_edge_t>())).right as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_t),
"::",
stringify!(right)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_edge_t>())).metadata as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_edge_t>())).metadata_length as *const _ 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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "See the :ref:`data model <sec_data_model_definitions>` section for the definition of"]
#[doc = "a mutation and its properties."]
#[doc = "@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,
}
#[test]
fn bindgen_test_layout_tsk_mutation_t() {
assert_eq!(
::std::mem::size_of::<tsk_mutation_t>(),
56usize,
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::null::<tsk_mutation_t>())).id as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_t),
"::",
stringify!(id)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_mutation_t>())).site as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_t),
"::",
stringify!(site)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_mutation_t>())).node as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_t),
"::",
stringify!(node)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_mutation_t>())).parent as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_t),
"::",
stringify!(parent)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_mutation_t>())).time as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_t),
"::",
stringify!(time)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_mutation_t>())).derived_state as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_t),
"::",
stringify!(derived_state)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_mutation_t>())).derived_state_length as *const _ as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_t),
"::",
stringify!(derived_state_length)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_mutation_t>())).metadata as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_mutation_t>())).metadata_length as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_t),
"::",
stringify!(metadata_length)
)
);
}
#[doc = "@brief A single site defined by a row in the site table."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "See the :ref:`data model <sec_data_model_definitions>` section for the definition of"]
#[doc = "a site and its properties."]
#[doc = "@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,
pub mutations: *const tsk_mutation_t,
pub mutations_length: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_site_t() {
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::null::<tsk_site_t>())).id as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_t),
"::",
stringify!(id)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_site_t>())).position as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_t),
"::",
stringify!(position)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_site_t>())).ancestral_state as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_t),
"::",
stringify!(ancestral_state)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_site_t>())).ancestral_state_length as *const _ as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_t),
"::",
stringify!(ancestral_state_length)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_site_t>())).metadata as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_site_t>())).metadata_length as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_t),
"::",
stringify!(metadata_length)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_site_t>())).mutations as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_t),
"::",
stringify!(mutations)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_site_t>())).mutations_length as *const _ 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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "See the :ref:`data model <sec_data_model_definitions>` section for the definition of"]
#[doc = "a migration and its properties."]
#[doc = "@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() {
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::null::<tsk_migration_t>())).id as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_t),
"::",
stringify!(id)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_migration_t>())).source as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_t),
"::",
stringify!(source)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_migration_t>())).dest as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_t),
"::",
stringify!(dest)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_migration_t>())).node as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_t),
"::",
stringify!(node)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_migration_t>())).left as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_t),
"::",
stringify!(left)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_migration_t>())).right as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_t),
"::",
stringify!(right)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_migration_t>())).time as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_t),
"::",
stringify!(time)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_migration_t>())).metadata as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_migration_t>())).metadata_length as *const _ 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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "See the :ref:`data model <sec_data_model_definitions>` section for the definition of"]
#[doc = "a population and its properties."]
#[doc = "@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() {
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::null::<tsk_population_t>())).id as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_t),
"::",
stringify!(id)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_population_t>())).metadata as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_population_t>())).metadata_length as *const _ 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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "See the :ref:`data model <sec_data_model_definitions>` section for the definition of"]
#[doc = "a provenance object and its properties. See the :ref:`sec_provenance` section"]
#[doc = "for more information on how provenance records should be structured."]
#[doc = "@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() {
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::null::<tsk_provenance_t>())).id as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_t),
"::",
stringify!(id)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_provenance_t>())).timestamp as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_t),
"::",
stringify!(timestamp)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_provenance_t>())).timestamp_length as *const _ as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_t),
"::",
stringify!(timestamp_length)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_provenance_t>())).record as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_t),
"::",
stringify!(record)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_provenance_t>())).record_length as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_t),
"::",
stringify!(record_length)
)
);
}
#[doc = "@brief The individual table."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "See the individual :ref:`table definition <sec_individual_table_definition>` for"]
#[doc = "details of the columns in this table."]
#[doc = "@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 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 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() {
assert_eq!(
::std::mem::size_of::<tsk_individual_table_t>(),
88usize,
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::null::<tsk_individual_table_t>())).num_rows as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(num_rows)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_individual_table_t>())).max_rows as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(max_rows)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_individual_table_t>())).max_rows_increment as *const _
as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(max_rows_increment)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_individual_table_t>())).location_length as *const _ as usize
},
12usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(location_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_individual_table_t>())).max_location_length as *const _
as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(max_location_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_individual_table_t>())).max_location_length_increment
as *const _ as usize
},
20usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(max_location_length_increment)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_individual_table_t>())).metadata_length as *const _ as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(metadata_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_individual_table_t>())).max_metadata_length as *const _
as usize
},
28usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(max_metadata_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_individual_table_t>())).max_metadata_length_increment
as *const _ as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(max_metadata_length_increment)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_individual_table_t>())).metadata_schema_length as *const _
as usize
},
36usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(metadata_schema_length)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_individual_table_t>())).flags as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(flags)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_individual_table_t>())).location as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(location)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_individual_table_t>())).location_offset as *const _ as usize
},
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(location_offset)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_individual_table_t>())).metadata as *const _ as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_individual_table_t>())).metadata_offset as *const _ as usize
},
72usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(metadata_offset)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_individual_table_t>())).metadata_schema as *const _ as usize
},
80usize,
concat!(
"Offset of field: ",
stringify!(tsk_individual_table_t),
"::",
stringify!(metadata_schema)
)
);
}
#[doc = "@brief The node table."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "See the node :ref:`table definition <sec_node_table_definition>` for"]
#[doc = "details of the columns in this table."]
#[doc = "@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() {
assert_eq!(
::std::mem::size_of::<tsk_node_table_t>(),
88usize,
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::null::<tsk_node_table_t>())).num_rows as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(num_rows)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_node_table_t>())).max_rows as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(max_rows)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_node_table_t>())).max_rows_increment as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(max_rows_increment)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_node_table_t>())).metadata_length as *const _ as usize
},
12usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(metadata_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_node_table_t>())).max_metadata_length as *const _ as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(max_metadata_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_node_table_t>())).max_metadata_length_increment as *const _
as usize
},
20usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(max_metadata_length_increment)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_node_table_t>())).metadata_schema_length as *const _ as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(metadata_schema_length)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_node_table_t>())).flags as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(flags)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_node_table_t>())).time as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(time)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_node_table_t>())).population as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(population)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_node_table_t>())).individual as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(individual)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_node_table_t>())).metadata as *const _ as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_node_table_t>())).metadata_offset as *const _ as usize
},
72usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(metadata_offset)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_node_table_t>())).metadata_schema as *const _ as usize
},
80usize,
concat!(
"Offset of field: ",
stringify!(tsk_node_table_t),
"::",
stringify!(metadata_schema)
)
);
}
#[doc = "@brief The edge table."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "See the edge :ref:`table definition <sec_edge_table_definition>` for"]
#[doc = "details of the columns in this table."]
#[doc = "@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() {
assert_eq!(
::std::mem::size_of::<tsk_edge_table_t>(),
96usize,
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::null::<tsk_edge_table_t>())).num_rows as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(num_rows)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_edge_table_t>())).max_rows as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(max_rows)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_edge_table_t>())).max_rows_increment as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(max_rows_increment)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_edge_table_t>())).metadata_length as *const _ as usize
},
12usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(metadata_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_edge_table_t>())).max_metadata_length as *const _ as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(max_metadata_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_edge_table_t>())).max_metadata_length_increment as *const _
as usize
},
20usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(max_metadata_length_increment)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_edge_table_t>())).metadata_schema_length as *const _ as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(metadata_schema_length)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_edge_table_t>())).left as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(left)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_edge_table_t>())).right as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(right)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_edge_table_t>())).parent as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(parent)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_edge_table_t>())).child as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(child)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_edge_table_t>())).metadata as *const _ as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_edge_table_t>())).metadata_offset as *const _ as usize
},
72usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(metadata_offset)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_edge_table_t>())).metadata_schema as *const _ as usize
},
80usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(metadata_schema)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_edge_table_t>())).options as *const _ as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_table_t),
"::",
stringify!(options)
)
);
}
#[doc = "@brief The migration table."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "See the migration :ref:`table definition <sec_migration_table_definition>` for"]
#[doc = "details of the columns in this table."]
#[doc = "@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() {
assert_eq!(
::std::mem::size_of::<tsk_migration_table_t>(),
104usize,
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::null::<tsk_migration_table_t>())).num_rows as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(num_rows)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_migration_table_t>())).max_rows as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(max_rows)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_migration_table_t>())).max_rows_increment as *const _
as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(max_rows_increment)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_migration_table_t>())).metadata_length as *const _ as usize
},
12usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(metadata_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_migration_table_t>())).max_metadata_length as *const _
as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(max_metadata_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_migration_table_t>())).max_metadata_length_increment
as *const _ as usize
},
20usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(max_metadata_length_increment)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_migration_table_t>())).metadata_schema_length as *const _
as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(metadata_schema_length)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_migration_table_t>())).source as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(source)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_migration_table_t>())).dest as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(dest)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_migration_table_t>())).node as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(node)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_migration_table_t>())).left as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(left)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_migration_table_t>())).right as *const _ as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(right)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_migration_table_t>())).time as *const _ as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(time)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_migration_table_t>())).metadata as *const _ as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_migration_table_t>())).metadata_offset as *const _ as usize
},
88usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(metadata_offset)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_migration_table_t>())).metadata_schema as *const _ as usize
},
96usize,
concat!(
"Offset of field: ",
stringify!(tsk_migration_table_t),
"::",
stringify!(metadata_schema)
)
);
}
#[doc = "@brief The site table."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "See the site :ref:`table definition <sec_site_table_definition>` for"]
#[doc = "details of the columns in this table."]
#[doc = "@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() {
assert_eq!(
::std::mem::size_of::<tsk_site_table_t>(),
88usize,
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::null::<tsk_site_table_t>())).num_rows as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(num_rows)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_site_table_t>())).max_rows as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(max_rows)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_site_table_t>())).max_rows_increment as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(max_rows_increment)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_site_table_t>())).ancestral_state_length as *const _ as usize
},
12usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(ancestral_state_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_site_table_t>())).max_ancestral_state_length as *const _
as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(max_ancestral_state_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_site_table_t>())).max_ancestral_state_length_increment
as *const _ as usize
},
20usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(max_ancestral_state_length_increment)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_site_table_t>())).metadata_length as *const _ as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(metadata_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_site_table_t>())).max_metadata_length as *const _ as usize
},
28usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(max_metadata_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_site_table_t>())).max_metadata_length_increment as *const _
as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(max_metadata_length_increment)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_site_table_t>())).metadata_schema_length as *const _ as usize
},
36usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(metadata_schema_length)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_site_table_t>())).position as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(position)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_site_table_t>())).ancestral_state as *const _ as usize
},
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(ancestral_state)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_site_table_t>())).ancestral_state_offset as *const _ as usize
},
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(ancestral_state_offset)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_site_table_t>())).metadata as *const _ as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_site_table_t>())).metadata_offset as *const _ as usize
},
72usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(metadata_offset)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_site_table_t>())).metadata_schema as *const _ as usize
},
80usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_table_t),
"::",
stringify!(metadata_schema)
)
);
}
#[doc = "@brief The mutation table."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "See the mutation :ref:`table definition <sec_mutation_table_definition>` for"]
#[doc = "details of the columns in this table."]
#[doc = "@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() {
assert_eq!(
::std::mem::size_of::<tsk_mutation_table_t>(),
112usize,
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::null::<tsk_mutation_table_t>())).num_rows as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(num_rows)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_mutation_table_t>())).max_rows as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(max_rows)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_mutation_table_t>())).max_rows_increment as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(max_rows_increment)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_mutation_table_t>())).derived_state_length as *const _
as usize
},
12usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(derived_state_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_mutation_table_t>())).max_derived_state_length as *const _
as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(max_derived_state_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_mutation_table_t>())).max_derived_state_length_increment
as *const _ as usize
},
20usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(max_derived_state_length_increment)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_mutation_table_t>())).metadata_length as *const _ as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(metadata_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_mutation_table_t>())).max_metadata_length as *const _
as usize
},
28usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(max_metadata_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_mutation_table_t>())).max_metadata_length_increment
as *const _ as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(max_metadata_length_increment)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_mutation_table_t>())).metadata_schema_length as *const _
as usize
},
36usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(metadata_schema_length)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_mutation_table_t>())).node as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(node)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_mutation_table_t>())).site as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(site)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_mutation_table_t>())).parent as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(parent)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_mutation_table_t>())).time as *const _ as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(time)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_mutation_table_t>())).derived_state as *const _ as usize
},
72usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(derived_state)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_mutation_table_t>())).derived_state_offset as *const _
as usize
},
80usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(derived_state_offset)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_mutation_table_t>())).metadata as *const _ as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_mutation_table_t>())).metadata_offset as *const _ as usize
},
96usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(metadata_offset)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_mutation_table_t>())).metadata_schema as *const _ as usize
},
104usize,
concat!(
"Offset of field: ",
stringify!(tsk_mutation_table_t),
"::",
stringify!(metadata_schema)
)
);
}
#[doc = "@brief The population table."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "See the population :ref:`table definition <sec_population_table_definition>` for"]
#[doc = "details of the columns in this table."]
#[doc = "@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() {
assert_eq!(
::std::mem::size_of::<tsk_population_table_t>(),
56usize,
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::null::<tsk_population_table_t>())).num_rows as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_table_t),
"::",
stringify!(num_rows)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_population_table_t>())).max_rows as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_table_t),
"::",
stringify!(max_rows)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_population_table_t>())).max_rows_increment as *const _
as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_table_t),
"::",
stringify!(max_rows_increment)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_population_table_t>())).metadata_length as *const _ as usize
},
12usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_table_t),
"::",
stringify!(metadata_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_population_table_t>())).max_metadata_length as *const _
as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_table_t),
"::",
stringify!(max_metadata_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_population_table_t>())).max_metadata_length_increment
as *const _ as usize
},
20usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_table_t),
"::",
stringify!(max_metadata_length_increment)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_population_table_t>())).metadata_schema_length as *const _
as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_table_t),
"::",
stringify!(metadata_schema_length)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_population_table_t>())).metadata as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_table_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_population_table_t>())).metadata_offset as *const _ as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_table_t),
"::",
stringify!(metadata_offset)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_population_table_t>())).metadata_schema as *const _ as usize
},
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_population_table_t),
"::",
stringify!(metadata_schema)
)
);
}
#[doc = "@brief The provenance table."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "See the provenance :ref:`table definition <sec_provenance_table_definition>` for"]
#[doc = "details of the columns in this table."]
#[doc = "@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() {
assert_eq!(
::std::mem::size_of::<tsk_provenance_table_t>(),
72usize,
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::null::<tsk_provenance_table_t>())).num_rows as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(num_rows)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_provenance_table_t>())).max_rows as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(max_rows)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_provenance_table_t>())).max_rows_increment as *const _
as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(max_rows_increment)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_provenance_table_t>())).timestamp_length as *const _ as usize
},
12usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(timestamp_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_provenance_table_t>())).max_timestamp_length as *const _
as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(max_timestamp_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_provenance_table_t>())).max_timestamp_length_increment
as *const _ as usize
},
20usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(max_timestamp_length_increment)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_provenance_table_t>())).record_length as *const _ as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(record_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_provenance_table_t>())).max_record_length as *const _
as usize
},
28usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(max_record_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_provenance_table_t>())).max_record_length_increment
as *const _ as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(max_record_length_increment)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_provenance_table_t>())).timestamp as *const _ as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(timestamp)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_provenance_table_t>())).timestamp_offset as *const _ as usize
},
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(timestamp_offset)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_provenance_table_t>())).record as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(record)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_provenance_table_t>())).record_offset as *const _ as usize
},
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_provenance_table_t),
"::",
stringify!(record_offset)
)
);
}
#[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 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,
#[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() {
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::null::<tsk_table_collection_t__bindgen_ty_1>())).edge_insertion_order
as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t__bindgen_ty_1),
"::",
stringify!(edge_insertion_order)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_table_collection_t__bindgen_ty_1>())).edge_removal_order
as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t__bindgen_ty_1),
"::",
stringify!(edge_removal_order)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_table_collection_t__bindgen_ty_1>())).num_edges as *const _
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() {
assert_eq!(
::std::mem::size_of::<tsk_table_collection_t>(),
776usize,
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::null::<tsk_table_collection_t>())).sequence_length as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(sequence_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_table_collection_t>())).file_uuid as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(file_uuid)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_table_collection_t>())).metadata as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(metadata)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_table_collection_t>())).metadata_length as *const _ as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(metadata_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_table_collection_t>())).metadata_schema as *const _ as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(metadata_schema)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_table_collection_t>())).metadata_schema_length as *const _
as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(metadata_schema_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_table_collection_t>())).individuals as *const _ as usize
},
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(individuals)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_table_collection_t>())).nodes as *const _ as usize },
136usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(nodes)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_table_collection_t>())).edges as *const _ as usize },
224usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(edges)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_table_collection_t>())).migrations as *const _ as usize
},
320usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(migrations)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_table_collection_t>())).sites as *const _ as usize },
424usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(sites)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_table_collection_t>())).mutations as *const _ as usize
},
512usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(mutations)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_table_collection_t>())).populations as *const _ as usize
},
624usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(populations)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_table_collection_t>())).provenances as *const _ as usize
},
680usize,
concat!(
"Offset of field: ",
stringify!(tsk_table_collection_t),
"::",
stringify!(provenances)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_table_collection_t>())).indexes as *const _ as usize },
752usize,
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() {
assert_eq!(
::std::mem::size_of::<tsk_bookmark_t>(),
32usize,
concat!("Size of: ", stringify!(tsk_bookmark_t))
);
assert_eq!(
::std::mem::align_of::<tsk_bookmark_t>(),
4usize,
concat!("Alignment of ", stringify!(tsk_bookmark_t))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_bookmark_t>())).individuals as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_bookmark_t),
"::",
stringify!(individuals)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_bookmark_t>())).nodes as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_bookmark_t),
"::",
stringify!(nodes)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_bookmark_t>())).edges as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_bookmark_t),
"::",
stringify!(edges)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_bookmark_t>())).migrations as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(tsk_bookmark_t),
"::",
stringify!(migrations)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_bookmark_t>())).sites as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_bookmark_t),
"::",
stringify!(sites)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_bookmark_t>())).mutations as *const _ as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(tsk_bookmark_t),
"::",
stringify!(mutations)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_bookmark_t>())).populations as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_bookmark_t),
"::",
stringify!(populations)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_bookmark_t>())).provenances as *const _ as usize },
28usize,
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 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() {
assert_eq!(
::std::mem::size_of::<_tsk_table_sorter_t>(),
32usize,
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::null::<_tsk_table_sorter_t>())).tables as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_tsk_table_sorter_t),
"::",
stringify!(tables)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_table_sorter_t>())).sort_edges as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(_tsk_table_sorter_t),
"::",
stringify!(sort_edges)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_table_sorter_t>())).user_data as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(_tsk_table_sorter_t),
"::",
stringify!(user_data)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_table_sorter_t>())).site_id_map as *const _ as usize },
24usize,
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_segment_t {
pub left: f64,
pub right: f64,
pub next: *mut _tsk_segment_t,
pub node: tsk_id_t,
}
#[test]
fn bindgen_test_layout__tsk_segment_t() {
assert_eq!(
::std::mem::size_of::<_tsk_segment_t>(),
32usize,
concat!("Size of: ", stringify!(_tsk_segment_t))
);
assert_eq!(
::std::mem::align_of::<_tsk_segment_t>(),
8usize,
concat!("Alignment of ", stringify!(_tsk_segment_t))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_segment_t>())).left as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_tsk_segment_t),
"::",
stringify!(left)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_segment_t>())).right as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(_tsk_segment_t),
"::",
stringify!(right)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_segment_t>())).next as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(_tsk_segment_t),
"::",
stringify!(next)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_segment_t>())).node as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(_tsk_segment_t),
"::",
stringify!(node)
)
);
}
pub type tsk_segment_t = _tsk_segment_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_ibd_finder_t {
pub pairs: *mut tsk_id_t,
pub num_pairs: size_t,
pub num_nodes: size_t,
pub num_unique_nodes_in_pair: size_t,
pub pair_map: *mut i64,
pub sequence_length: f64,
pub tables: *mut tsk_table_collection_t,
pub ibd_segments_head: *mut *mut tsk_segment_t,
pub ibd_segments_tail: *mut *mut tsk_segment_t,
pub segment_heap: tsk_blkalloc_t,
pub is_sample: *mut bool,
pub paired_nodes_index: *mut tsk_id_t,
pub min_length: f64,
pub max_time: f64,
pub ancestor_map_head: *mut *mut tsk_segment_t,
pub ancestor_map_tail: *mut *mut tsk_segment_t,
pub segment_queue: *mut tsk_segment_t,
pub segment_queue_size: size_t,
pub max_segment_queue_size: size_t,
}
#[test]
fn bindgen_test_layout_tsk_ibd_finder_t() {
assert_eq!(
::std::mem::size_of::<tsk_ibd_finder_t>(),
200usize,
concat!("Size of: ", stringify!(tsk_ibd_finder_t))
);
assert_eq!(
::std::mem::align_of::<tsk_ibd_finder_t>(),
8usize,
concat!("Alignment of ", stringify!(tsk_ibd_finder_t))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_ibd_finder_t>())).pairs as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_ibd_finder_t),
"::",
stringify!(pairs)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_ibd_finder_t>())).num_pairs as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_ibd_finder_t),
"::",
stringify!(num_pairs)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_ibd_finder_t>())).num_nodes as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_ibd_finder_t),
"::",
stringify!(num_nodes)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_ibd_finder_t>())).num_unique_nodes_in_pair as *const _
as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_ibd_finder_t),
"::",
stringify!(num_unique_nodes_in_pair)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_ibd_finder_t>())).pair_map as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_ibd_finder_t),
"::",
stringify!(pair_map)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_ibd_finder_t>())).sequence_length as *const _ as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_ibd_finder_t),
"::",
stringify!(sequence_length)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_ibd_finder_t>())).tables as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_ibd_finder_t),
"::",
stringify!(tables)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_ibd_finder_t>())).ibd_segments_head as *const _ as usize
},
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_ibd_finder_t),
"::",
stringify!(ibd_segments_head)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_ibd_finder_t>())).ibd_segments_tail as *const _ as usize
},
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_ibd_finder_t),
"::",
stringify!(ibd_segments_tail)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_ibd_finder_t>())).segment_heap as *const _ as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(tsk_ibd_finder_t),
"::",
stringify!(segment_heap)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_ibd_finder_t>())).is_sample as *const _ as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(tsk_ibd_finder_t),
"::",
stringify!(is_sample)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_ibd_finder_t>())).paired_nodes_index as *const _ as usize
},
136usize,
concat!(
"Offset of field: ",
stringify!(tsk_ibd_finder_t),
"::",
stringify!(paired_nodes_index)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_ibd_finder_t>())).min_length as *const _ as usize },
144usize,
concat!(
"Offset of field: ",
stringify!(tsk_ibd_finder_t),
"::",
stringify!(min_length)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_ibd_finder_t>())).max_time as *const _ as usize },
152usize,
concat!(
"Offset of field: ",
stringify!(tsk_ibd_finder_t),
"::",
stringify!(max_time)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_ibd_finder_t>())).ancestor_map_head as *const _ as usize
},
160usize,
concat!(
"Offset of field: ",
stringify!(tsk_ibd_finder_t),
"::",
stringify!(ancestor_map_head)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_ibd_finder_t>())).ancestor_map_tail as *const _ as usize
},
168usize,
concat!(
"Offset of field: ",
stringify!(tsk_ibd_finder_t),
"::",
stringify!(ancestor_map_tail)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_ibd_finder_t>())).segment_queue as *const _ as usize },
176usize,
concat!(
"Offset of field: ",
stringify!(tsk_ibd_finder_t),
"::",
stringify!(segment_queue)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_ibd_finder_t>())).segment_queue_size as *const _ as usize
},
184usize,
concat!(
"Offset of field: ",
stringify!(tsk_ibd_finder_t),
"::",
stringify!(segment_queue_size)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_ibd_finder_t>())).max_segment_queue_size as *const _ as usize
},
192usize,
concat!(
"Offset of field: ",
stringify!(tsk_ibd_finder_t),
"::",
stringify!(max_segment_queue_size)
)
);
}
extern "C" {
#[doc = "@brief Initialises the table by allocating the internal memory."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "This must be called before any operations are performed on the table."]
#[doc = "See the :ref:`sec_c_api_overview_structure` for details on how objects"]
#[doc = "are initialised and freed."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to an uninitialised tsk_individual_table_t object."]
#[doc = "@param options Allocation time options. Currently unused; should be"]
#[doc = "set to zero to ensure compatibility with later versions of tskit."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@param self A pointer to an initialised tsk_individual_table_t object."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Add a new individual with the specified ``flags``, ``location`` and ``metadata``"]
#[doc = "to the table. Copies of the ``location`` and ``metadata`` parameters are taken"]
#[doc = "immediately."]
#[doc = "See the :ref:`table definition <sec_individual_table_definition>` for details"]
#[doc = "of the columns in this table."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_individual_table_t object."]
#[doc = "@param flags The bitwise flags for the new individual."]
#[doc = "@param location A pointer to a double array representing the spatial location"]
#[doc = "of the new individual. Can be ``NULL`` if ``location_length`` is 0."]
#[doc = "@param location_length The number of dimensions in the locations position."]
#[doc = "Note this the number of elements in the corresponding double array"]
#[doc = "not the number of bytes."]
#[doc = "@param metadata The metadata to be associated with the new individual. This"]
#[doc = "is a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0."]
#[doc = "@param metadata_length The size of the metadata array in bytes."]
#[doc = "@return Return the ID of the newly added individual on success,"]
#[doc = "or 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,
metadata: *const ::std::os::raw::c_char,
metadata_length: tsk_size_t,
) -> tsk_id_t;
}
extern "C" {
#[doc = "@brief Clears this table, setting the number of rows to zero."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "No memory is freed as a result of this operation; please use"]
#[doc = ":c:func:`tsk_individual_table_free` to free the table's internal resources. Note that the"]
#[doc = "metadata schema is not cleared."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_individual_table_t object."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_individual_table_t object."]
#[doc = "@param num_rows The number of rows to retain in the table."]
#[doc = "@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 Returns true if the data in the specified table is identical to the data"]
#[doc = "in this table."]
#[doc = ""]
#[doc = "@rst"]
#[doc = ""]
#[doc = "Options**"]
#[doc = ""]
#[doc = "Options to control the comparison can be specified by providing one or"]
#[doc = "more of the following bitwise flags. By default (options=0) tables are"]
#[doc = "considered equal if they are byte-wise identical in all columns,"]
#[doc = "and their metadata schemas are byte-wise identical."]
#[doc = ""]
#[doc = "TSK_CMP_IGNORE_METADATA"]
#[doc = "Do not include metadata or metadata schemas in the comparison."]
#[doc = ""]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_individual_table_t object."]
#[doc = "@param other A pointer to a tsk_individual_table_t object."]
#[doc = "@param options Bitwise comparison options."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "By default the method initialises the specified destination table. If the"]
#[doc = "destination is already initialised, the :c:macro:`TSK_NO_INIT` option should"]
#[doc = "be supplied to avoid leaking memory."]
#[doc = ""]
#[doc = "Indexes that are present are also copied to the destination table."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_individual_table_t object."]
#[doc = "@param dest A pointer to a tsk_individual_table_t object. If the TSK_NO_INIT option"]
#[doc = "is specified, this must be an initialised individual table. If not, it must"]
#[doc = "be an uninitialised individual table."]
#[doc = "@param options Bitwise option flags."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Updates the specified individual struct to reflect the values in the specified row."]
#[doc = "Pointers to memory within this struct are handled by the table and should **not**"]
#[doc = "be freed by client code. These pointers are guaranteed to be valid until the"]
#[doc = "next operation that modifies the table (e.g., by adding a new row), but not afterwards."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_individual_table_t object."]
#[doc = "@param index The requested table row."]
#[doc = "@param row A pointer to a tsk_individual_t struct that is updated to reflect the"]
#[doc = "values in the specified row."]
#[doc = "@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"]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Copies the metadata schema string to this table, replacing any existing."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_individual_table_t object."]
#[doc = "@param metadata_schema A pointer to a char array"]
#[doc = "@param metadata_schema_length The size of the metadata schema in bytes."]
#[doc = "@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."]
#[doc = ""]
#[doc = "This method is intended for debugging purposes and should not be used"]
#[doc = "in production code. The format of the output should **not** be depended"]
#[doc = "on and may change arbitrarily between versions."]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_individual_table_t object."]
#[doc = "@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 = " @}"]
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_length: *const tsk_size_t,
metadata: *const ::std::os::raw::c_char,
metadata_length: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
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_length: *const tsk_size_t,
metadata: *const ::std::os::raw::c_char,
metadata_length: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_individual_table_dump_text(
self_: *const tsk_individual_table_t,
out: *mut FILE,
) -> ::std::os::raw::c_int;
}
extern "C" {
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" {
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" {
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 Initialises the table by allocating the internal memory."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "This must be called before any operations are performed on the table."]
#[doc = "See the :ref:`sec_c_api_overview_structure` for details on how objects"]
#[doc = "are initialised and freed."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to an uninitialised tsk_node_table_t object."]
#[doc = "@param options Allocation time options. Currently unused; should be"]
#[doc = "set to zero to ensure compatibility with later versions of tskit."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@param self A pointer to an initialised tsk_node_table_t object."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Add a new node with the specified ``flags``, ``time``, ``population``,"]
#[doc = "``individual`` and ``metadata`` to the table. A copy of the ``metadata`` parameter"]
#[doc = "is taken immediately. See the :ref:`table definition <sec_node_table_definition>`"]
#[doc = "for details of the columns in this table."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_node_table_t object."]
#[doc = "@param flags The bitwise flags for the new node."]
#[doc = "@param time The time for the new node."]
#[doc = "@param population The population for the new node. Set to TSK_NULL if not known."]
#[doc = "@param individual The individual for the new node. Set to TSK_NULL if not known."]
#[doc = "@param metadata The metadata to be associated with the new node. This"]
#[doc = "is a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0."]
#[doc = "@param metadata_length The size of the metadata array in bytes."]
#[doc = "@return Return the ID of the newly added node on success,"]
#[doc = "or 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 Clears this table, setting the number of rows to zero."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "No memory is freed as a result of this operation; please use"]
#[doc = ":c:func:`tsk_node_table_free` to free the table's internal resources. Note that the"]
#[doc = "metadata schema is not cleared."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_node_table_t object."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_node_table_t object."]
#[doc = "@param num_rows The number of rows to retain in the table."]
#[doc = "@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 Returns true if the data in the specified table is identical to the data"]
#[doc = "in this table."]
#[doc = ""]
#[doc = "@rst"]
#[doc = ""]
#[doc = "Options**"]
#[doc = ""]
#[doc = "Options to control the comparison can be specified by providing one or"]
#[doc = "more of the following bitwise flags. By default (options=0) tables are"]
#[doc = "considered equal if they are byte-wise identical in all columns,"]
#[doc = "and their metadata schemas are byte-wise identical."]
#[doc = ""]
#[doc = "TSK_CMP_IGNORE_METADATA"]
#[doc = "Do not include metadata or metadata schemas in the comparison."]
#[doc = ""]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_node_table_t object."]
#[doc = "@param other A pointer to a tsk_node_table_t object."]
#[doc = "@param options Bitwise comparison options."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "By default the method initialises the specified destination table. If the"]
#[doc = "destination is already initialised, the :c:macro:`TSK_NO_INIT` option should"]
#[doc = "be supplied to avoid leaking memory."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_node_table_t object."]
#[doc = "@param dest A pointer to a tsk_node_table_t object. If the TSK_NO_INIT option"]
#[doc = "is specified, this must be an initialised node table. If not, it must"]
#[doc = "be an uninitialised node table."]
#[doc = "@param options Bitwise option flags."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Updates the specified node struct to reflect the values in the specified row."]
#[doc = "Pointers to memory within this struct are handled by the table and should **not**"]
#[doc = "be freed by client code. These pointers are guaranteed to be valid until the"]
#[doc = "next operation that modifies the table (e.g., by adding a new row), but not afterwards."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_node_table_t object."]
#[doc = "@param index The requested table row."]
#[doc = "@param row A pointer to a tsk_node_t struct that is updated to reflect the"]
#[doc = "values in the specified row."]
#[doc = "@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"]
#[doc = "@rst"]
#[doc = "Copies the metadata schema string to this table, replacing any existing."]
#[doc = "@endrst"]
#[doc = "@param self A pointer to a tsk_node_table_t object."]
#[doc = "@param metadata_schema A pointer to a char array"]
#[doc = "@param metadata_schema_length The size of the metadata schema in bytes."]
#[doc = "@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."]
#[doc = ""]
#[doc = "This method is intended for debugging purposes and should not be used"]
#[doc = "in production code. The format of the output should **not** be depended"]
#[doc = "on and may change arbitrarily between versions."]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_node_table_t object."]
#[doc = "@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 = " @}"]
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" {
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" {
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_length: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
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_length: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "This must be called before any operations are performed on the table."]
#[doc = "See the :ref:`sec_c_api_overview_structure` for details on how objects"]
#[doc = "are initialised and freed."]
#[doc = ""]
#[doc = "Options**"]
#[doc = ""]
#[doc = "Options can be specified by providing one or more of the following bitwise"]
#[doc = "flags:"]
#[doc = ""]
#[doc = "TSK_NO_METADATA"]
#[doc = "Do not allocate space to store metadata in this table. Operations"]
#[doc = "attempting to add non-empty metadata to the table will fail"]
#[doc = "with error TSK_ERR_METADATA_DISABLED."]
#[doc = ""]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to an uninitialised tsk_edge_table_t object."]
#[doc = "@param options Allocation time options."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@param self A pointer to an initialised tsk_edge_table_t object."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Add a new edge with the specified ``left``, ``right``, ``parent``, ``child`` and"]
#[doc = "``metadata`` to the table. See the :ref:`table definition <sec_edge_table_definition>`"]
#[doc = "for details of the columns in this table."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_edge_table_t object."]
#[doc = "@param left The left coordinate for the new edge."]
#[doc = "@param right The right coordinate for the new edge."]
#[doc = "@param parent The parent node for the new edge."]
#[doc = "@param child The child node for the new edge."]
#[doc = "@param metadata The metadata to be associated with the new edge. This"]
#[doc = "is a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0."]
#[doc = "@param metadata_length The size of the metadata array in bytes."]
#[doc = ""]
#[doc = "@return Return the ID of the newly added edge on success,"]
#[doc = "or 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 Clears this table, setting the number of rows to zero."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "No memory is freed as a result of this operation; please use"]
#[doc = ":c:func:`tsk_edge_table_free` to free the table's internal resources. Note that the"]
#[doc = "metadata schema is not cleared."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_edge_table_t object."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_edge_table_t object."]
#[doc = "@param num_rows The number of rows to retain in the table."]
#[doc = "@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 Returns true if the data in the specified table is identical to the data"]
#[doc = "in this table."]
#[doc = ""]
#[doc = "@rst"]
#[doc = ""]
#[doc = "Options**"]
#[doc = ""]
#[doc = "Options to control the comparison can be specified by providing one or"]
#[doc = "more of the following bitwise flags. By default (options=0) tables are"]
#[doc = "considered equal if they are byte-wise identical in all columns,"]
#[doc = "and their metadata schemas are byte-wise identical."]
#[doc = ""]
#[doc = "TSK_CMP_IGNORE_METADATA"]
#[doc = "Do not include metadata or metadata schemas in the comparison."]
#[doc = ""]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_edge_table_t object."]
#[doc = "@param other A pointer to a tsk_edge_table_t object."]
#[doc = "@param options Bitwise comparison options."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "By default the method initialises the specified destination table. If the"]
#[doc = "destination is already initialised, the :c:macro:`TSK_NO_INIT` option should"]
#[doc = "be supplied to avoid leaking memory."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_edge_table_t object."]
#[doc = "@param dest A pointer to a tsk_edge_table_t object. If the TSK_NO_INIT option"]
#[doc = "is specified, this must be an initialised edge table. If not, it must"]
#[doc = "be an uninitialised edge table."]
#[doc = "@param options Bitwise option flags."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Updates the specified edge struct to reflect the values in the specified row."]
#[doc = "Pointers to memory within this struct are handled by the table and should **not**"]
#[doc = "be freed by client code. These pointers are guaranteed to be valid until the"]
#[doc = "next operation that modifies the table (e.g., by adding a new row), but not afterwards."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_edge_table_t object."]
#[doc = "@param index The requested table row."]
#[doc = "@param row A pointer to a tsk_edge_t struct that is updated to reflect the"]
#[doc = "values in the specified row."]
#[doc = "@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"]
#[doc = "@rst"]
#[doc = "Copies the metadata schema string to this table, replacing any existing."]
#[doc = "@endrst"]
#[doc = "@param self A pointer to a tsk_edge_table_t object."]
#[doc = "@param metadata_schema A pointer to a char array"]
#[doc = "@param metadata_schema_length The size of the metadata schema in bytes."]
#[doc = "@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."]
#[doc = ""]
#[doc = "This method is intended for debugging purposes and should not be used"]
#[doc = "in production code. The format of the output should **not** be depended"]
#[doc = "on and may change arbitrarily between versions."]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_edge_table_t object."]
#[doc = "@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 = " @}"]
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" {
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" {
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_length: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
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_length: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_edge_table_dump_text(
self_: *const tsk_edge_table_t,
out: *mut FILE,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_edge_table_squash(self_: *mut tsk_edge_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Initialises the table by allocating the internal memory."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "This must be called before any operations are performed on the table."]
#[doc = "See the :ref:`sec_c_api_overview_structure` for details on how objects"]
#[doc = "are initialised and freed."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to an uninitialised tsk_migration_table_t object."]
#[doc = "@param options Allocation time options. Currently unused; should be"]
#[doc = "set to zero to ensure compatibility with later versions of tskit."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@param self A pointer to an initialised tsk_migration_table_t object."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Add a new migration with the specified ``left``, ``right``, ``node``,"]
#[doc = "``source``, ``dest``, ``time`` and ``metadata`` to the table."]
#[doc = "See the :ref:`table definition <sec_migration_table_definition>`"]
#[doc = "for details of the columns in this table."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_migration_table_t object."]
#[doc = "@param left The left coordinate for the new migration."]
#[doc = "@param right The right coordinate for the new migration."]
#[doc = "@param node The node ID for the new migration."]
#[doc = "@param source The source population ID for the new migration."]
#[doc = "@param dest The destination population ID for the new migration."]
#[doc = "@param time The time for the new migration."]
#[doc = "@param metadata The metadata to be associated with the new migration. This"]
#[doc = "is a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0."]
#[doc = "@param metadata_length The size of the metadata array in bytes."]
#[doc = ""]
#[doc = "@return Return the ID of the newly added migration on success,"]
#[doc = "or 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 Clears this table, setting the number of rows to zero."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "No memory is freed as a result of this operation; please use"]
#[doc = ":c:func:`tsk_migration_table_free` to free the table's internal resources. Note that the"]
#[doc = "metadata schema is not cleared."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_migration_table_t object."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_migration_table_t object."]
#[doc = "@param num_rows The number of rows to retain in the table."]
#[doc = "@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 Returns true if the data in the specified table is identical to the data"]
#[doc = "in this table."]
#[doc = ""]
#[doc = "@rst"]
#[doc = ""]
#[doc = "Options**"]
#[doc = ""]
#[doc = "Options to control the comparison can be specified by providing one or"]
#[doc = "more of the following bitwise flags. By default (options=0) tables are"]
#[doc = "considered equal if they are byte-wise identical in all columns,"]
#[doc = "and their metadata schemas are byte-wise identical."]
#[doc = ""]
#[doc = "TSK_CMP_IGNORE_METADATA"]
#[doc = "Do not include metadata or metadata schemas in the comparison."]
#[doc = ""]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_migration_table_t object."]
#[doc = "@param other A pointer to a tsk_migration_table_t object."]
#[doc = "@param options Bitwise comparison options."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "By default the method initialises the specified destination table. If the"]
#[doc = "destination is already initialised, the :c:macro:`TSK_NO_INIT` option should"]
#[doc = "be supplied to avoid leaking memory."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_migration_table_t object."]
#[doc = "@param dest A pointer to a tsk_migration_table_t object. If the TSK_NO_INIT option"]
#[doc = "is specified, this must be an initialised migration table. If not, it must"]
#[doc = "be an uninitialised migration table."]
#[doc = "@param options Bitwise option flags."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Updates the specified migration struct to reflect the values in the specified row."]
#[doc = "Pointers to memory within this struct are handled by the table and should **not**"]
#[doc = "be freed by client code. These pointers are guaranteed to be valid until the"]
#[doc = "next operation that modifies the table (e.g., by adding a new row), but not afterwards."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_migration_table_t object."]
#[doc = "@param index The requested table row."]
#[doc = "@param row A pointer to a tsk_migration_t struct that is updated to reflect the"]
#[doc = "values in the specified row."]
#[doc = "@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"]
#[doc = "@rst"]
#[doc = "Copies the metadata schema string to this table, replacing any existing."]
#[doc = "@endrst"]
#[doc = "@param self A pointer to a tsk_migration_table_t object."]
#[doc = "@param metadata_schema A pointer to a char array"]
#[doc = "@param metadata_schema_length The size of the metadata schema in bytes."]
#[doc = "@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."]
#[doc = ""]
#[doc = "This method is intended for debugging purposes and should not be used"]
#[doc = "in production code. The format of the output should **not** be depended"]
#[doc = "on and may change arbitrarily between versions."]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_migration_table_t object."]
#[doc = "@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 = " @}"]
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" {
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" {
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_length: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
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_length: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "This must be called before any operations are performed on the table."]
#[doc = "See the :ref:`sec_c_api_overview_structure` for details on how objects"]
#[doc = "are initialised and freed."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to an uninitialised tsk_site_table_t object."]
#[doc = "@param options Allocation time options. Currently unused; should be"]
#[doc = "set to zero to ensure compatibility with later versions of tskit."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@param self A pointer to an initialised tsk_site_table_t object."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Add a new site with the specified ``position``, ``ancestral_state``"]
#[doc = "and ``metadata`` to the table. Copies of ``ancestral_state`` and ``metadata``"]
#[doc = "are immediately taken. See the :ref:`table definition <sec_site_table_definition>`"]
#[doc = "for details of the columns in this table."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_site_table_t object."]
#[doc = "@param position The position coordinate for the new site."]
#[doc = "@param ancestral_state The ancestral_state for the new site."]
#[doc = "@param ancestral_state_length The length of the ancestral_state in bytes."]
#[doc = "@param metadata The metadata to be associated with the new site. This"]
#[doc = "is a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0."]
#[doc = "@param metadata_length The size of the metadata array in bytes."]
#[doc = "@return Return the ID of the newly added site on success,"]
#[doc = "or 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 Clears this table, setting the number of rows to zero."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "No memory is freed as a result of this operation; please use"]
#[doc = ":c:func:`tsk_site_table_free` to free the table's internal resources. Note that the"]
#[doc = "metadata schema is not cleared."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_site_table_t object."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_site_table_t object."]
#[doc = "@param num_rows The number of rows to retain in the table."]
#[doc = "@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 Returns true if the data in the specified table is identical to the data"]
#[doc = "in this table."]
#[doc = ""]
#[doc = "@rst"]
#[doc = ""]
#[doc = "Options**"]
#[doc = ""]
#[doc = "Options to control the comparison can be specified by providing one or"]
#[doc = "more of the following bitwise flags. By default (options=0) tables are"]
#[doc = "considered equal if they are byte-wise identical in all columns,"]
#[doc = "and their metadata schemas are byte-wise identical."]
#[doc = ""]
#[doc = "TSK_CMP_IGNORE_METADATA"]
#[doc = "Do not include metadata or metadata schemas in the comparison."]
#[doc = ""]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_site_table_t object."]
#[doc = "@param other A pointer to a tsk_site_table_t object."]
#[doc = "@param options Bitwise comparison options."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "By default the method initialises the specified destination table. If the"]
#[doc = "destination is already initialised, the :c:macro:`TSK_NO_INIT` option should"]
#[doc = "be supplied to avoid leaking memory."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_site_table_t object."]
#[doc = "@param dest A pointer to a tsk_site_table_t object. If the TSK_NO_INIT option"]
#[doc = "is specified, this must be an initialised site table. If not, it must"]
#[doc = "be an uninitialised site table."]
#[doc = "@param options Bitwise option flags."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Updates the specified site struct to reflect the values in the specified row."]
#[doc = "Pointers to memory within this struct are handled by the table and should **not**"]
#[doc = "be freed by client code. These pointers are guaranteed to be valid until the"]
#[doc = "next operation that modifies the table (e.g., by adding a new row), but not afterwards."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_site_table_t object."]
#[doc = "@param index The requested table row."]
#[doc = "@param row A pointer to a tsk_site_t struct that is updated to reflect the"]
#[doc = "values in the specified row."]
#[doc = "@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"]
#[doc = "@rst"]
#[doc = "Copies the metadata schema string to this table, replacing any existing."]
#[doc = "@endrst"]
#[doc = "@param self A pointer to a tsk_site_table_t object."]
#[doc = "@param metadata_schema A pointer to a char array"]
#[doc = "@param metadata_schema_length The size of the metadata schema in bytes."]
#[doc = "@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."]
#[doc = ""]
#[doc = "This method is intended for debugging purposes and should not be used"]
#[doc = "in production code. The format of the output should **not** be depended"]
#[doc = "on and may change arbitrarily between versions."]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_site_table_t object."]
#[doc = "@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 = " @}"]
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" {
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" {
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" {
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_length: *const tsk_size_t,
metadata: *const ::std::os::raw::c_char,
metadata_length: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
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_length: *const tsk_size_t,
metadata: *const ::std::os::raw::c_char,
metadata_length: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "This must be called before any operations are performed on the table."]
#[doc = "See the :ref:`sec_c_api_overview_structure` for details on how objects"]
#[doc = "are initialised and freed."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to an uninitialised tsk_mutation_table_t object."]
#[doc = "@param options Allocation time options. Currently unused; should be"]
#[doc = "set to zero to ensure compatibility with later versions of tskit."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@param self A pointer to an initialised tsk_mutation_table_t object."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Add a new mutation with the specified ``site``, ``parent``, ``derived_state``"]
#[doc = "and ``metadata`` to the table. Copies of ``derived_state`` and ``metadata``"]
#[doc = "are immediately taken. See the :ref:`table definition <sec_mutation_table_definition>`"]
#[doc = "for details of the columns in this table."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_mutation_table_t object."]
#[doc = "@param site The site ID for the new mutation."]
#[doc = "@param node The ID of the node this mutation occurs over."]
#[doc = "@param parent The ID of the parent mutation."]
#[doc = "@param time The time of the mutation."]
#[doc = "@param derived_state The derived_state for the new mutation."]
#[doc = "@param derived_state_length The length of the derived_state in bytes."]
#[doc = "@param metadata The metadata to be associated with the new mutation. This"]
#[doc = "is a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0."]
#[doc = "@param metadata_length The size of the metadata array in bytes."]
#[doc = "@return Return the ID of the newly added mutation on success,"]
#[doc = "or 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 Clears this table, setting the number of rows to zero."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "No memory is freed as a result of this operation; please use"]
#[doc = ":c:func:`tsk_mutation_table_free` to free the table's internal resources. Note that the"]
#[doc = "metadata schema is not cleared."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_mutation_table_t object."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_mutation_table_t object."]
#[doc = "@param num_rows The number of rows to retain in the table."]
#[doc = "@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 Returns true if the data in the specified table is identical to the data"]
#[doc = "in this table."]
#[doc = ""]
#[doc = "@rst"]
#[doc = ""]
#[doc = "Options**"]
#[doc = ""]
#[doc = "Options to control the comparison can be specified by providing one or"]
#[doc = "more of the following bitwise flags. By default (options=0) tables are"]
#[doc = "considered equal if they are byte-wise identical in all columns,"]
#[doc = "and their metadata schemas are byte-wise identical."]
#[doc = ""]
#[doc = "TSK_CMP_IGNORE_METADATA"]
#[doc = "Do not include metadata or metadata schemas in the comparison."]
#[doc = ""]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_mutation_table_t object."]
#[doc = "@param other A pointer to a tsk_mutation_table_t object."]
#[doc = "@param options Bitwise comparison options."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "By default the method initialises the specified destination table. If the"]
#[doc = "destination is already initialised, the :c:macro:`TSK_NO_INIT` option should"]
#[doc = "be supplied to avoid leaking memory."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_mutation_table_t object."]
#[doc = "@param dest A pointer to a tsk_mutation_table_t object. If the TSK_NO_INIT option"]
#[doc = "is specified, this must be an initialised mutation table. If not, it must"]
#[doc = "be an uninitialised mutation table."]
#[doc = "@param options Bitwise option flags."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Updates the specified mutation struct to reflect the values in the specified row."]
#[doc = "Pointers to memory within this struct are handled by the table and should **not**"]
#[doc = "be freed by client code. These pointers are guaranteed to be valid until the"]
#[doc = "next operation that modifies the table (e.g., by adding a new row), but not afterwards."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_mutation_table_t object."]
#[doc = "@param index The requested table row."]
#[doc = "@param row A pointer to a tsk_mutation_t struct that is updated to reflect the"]
#[doc = "values in the specified row."]
#[doc = "@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"]
#[doc = "@rst"]
#[doc = "Copies the metadata schema string to this table, replacing any existing."]
#[doc = "@endrst"]
#[doc = "@param self A pointer to a tsk_mutation_table_t object."]
#[doc = "@param metadata_schema A pointer to a char array"]
#[doc = "@param metadata_schema_length The size of the metadata schema in bytes."]
#[doc = "@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."]
#[doc = ""]
#[doc = "This method is intended for debugging purposes and should not be used"]
#[doc = "in production code. The format of the output should **not** be depended"]
#[doc = "on and may change arbitrarily between versions."]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_mutation_table_t object."]
#[doc = "@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 = " @}"]
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" {
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" {
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" {
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_length: *const tsk_size_t,
metadata: *const ::std::os::raw::c_char,
metadata_length: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
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_length: *const tsk_size_t,
metadata: *const ::std::os::raw::c_char,
metadata_length: *const tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "This must be called before any operations are performed on the table."]
#[doc = "See the :ref:`sec_c_api_overview_structure` for details on how objects"]
#[doc = "are initialised and freed."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to an uninitialised tsk_population_table_t object."]
#[doc = "@param options Allocation time options. Currently unused; should be"]
#[doc = "set to zero to ensure compatibility with later versions of tskit."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@param self A pointer to an initialised tsk_population_table_t object."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Add a new population with the specified ``metadata`` to the table. A copy of the"]
#[doc = "``metadata`` is immediately taken. See the :ref:`table definition"]
#[doc = "<sec_population_table_definition>` for details of the columns in this table."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_population_table_t object."]
#[doc = "@param metadata The metadata to be associated with the new population. This"]
#[doc = "is a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0."]
#[doc = "@param metadata_length The size of the metadata array in bytes."]
#[doc = "@return Return the ID of the newly added population on success,"]
#[doc = "or 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 Clears this table, setting the number of rows to zero."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "No memory is freed as a result of this operation; please use"]
#[doc = ":c:func:`tsk_population_table_free` to free the table's internal resources. Note that the"]
#[doc = "metadata schema is not cleared."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_population_table_t object."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_population_table_t object."]
#[doc = "@param num_rows The number of rows to retain in the table."]
#[doc = "@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 Returns true if the data in the specified table is identical to the data"]
#[doc = "in this table."]
#[doc = ""]
#[doc = "@rst"]
#[doc = ""]
#[doc = "Options**"]
#[doc = ""]
#[doc = "Options to control the comparison can be specified by providing one or"]
#[doc = "more of the following bitwise flags. By default (options=0) tables are"]
#[doc = "considered equal if they are byte-wise identical in all columns,"]
#[doc = "and their metadata schemas are byte-wise identical."]
#[doc = ""]
#[doc = "TSK_CMP_IGNORE_METADATA"]
#[doc = "Do not include metadata in the comparison. Note that as metadata is the"]
#[doc = "only column in the population table, two population tables are considered"]
#[doc = "equal if they have the same number of rows if this flag is specified."]
#[doc = ""]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_population_table_t object."]
#[doc = "@param other A pointer to a tsk_population_table_t object."]
#[doc = "@param options Bitwise comparison options."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "By default the method initialises the specified destination table. If the"]
#[doc = "destination is already initialised, the :c:macro:`TSK_NO_INIT` option should"]
#[doc = "be supplied to avoid leaking memory."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_population_table_t object."]
#[doc = "@param dest A pointer to a tsk_population_table_t object. If the TSK_NO_INIT option"]
#[doc = "is specified, this must be an initialised population table. If not, it must"]
#[doc = "be an uninitialised population table."]
#[doc = "@param options Bitwise option flags."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Updates the specified population struct to reflect the values in the specified row."]
#[doc = "Pointers to memory within this struct are handled by the table and should **not**"]
#[doc = "be freed by client code. These pointers are guaranteed to be valid until the"]
#[doc = "next operation that modifies the table (e.g., by adding a new row), but not afterwards."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_population_table_t object."]
#[doc = "@param index The requested table row."]
#[doc = "@param row A pointer to a tsk_population_t struct that is updated to reflect the"]
#[doc = "values in the specified row."]
#[doc = "@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"]
#[doc = "@rst"]
#[doc = "Copies the metadata schema string to this table, replacing any existing."]
#[doc = "@endrst"]
#[doc = "@param self A pointer to a tsk_population_table_t object."]
#[doc = "@param metadata_schema A pointer to a char array"]
#[doc = "@param metadata_schema_length The size of the metadata schema in bytes."]
#[doc = "@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."]
#[doc = ""]
#[doc = "This method is intended for debugging purposes and should not be used"]
#[doc = "in production code. The format of the output should **not** be depended"]
#[doc = "on and may change arbitrarily between versions."]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_population_table_t object."]
#[doc = "@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 = " @}"]
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" {
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" {
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" {
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" {
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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "This must be called before any operations are performed on the table."]
#[doc = "See the :ref:`sec_c_api_overview_structure` for details on how objects"]
#[doc = "are initialised and freed."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to an uninitialised tsk_provenance_table_t object."]
#[doc = "@param options Allocation time options. Currently unused; should be"]
#[doc = "set to zero to ensure compatibility with later versions of tskit."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@param self A pointer to an initialised tsk_provenance_table_t object."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Add a new provenance with the specified ``timestamp`` and ``record`` to the table."]
#[doc = "Copies of the ``timestamp`` and ``record`` are immediately taken."]
#[doc = "See the :ref:`table definition <sec_provenance_table_definition>`"]
#[doc = "for details of the columns in this table."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_provenance_table_t object."]
#[doc = "@param timestamp The timestamp to be associated with the new provenance. This"]
#[doc = "is a pointer to arbitrary memory. Can be ``NULL`` if ``timestamp_length`` is 0."]
#[doc = "@param timestamp_length The size of the timestamp array in bytes."]
#[doc = "@param record The record to be associated with the new provenance. This"]
#[doc = "is a pointer to arbitrary memory. Can be ``NULL`` if ``record_length`` is 0."]
#[doc = "@param record_length The size of the record array in bytes."]
#[doc = "@return Return the ID of the newly added provenance on success,"]
#[doc = "or 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 Clears this table, setting the number of rows to zero."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "No memory is freed as a result of this operation; please use"]
#[doc = ":c:func:`tsk_provenance_table_free` to free the table's internal resources."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_provenance_table_t object."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_provenance_table_t object."]
#[doc = "@param num_rows The number of rows to retain in the table."]
#[doc = "@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 Returns true if the data in the specified table is identical to the data"]
#[doc = "in this table."]
#[doc = ""]
#[doc = "@rst"]
#[doc = ""]
#[doc = "Options**"]
#[doc = ""]
#[doc = "Options to control the comparison can be specified by providing one or"]
#[doc = "more of the following bitwise flags. By default (options=0) tables are"]
#[doc = "considered equal if they are byte-wise identical in all columns."]
#[doc = ""]
#[doc = "TSK_CMP_IGNORE_TIMESTAMPS"]
#[doc = "Do not include the timestamp column when comparing provenance"]
#[doc = "tables."]
#[doc = ""]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_provenance_table_t object."]
#[doc = "@param other A pointer to a tsk_provenance_table_t object."]
#[doc = "@param options Bitwise comparison options."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "By default the method initialises the specified destination table. If the"]
#[doc = "destination is already initialised, the :c:macro:`TSK_NO_INIT` option should"]
#[doc = "be supplied to avoid leaking memory."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_provenance_table_t object."]
#[doc = "@param dest A pointer to a tsk_provenance_table_t object. If the TSK_NO_INIT option"]
#[doc = "is specified, this must be an initialised provenance table. If not, it must"]
#[doc = "be an uninitialised provenance table."]
#[doc = "@param options Bitwise option flags."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Updates the specified provenance struct to reflect the values in the specified row."]
#[doc = "Pointers to memory within this struct are handled by the table and should **not**"]
#[doc = "be freed by client code. These pointers are guaranteed to be valid until the"]
#[doc = "next operation that modifies the table (e.g., by adding a new row), but not afterwards."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_provenance_table_t object."]
#[doc = "@param index The requested table row."]
#[doc = "@param row A pointer to a tsk_provenance_t struct that is updated to reflect the"]
#[doc = "values in the specified row."]
#[doc = "@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."]
#[doc = ""]
#[doc = "This method is intended for debugging purposes and should not be used"]
#[doc = "in production code. The format of the output should **not** be depended"]
#[doc = "on and may change arbitrarily between versions."]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_provenance_table_t object."]
#[doc = "@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 = " @}"]
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" {
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" {
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" {
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" {
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" {
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"]
#[doc = "and initialising all the constituent tables."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "This must be called before any operations are performed on the table"]
#[doc = "collection. See the :ref:`sec_c_api_overview_structure` for details on how objects"]
#[doc = "are initialised and freed."]
#[doc = ""]
#[doc = "Options**"]
#[doc = ""]
#[doc = "Options can be specified by providing one or more of the following bitwise"]
#[doc = "flags:"]
#[doc = ""]
#[doc = "TSK_NO_EDGE_METADATA"]
#[doc = "Do not allocate space to store metadata in the edge table. Operations"]
#[doc = "attempting to add non-empty metadata to the edge table will fail"]
#[doc = "with error TSK_ERR_METADATA_DISABLED."]
#[doc = ""]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to an uninitialised tsk_table_collection_t object."]
#[doc = "@param options Allocation time options. Currently unused; should be"]
#[doc = "set to zero to ensure compatibility with later versions of tskit."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@param self A pointer to an initialised tsk_table_collection_t object."]
#[doc = "@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"]
#[doc = "this table collection."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "By default this operation clears all tables except the provenance table, retaining"]
#[doc = "table metadata schemas and the tree-sequnce level metadata and schema."]
#[doc = ""]
#[doc = "Options**"]
#[doc = ""]
#[doc = "Options can be specified by providing one or more of the following bitwise"]
#[doc = "flags:"]
#[doc = ""]
#[doc = "TSK_CLEAR_PROVENANCE"]
#[doc = "Additionally clear the provenance table"]
#[doc = "TSK_CLEAR_METADATA_SCHEMAS"]
#[doc = "Additionally clear the table metadata schemas"]
#[doc = "TSK_CLEAR_TS_METADATA_AND_SCHEMA"]
#[doc = "Additionally clear the tree-sequence metadata and schema"]
#[doc = ""]
#[doc = "No memory is freed as a result of this operation; please use"]
#[doc = ":c:func:`tsk_table_collection_free` to free internal resources."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_table_collection_t object."]
#[doc = "@param options Bitwise clearing options"]
#[doc = "@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"]
#[doc = "to the data in this table collection."]
#[doc = ""]
#[doc = "@rst"]
#[doc = ""]
#[doc = "Returns true if the two table collections are equal. The indexes are"]
#[doc = "not considered as these are derived from the tables. We also do not"]
#[doc = "consider the ``file_uuid``, since it is a property of the file that set"]
#[doc = "of tables is stored in."]
#[doc = ""]
#[doc = "Options**"]
#[doc = ""]
#[doc = "Options to control the comparison can be specified by providing one or"]
#[doc = "more of the following bitwise flags. By default (options=0) two table"]
#[doc = "collections are considered equal if all of the tables are byte-wise"]
#[doc = "identical, and the sequence lengths, metadata and metadata schemas"]
#[doc = "of the two table collections are identical."]
#[doc = ""]
#[doc = "TSK_CMP_IGNORE_PROVENANCE"]
#[doc = "Do not include the provenance table in comparison."]
#[doc = "TSK_CMP_IGNORE_METADATA"]
#[doc = "Do not include metadata when comparing the table collections."]
#[doc = "This includes both the top-level tree sequence metadata as well as the"]
#[doc = "metadata for each of the tables (i.e, TSK_CMP_IGNORE_TS_METADATA is implied)."]
#[doc = "All metadata schemas are also ignored."]
#[doc = "TSK_CMP_IGNORE_TS_METADATA"]
#[doc = "Do not include the top-level tree sequence metadata and metadata schemas"]
#[doc = "in the comparison."]
#[doc = "TSK_CMP_IGNORE_TIMESTAMPS"]
#[doc = "Do not include the timestamp information when comparing the provenance"]
#[doc = "tables. This has no effect if TSK_CMP_IGNORE_PROVENANCE is specified."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_table_collection_t object."]
#[doc = "@param other A pointer to a tsk_table_collection_t object."]
#[doc = "@param options Bitwise comparison options."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "By default the method initialises the specified destination table. If the"]
#[doc = "destination is already initialised, the :c:macro:`TSK_NO_INIT` option should"]
#[doc = "be supplied to avoid leaking memory."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_table_collection_t object."]
#[doc = "@param dest A pointer to a tsk_table_collection_t object. If the TSK_NO_INIT option"]
#[doc = "is specified, this must be an initialised provenance table. If not, it must"]
#[doc = "be an uninitialised provenance table."]
#[doc = "@param options Bitwise option flags."]
#[doc = "@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."]
#[doc = ""]
#[doc = "This method is intended for debugging purposes and should not be used"]
#[doc = "in production code. The format of the output should **not** be depended"]
#[doc = "on and may change arbitrarily between versions."]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_table_collection_t object."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Loads the data from the specified file into this table collection."]
#[doc = "By default, the table collection is also initialised."]
#[doc = "The resources allocated must be freed using"]
#[doc = ":c:func:`tsk_table_collection_free` even in error conditions."]
#[doc = ""]
#[doc = "If the :c:macro:`TSK_NO_INIT` option is set, the table collection is"]
#[doc = "not initialised, allowing an already initialised table collection to"]
#[doc = "be overwritten with the data from a file."]
#[doc = ""]
#[doc = "If the file contains multiple table collections, this function will load"]
#[doc = "the first. Please see the :c:func:`tsk_table_collection_loadf` for details"]
#[doc = "on how to sequentially load table collections from a stream."]
#[doc = ""]
#[doc = "Options**"]
#[doc = ""]
#[doc = "Options can be specified by providing one or more of the following bitwise"]
#[doc = "flags:"]
#[doc = ""]
#[doc = "TSK_NO_INIT"]
#[doc = "Do not initialise this :c:type:`tsk_table_collection_t` before loading."]
#[doc = ""]
#[doc = "Examples**"]
#[doc = ""]
#[doc = ".. code-block:: c"]
#[doc = ""]
#[doc = "int ret;"]
#[doc = "tsk_table_collection_t tables;"]
#[doc = "ret = tsk_table_collection_load(&tables, \"data.trees\", 0);"]
#[doc = "if (ret != 0) {"]
#[doc = "fprintf(stderr, \"Load error:%s\\n\", tsk_strerror(ret));"]
#[doc = "exit(EXIT_FAILURE);"]
#[doc = "}"]
#[doc = ""]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to an uninitialised tsk_table_collection_t object"]
#[doc = "if the TSK_NO_INIT option is not set (default), or an initialised"]
#[doc = "tsk_table_collection_t otherwise."]
#[doc = "@param filename A NULL terminated string containing the filename."]
#[doc = "@param options Bitwise options. See above for details."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Loads a tables definition from the specified file stream to this table"]
#[doc = "collection. By default, the table collection is also initialised."]
#[doc = "The resources allocated must be freed using"]
#[doc = ":c:func:`tsk_table_collection_free` even in error conditions."]
#[doc = ""]
#[doc = "If the :c:macro:`TSK_NO_INIT` option is set, the table collection is"]
#[doc = "not initialised, allowing an already initialised table collection to"]
#[doc = "be overwritten with the data from a file."]
#[doc = ""]
#[doc = "If the stream contains multiple table collection definitions, this function"]
#[doc = "will load the next table collection from the stream. If the stream contains no"]
#[doc = "more table collection definitions the error value :c:macro:`TSK_ERR_EOF` will"]
#[doc = "be returned. Note that EOF is only returned in the case where zero bytes are"]
#[doc = "read from the stream --- malformed files or other errors will result in"]
#[doc = "different error conditions. Please see the"]
#[doc = ":ref:`sec_c_api_examples_file_streaming` section for an example of how to"]
#[doc = "sequentially load tree sequences from a stream."]
#[doc = ""]
#[doc = "Options**"]
#[doc = ""]
#[doc = "Options can be specified by providing one or more of the following bitwise"]
#[doc = "flags:"]
#[doc = ""]
#[doc = "TSK_NO_INIT"]
#[doc = "Do not initialise this :c:type:`tsk_table_collection_t` before loading."]
#[doc = ""]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to an uninitialised tsk_table_collection_t object"]
#[doc = "if the TSK_NO_INIT option is not set (default), or an initialised"]
#[doc = "tsk_table_collection_t otherwise."]
#[doc = "@param file A FILE stream opened in an appropriate mode for reading (e.g."]
#[doc = "\"r\", \"r+\" or \"w+\") positioned at the beginning of a table collection"]
#[doc = "definition."]
#[doc = "@param options Bitwise options. See above for details."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Writes the data from this table collection to the specified file."]
#[doc = "Usually we expect that data written to a file will be in a form that"]
#[doc = "can be read directly and used to create a tree sequence; that is, we"]
#[doc = "assume that by default the tables are :ref:`sorted <sec_table_sorting>`"]
#[doc = "and :ref:`indexed <sec_table_indexes>`. Following these"]
#[doc = "assumptions, if the tables are not already indexed, we index the tables"]
#[doc = "before writing to file to save the cost of building these indexes at"]
#[doc = "load time. This behaviour requires that the tables are sorted."]
#[doc = "If this automatic indexing is not desired, it can be disabled using"]
#[doc = "the `TSK_NO_BUILD_INDEXES` option."]
#[doc = ""]
#[doc = "If an error occurs the file path is deleted, ensuring that only complete"]
#[doc = "and well formed files will be written."]
#[doc = ""]
#[doc = "Options**"]
#[doc = ""]
#[doc = "Options can be specified by providing one or more of the following bitwise"]
#[doc = "flags:"]
#[doc = ""]
#[doc = "TSK_NO_BUILD_INDEXES"]
#[doc = "Do not build indexes for this table before writing to file. This is useful"]
#[doc = "if you wish to write unsorted tables to file, as building the indexes"]
#[doc = "will raise an error if the table is unsorted."]
#[doc = ""]
#[doc = "Examples**"]
#[doc = ""]
#[doc = ".. code-block:: c"]
#[doc = ""]
#[doc = "int ret;"]
#[doc = "tsk_table_collection_t tables;"]
#[doc = ""]
#[doc = "ret = tsk_table_collection_init(&tables, 0);"]
#[doc = "error_check(ret);"]
#[doc = "tables.sequence_length = 1.0;"]
#[doc = "ret = tsk_table_collection_dump(&tables, \"empty.trees\", 0);"]
#[doc = "error_check(ret);"]
#[doc = ""]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to an initialised tsk_table_collection_t object."]
#[doc = "@param filename A NULL terminated string containing the filename."]
#[doc = "@param options Bitwise options. See above for details."]
#[doc = "@return Return 0 on success or a negative value on failure."]
pub fn tsk_table_collection_dump(
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 Write a table collection to a stream."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Writes the data from this table collection to the specified FILE stream."]
#[doc = "Semantics are identical to :c:func:`tsk_table_collection_dump`."]
#[doc = ""]
#[doc = "Please see the :ref:`sec_c_api_examples_file_streaming` section for an example"]
#[doc = "of how to sequentially dump and load tree sequences from a stream."]
#[doc = ""]
#[doc = "Options**"]
#[doc = ""]
#[doc = "Options can be specified by providing one or more of the following bitwise"]
#[doc = "flags:"]
#[doc = ""]
#[doc = "TSK_NO_BUILD_INDEXES"]
#[doc = "Do not build indexes for this table before writing to file. This is useful"]
#[doc = "if you wish to write unsorted tables to file, as building the indexes"]
#[doc = "will raise an error if the table is unsorted."]
#[doc = ""]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to an initialised tsk_table_collection_t object."]
#[doc = "@param file A FILE stream opened in an appropriate mode for writing (e.g."]
#[doc = "\"w\", \"a\", \"r+\" or \"w+\")."]
#[doc = "@param options Bitwise options. See above for details."]
#[doc = "@return Return 0 on success or a negative value on failure."]
pub fn tsk_table_collection_dumpf(
self_: *mut 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."]
#[doc = ""]
#[doc = "@param self A pointer to an initialised tsk_table_collection_t object."]
#[doc = "@param bookmark A pointer to a tsk_bookmark_t which is updated to contain the number of"]
#[doc = "rows in all tables."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Truncate the tables in this collection so that each one has the number"]
#[doc = "of rows specified in the parameter :c:type:`tsk_bookmark_t`. Use the"]
#[doc = ":c:func:`tsk_table_collection_record_num_rows` function to record the"]
#[doc = "number rows for each table in a table collection at a particular time."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_individual_table_t object."]
#[doc = "@param bookmark The number of rows to retain in each table."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Some of the tables in a table collection must satisfy specific sortedness requirements"]
#[doc = "in order to define a :ref:`valid tree sequence <sec_valid_tree_sequence_requirements>`."]
#[doc = "This method sorts the ``edge``, ``site`` and ``mutation`` tables such that"]
#[doc = "these requirements are guaranteed to be fulfilled. The ``individual``,"]
#[doc = "``node``, ``population`` and ``provenance`` tables do not have any sortedness"]
#[doc = "requirements, and are therefore ignored by this method."]
#[doc = ""]
#[doc = ".. note:: The current implementation **may** sort in such a way that exceeds"]
#[doc = "these requirements, but this behaviour should not be relied upon and later"]
#[doc = "versions may weaken the level of sortedness. However, the method does **guarantee**"]
#[doc = "that the resulting tables describes a valid tree sequence."]
#[doc = ""]
#[doc = ".. warning:: Sorting migrations is currently not supported and an error will be raised"]
#[doc = "if a table collection containing a non-empty migration table is specified."]
#[doc = ""]
#[doc = "The specified :c:type:`tsk_bookmark_t` allows us to specify a start position"]
#[doc = "for sorting in each of the tables; rows before this value are assumed to already be"]
#[doc = "in sorted order and this information is used to make sorting more efficient."]
#[doc = "Positions in tables that are not sorted (``individual``, ``node``, ``population``"]
#[doc = "and ``provenance``) are ignored and can be set to arbitrary values."]
#[doc = ""]
#[doc = ".. warning:: The current implementation only supports specifying a start"]
#[doc = "position for the ``edge`` table and in a limited form for the"]
#[doc = "``site`` and ``mutation`` tables. Specifying a non-zero ``migration``,"]
#[doc = "start position results in an error. The start positions for the"]
#[doc = "``site`` and ``mutation`` tables can either be 0 or the length of the"]
#[doc = "respective tables, allowing these tables to either be fully sorted, or"]
#[doc = "not sorted at all."]
#[doc = ""]
#[doc = "The table collection will always be unindexed after sort successfully completes."]
#[doc = ""]
#[doc = "See the :ref:`table sorting <sec_table_sorting>` section for more details."]
#[doc = "For more control over the sorting process, see the"]
#[doc = ":ref:`sec_c_api_low_level_sorting` section."]
#[doc = ""]
#[doc = "Options**"]
#[doc = ""]
#[doc = "Options can be specified by providing one or more of the following bitwise"]
#[doc = "flags:"]
#[doc = ""]
#[doc = "TSK_NO_CHECK_INTEGRITY"]
#[doc = "Do not run integrity checks using"]
#[doc = ":c:func:`tsk_table_collection_check_integrity` before sorting,"]
#[doc = "potentially leading to a small reduction in execution time. This"]
#[doc = "performance optimisation should not be used unless the calling code can"]
#[doc = "guarantee reference integrity within the table collection. References"]
#[doc = "to rows not in the table or bad offsets will result in undefined"]
#[doc = "behaviour."]
#[doc = ""]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_individual_table_t object."]
#[doc = "@param start The position to begin sorting in each table; all rows less than this"]
#[doc = "position must fulfill the tree sequence sortedness requirements. If this is"]
#[doc = "NULL, sort all rows."]
#[doc = "@param options Sort options. Currently unused; should be"]
#[doc = "set to zero to ensure compatibility with later versions of tskit."]
#[doc = "@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 Simplify the tables to remove redundant information."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Simplification transforms the tables to remove redundancy and canonicalise"]
#[doc = "tree sequence data. See the :ref:`simplification <sec_table_simplification>` section for"]
#[doc = "more details."]
#[doc = ""]
#[doc = "A mapping from the node IDs in the table before simplification to their equivalent"]
#[doc = "values after simplification can be obtained via the ``node_map`` argument. If this"]
#[doc = "is non NULL, ``node_map[u]`` will contain the new ID for node ``u`` after simplification,"]
#[doc = "or ``TSK_NULL`` if the node has been removed. Thus, ``node_map`` must be an array of"]
#[doc = "at least ``self->nodes.num_rows`` :c:type:`tsk_id_t` values."]
#[doc = ""]
#[doc = "Options**:"]
#[doc = ""]
#[doc = "Options can be specified by providing one or more of the following bitwise"]
#[doc = "flags:"]
#[doc = ""]
#[doc = "TSK_FILTER_SITES"]
#[doc = "Remove sites from the output if there are no mutations that reference them."]
#[doc = "TSK_FILTER_POPULATIONS"]
#[doc = "Remove populations from the output if there are no nodes or migrations that"]
#[doc = "reference them."]
#[doc = "TSK_FILTER_INDIVIDUALS"]
#[doc = "Remove individuals from the output if there are no nodes that reference them."]
#[doc = "TSK_REDUCE_TO_SITE_TOPOLOGY"]
#[doc = "Reduce the topological information in the tables to the minimum necessary to"]
#[doc = "represent the trees that contain sites. If there are zero sites this will"]
#[doc = "result in an zero output edges. When the number of sites is greater than zero,"]
#[doc = "every tree in the output tree sequence will contain at least one site."]
#[doc = "For a given site, the topology of the tree containing that site will be"]
#[doc = "identical (up to node ID remapping) to the topology of the corresponding tree"]
#[doc = "in the input."]
#[doc = "TSK_KEEP_UNARY"]
#[doc = "By default simplify removes unary nodes (i.e., nodes with exactly one child)"]
#[doc = "along the path from samples to root. If this option is specified such unary"]
#[doc = "nodes will be preserved in the output."]
#[doc = "TSK_KEEP_INPUT_ROOTS"]
#[doc = "By default simplify removes all topology ancestral the MRCAs of the samples."]
#[doc = "This option inserts edges from these MRCAs back to the roots of the input"]
#[doc = "trees."]
#[doc = ""]
#[doc = ".. note:: Migrations are currently not supported by simplify, and an error will"]
#[doc = "be raised if we attempt call simplify on a table collection with greater"]
#[doc = "than zero migrations. See `<https://github.com/tskit-dev/tskit/issues/20>`_"]
#[doc = ""]
#[doc = "The table collection will always be unindexed after simplify successfully"]
#[doc = "completes."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_individual_table_t object."]
#[doc = "@param samples Either NULL or an array of num_samples distinct and valid node IDs."]
#[doc = "If non-null the nodes in this array will be marked as samples in the output."]
#[doc = "If NULL, the num_samples parameter is ignored and the samples in the output"]
#[doc = "will be the same as the samples in the input. This is equivalent to populating"]
#[doc = "the samples array with all of the sample nodes in the input in increasing"]
#[doc = "order of ID."]
#[doc = "@param num_samples The number of node IDs in the input samples array. Ignored"]
#[doc = "if the samples array is NULL."]
#[doc = "@param options Simplify options; see above for the available bitwise flags."]
#[doc = "For the default behaviour, a value of 0 should be provided."]
#[doc = "@param node_map If not NULL, this array will be filled to define the mapping"]
#[doc = "between nodes IDs in the table collection before and after simplification."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Reduces the table collection to contain only the entries referring to"]
#[doc = "the provided list of nodes, with nodes reordered according to the order"]
#[doc = "they appear in the ``nodes`` argument. Specifically, this subsets and reorders"]
#[doc = "each of the tables as follows:"]
#[doc = ""]
#[doc = "1. Nodes: if in the list of nodes, and in the order provided."]
#[doc = "2. Individuals and Populations: if referred to by a retained node,"]
#[doc = "and in the order first seen when traversing the list of retained nodes."]
#[doc = "3. Edges: if both parent and child are retained nodes."]
#[doc = "4. Mutations: if the mutation's node is a retained node."]
#[doc = "5. Sites: if any mutations remain at the site after removing mutations."]
#[doc = ""]
#[doc = "Retained edges, mutations, and sites appear in the same"]
#[doc = "order as in the original tables."]
#[doc = ""]
#[doc = "If ``nodes`` is the entire list of nodes in the tables, then the"]
#[doc = "resulting tables will be identical to the original tables, but with"]
#[doc = "nodes (and individuals and populations) reordered."]
#[doc = ""]
#[doc = ".. note:: Migrations are currently not supported by susbset, and an error will"]
#[doc = "be raised if we attempt call subset on a table collection with greater"]
#[doc = "than zero migrations."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_table_collection_t object."]
#[doc = "@param nodes An array of num_nodes valid node IDs."]
#[doc = "@param num_nodes The number of node IDs in the input nodes array."]
#[doc = "@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,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Forms the node-wise union of two table collections."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Expands this table collection by adding the non-shared portions of another table"]
#[doc = "collection to itself. The ``other_node_mapping`` encodes which nodes in ``other`` are"]
#[doc = "equivalent to a node in ``self``. The positions in the ``other_node_mapping`` array"]
#[doc = "correspond to node ids in ``other``, and the elements encode the equivalent"]
#[doc = "node id in ``self`` or TSK_NULL if the node is exclusive to ``other``. Nodes"]
#[doc = "that are exclusive ``other`` are added to ``self``, along with:"]
#[doc = ""]
#[doc = "1. Individuals which are new to ``self``."]
#[doc = "2. Edges whose parent or child are new to ``self``."]
#[doc = "3. Sites which were not present in ``self``."]
#[doc = "4. Mutations whose nodes are new to ``self``."]
#[doc = ""]
#[doc = "By default, populations of newly added nodes are assumed to be new populations,"]
#[doc = "and added to the population table as well."]
#[doc = ""]
#[doc = "This operation will also sort the resulting tables, so the tables may change"]
#[doc = "even if nothing new is added, if the original tables were not sorted."]
#[doc = ""]
#[doc = "Options**:"]
#[doc = ""]
#[doc = "Options can be specified by providing one or more of the following bitwise"]
#[doc = "flags:"]
#[doc = ""]
#[doc = "TSK_UNION_NO_CHECK_SHARED"]
#[doc = "By default, union checks that the portion of shared history between"]
#[doc = "``self`` and ``other``, as implied by ``other_node_mapping``, are indeed"]
#[doc = "equivalent. It does so by subsetting both ``self`` and ``other`` on the"]
#[doc = "equivalent nodes specified in ``other_node_mapping``, and then checking for"]
#[doc = "equality of the subsets."]
#[doc = "TSK_UNION_NO_ADD_POP"]
#[doc = "By default, all nodes new to ``self`` are assigned new populations. If this"]
#[doc = "option is specified, nodes that are added to ``self`` will retain the"]
#[doc = "population IDs they have in ``other``."]
#[doc = ""]
#[doc = ".. note:: Migrations are currently not supported by union, and an error will"]
#[doc = "be raised if we attempt call union on a table collection with migrations."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_table_collection_t object."]
#[doc = "@param other A pointer to a tsk_table_collection_t object."]
#[doc = "@param other_node_mapping An array of node IDs that relate nodes in other to nodes in"]
#[doc = "self: the k-th element of other_node_mapping should be the index of the equivalent"]
#[doc = "node in self, or TSK_NULL if the node is not present in self (in which case it"]
#[doc = "will be added to self)."]
#[doc = "@param options Union options; see above for the available bitwise flags."]
#[doc = "For the default behaviour, a value of 0 should be provided."]
#[doc = "@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 metadata"]
#[doc = "@rst"]
#[doc = "Copies the metadata string to this table collection, replacing any existing."]
#[doc = "@endrst"]
#[doc = "@param self A pointer to a tsk_table_collection_t object."]
#[doc = "@param metadata A pointer to a char array"]
#[doc = "@param metadata_length The size of the metadata in bytes."]
#[doc = "@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"]
#[doc = "@rst"]
#[doc = "Copies the metadata schema string to this table collection, replacing any existing."]
#[doc = "@endrst"]
#[doc = "@param self A pointer to a tsk_table_collection_t object."]
#[doc = "@param metadata_schema A pointer to a char array"]
#[doc = "@param metadata_schema_length The size of the metadata schema in bytes."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "This method returns true if the table collection has an index"]
#[doc = "for the edge table. It guarantees that the index exists, and that"]
#[doc = "it is for the same number of edges that are in the edge table. It"]
#[doc = "does *not* guarantee that the index is valid (i.e., if the rows"]
#[doc = "in the edge have been permuted in some way since the index was built)."]
#[doc = ""]
#[doc = "See the :ref:`sec_c_api_table_indexes` section for details on the index"]
#[doc = "life-cycle."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_table_collection_t object."]
#[doc = "@param options Bitwise options. Currently unused; should be"]
#[doc = "set to zero to ensure compatibility with later versions of tskit."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Unconditionally drop the indexes that may be present for this table collection. It"]
#[doc = "is not an error to call this method on an unindexed table collection."]
#[doc = "See the :ref:`sec_c_api_table_indexes` section for details on the index"]
#[doc = "life-cycle."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_table_collection_t object."]
#[doc = "@param options Bitwise options. Currently unused; should be"]
#[doc = "set to zero to ensure compatibility with later versions of tskit."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Builds the tree traversal :ref:`indexes <sec_table_indexes>` for this table"]
#[doc = "collection. Any existing index is first dropped using"]
#[doc = ":c:func:`tsk_table_collection_drop_index`. See the"]
#[doc = ":ref:`sec_c_api_table_indexes` section for details on the index life-cycle."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_table_collection_t object."]
#[doc = "@param options Bitwise options. Currently unused; should be"]
#[doc = "set to zero to ensure compatibility with later versions of tskit."]
#[doc = "@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 Sets the edge insertion/removal index for this table collection"]
#[doc = ""]
#[doc = "@rst"]
#[doc = "This method sets the edge insertion/removal index for this table collection"]
#[doc = "The index arrays should have the same number of edges that are in the"]
#[doc = "edge table. The index is not checked for validity."]
#[doc = ""]
#[doc = "See the :ref:`sec_c_api_table_indexes` section for details on the index"]
#[doc = "life-cycle."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_table_collection_t object."]
#[doc = "@param edge_insertion_order Array of tsk_id_t edge ids."]
#[doc = "@param edge_removal_order Array of tsk_id_t edge ids."]
#[doc = "@return Return 0 on success or a negative value on failure."]
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" {
#[doc = "@brief Runs integrity checks on this table collection."]
#[doc = ""]
#[doc = "@rst"]
#[doc = ""]
#[doc = "Checks the integrity of this table collection. The default checks (i.e., with"]
#[doc = "options = 0) guarantee the integrity of memory and entity references within the"]
#[doc = "table collection. All spatial values (along the genome) are checked"]
#[doc = "to see if they are finite values and within the required bounds. Time values"]
#[doc = "are checked to see if they are finite or marked as unknown."]
#[doc = ""]
#[doc = "To check if a set of tables fulfills the :ref:`requirements"]
#[doc = "<sec_valid_tree_sequence_requirements>` needed for a valid tree sequence, use"]
#[doc = "the TSK_CHECK_TREES option. When this method is called with TSK_CHECK_TREES,"]
#[doc = "the number of trees in the tree sequence is returned. Thus, to check for errors"]
#[doc = "client code should verify that the return value is less than zero. All other"]
#[doc = "options will return zero on success and a negative value on failure."]
#[doc = ""]
#[doc = "More fine-grained checks can be achieved using bitwise combinations of the"]
#[doc = "other options."]
#[doc = ""]
#[doc = "Options**:"]
#[doc = ""]
#[doc = "Options can be specified by providing one or more of the following bitwise"]
#[doc = "flags:"]
#[doc = ""]
#[doc = "TSK_CHECK_EDGE_ORDERING"]
#[doc = "Check edge ordering constraints for a tree sequence."]
#[doc = "TSK_CHECK_SITE_ORDERING"]
#[doc = "Check that sites are in nondecreasing position order."]
#[doc = "TSK_CHECK_SITE_DUPLICATES"]
#[doc = "Check for any duplicate site positions."]
#[doc = "TSK_CHECK_MUTATION_ORDERING"]
#[doc = "Check contraints on the ordering of mutations. Any non-null"]
#[doc = "mutation parents and known times are checked for ordering"]
#[doc = "constraints."]
#[doc = "TSK_CHECK_INDEXES"]
#[doc = "Check that the table indexes exist, and contain valid edge"]
#[doc = "references."]
#[doc = "TSK_CHECK_TREES"]
#[doc = "All checks needed to define a valid tree sequence. Note that"]
#[doc = "this implies all of the above checks."]
#[doc = ""]
#[doc = "It is sometimes useful to disregard some parts of the data model"]
#[doc = "when performing checks:"]
#[doc = ""]
#[doc = "TSK_NO_CHECK_POPULATION_REFS"]
#[doc = "Do not check integrity of references to populations. This"]
#[doc = "can be safely combined with the other checks."]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_table_collection_t object."]
#[doc = "@param options Bitwise options."]
#[doc = "@return Return a negative error value on if any problems are detected"]
#[doc = "in the tree sequence. If the TSK_CHECK_TREES option is provided,"]
#[doc = "the number of trees in the tree sequence will be returned, on"]
#[doc = "success."]
pub fn tsk_table_collection_check_integrity(
self_: *const tsk_table_collection_t,
options: tsk_flags_t,
) -> tsk_id_t;
}
extern "C" {
#[doc = " @}"]
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,
TSK_UNUSED_options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@brief Initialises the memory for the sorter object."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "This must be called before any operations are performed on the"]
#[doc = "table sorter and initialises all fields. The ``edge_sort`` function"]
#[doc = "is set to the default method using qsort. The ``user_data``"]
#[doc = "field is set to NULL."]
#[doc = "This method supports the same options as"]
#[doc = ":c:func:`tsk_table_collection_sort`."]
#[doc = ""]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to an uninitialised tsk_table_sorter_t object."]
#[doc = "@param tables The table collection to sort."]
#[doc = "@param options Sorting options."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "Runs the sorting process:"]
#[doc = ""]
#[doc = "1. Drop the table indexes."]
#[doc = "2. If the ``sort_edges`` function pointer is not NULL, run it. The"]
#[doc = "first parameter to the called function will be a pointer to this"]
#[doc = "table_sorter_t object. The second parameter will be the value"]
#[doc = "``start.edges``. This specifies the offset at which sorting should"]
#[doc = "start in the edge table. This offset is guaranteed to be within the"]
#[doc = "bounds of the edge table."]
#[doc = "3. Sort the site table, building the mapping between site IDs in the"]
#[doc = "current and sorted tables."]
#[doc = "4. Sort the mutation table."]
#[doc = ""]
#[doc = "If an error occurs during the execution of a user-supplied"]
#[doc = "sorting function a non-zero value must be returned. This value"]
#[doc = "will then be returned by ``tsk_table_sorter_run``. The error"]
#[doc = "return value should be chosen to avoid conflicts with tskit error"]
#[doc = "codes."]
#[doc = ""]
#[doc = "See :c:func:`tsk_table_collection_sort` for details on the ``start`` parameter."]
#[doc = ""]
#[doc = "@endrst"]
#[doc = ""]
#[doc = "@param self A pointer to a tsk_table_sorter_t object."]
#[doc = "@param start The position in the tables at which sorting starts."]
#[doc = "@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."]
#[doc = ""]
#[doc = "@param self A pointer to an initialised tsk_table_sorter_t object."]
#[doc = "@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_ibd_finder_init(
ibd_finder: *mut tsk_ibd_finder_t,
tables: *mut tsk_table_collection_t,
pairs: *mut tsk_id_t,
num_pairs: tsk_size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_ibd_finder_set_min_length(
self_: *mut tsk_ibd_finder_t,
min_length: f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_ibd_finder_set_max_time(
self_: *mut tsk_ibd_finder_t,
max_time: f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_ibd_finder_free(self_: *mut tsk_ibd_finder_t) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_ibd_finder_run(ibd_finder: *mut tsk_ibd_finder_t) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_ibd_finder_get_ibd_segments(
ibd_finder: *mut tsk_ibd_finder_t,
pair_index: tsk_id_t,
ret_ibd_segments_head: *mut *mut tsk_segment_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_ibd_finder_print_state(self_: *mut tsk_ibd_finder_t, out: *mut FILE);
}
#[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 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,
pub tables: *mut tsk_table_collection_t,
}
#[test]
fn bindgen_test_layout_tsk_treeseq_t() {
assert_eq!(
::std::mem::size_of::<tsk_treeseq_t>(),
112usize,
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::null::<tsk_treeseq_t>())).num_trees as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(num_trees)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_treeseq_t>())).num_samples as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(num_samples)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_treeseq_t>())).samples as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(samples)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_treeseq_t>())).breakpoints as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(breakpoints)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_treeseq_t>())).sample_index_map as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(sample_index_map)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_treeseq_t>())).individual_nodes_mem as *const _ as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(individual_nodes_mem)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_treeseq_t>())).individual_nodes as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(individual_nodes)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_treeseq_t>())).individual_nodes_length as *const _ as usize
},
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(individual_nodes_length)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_treeseq_t>())).tree_sites_mem as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(tree_sites_mem)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_treeseq_t>())).tree_sites as *const _ as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(tree_sites)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_treeseq_t>())).tree_sites_length as *const _ as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(tree_sites_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_treeseq_t>())).site_mutations_mem as *const _ as usize
},
80usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(site_mutations_mem)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_treeseq_t>())).site_mutations as *const _ as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(site_mutations)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_treeseq_t>())).site_mutations_length as *const _ as usize
},
96usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(site_mutations_length)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_treeseq_t>())).tables as *const _ as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(tsk_treeseq_t),
"::",
stringify!(tables)
)
);
}
#[doc = "@brief A single tree in a tree sequence."]
#[doc = ""]
#[doc = "@rst"]
#[doc = "A ``tsk_tree_t`` object has two basic functions:"]
#[doc = ""]
#[doc = "1. Represent the state of a single tree in a tree sequence;"]
#[doc = "2. Provide methods to transform this state into different trees in the sequence."]
#[doc = ""]
#[doc = "The state of a single tree in the tree sequence is represented using the"]
#[doc = "quintuply linked encoding: please see the"]
#[doc = ":ref:`data model <sec_data_model_tree_structure>` section for details on"]
#[doc = "how this works. The left-to-right ordering of nodes in this encoding"]
#[doc = "is arbitrary, and may change depending on the order in which trees are"]
#[doc = "accessed within the sequence. Please see the"]
#[doc = ":ref:`sec_c_api_examples_tree_traversals` examples for recommended"]
#[doc = "usage."]
#[doc = ""]
#[doc = "On initialisation, a tree is in a \"null\" state: each sample is a"]
#[doc = "root and there are no edges. We must call one of the 'seeking' methods"]
#[doc = "to make the state of the tree object correspond to a particular tree"]
#[doc = "in the sequence. Please see the"]
#[doc = ":ref:`sec_c_api_examples_tree_iteration` examples for recommended"]
#[doc = "usage."]
#[doc = ""]
#[doc = "@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 leftmost root in the tree. Roots are siblings, and"]
#[doc = " other roots can be found using right_sib."]
pub left_root: tsk_id_t,
#[doc = "@brief The parent of node u is parent[u]. Equal to TSK_NULL if node u is a"]
#[doc = "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"]
#[doc = "if 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"]
#[doc = "if 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 TSK_NULL"]
#[doc = "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 TSK_NULL"]
#[doc = "if node u has no siblings to its right."]
pub right_sib: *mut 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 left: f64,
pub right: f64,
pub index: tsk_id_t,
pub num_samples: *mut tsk_id_t,
pub num_tracked_samples: *mut tsk_id_t,
pub marked: *mut u8,
pub mark: u8,
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,
}
#[test]
fn bindgen_test_layout_tsk_tree_t() {
assert_eq!(
::std::mem::size_of::<tsk_tree_t>(),
184usize,
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::null::<tsk_tree_t>())).tree_sequence as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(tree_sequence)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).left_root as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(left_root)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).parent as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(parent)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).left_child as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(left_child)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).right_child as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(right_child)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).left_sib as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(left_sib)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).right_sib as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(right_sib)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).num_nodes as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(num_nodes)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).options as *const _ as usize },
60usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(options)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).root_threshold as *const _ as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(root_threshold)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).samples as *const _ as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(samples)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).left as *const _ as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(left)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).right as *const _ as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(right)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).index as *const _ as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(index)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).num_samples as *const _ as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(num_samples)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).num_tracked_samples as *const _ as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(num_tracked_samples)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).marked as *const _ as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(marked)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).mark as *const _ as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(mark)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).left_sample as *const _ as usize },
136usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(left_sample)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).right_sample as *const _ as usize },
144usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(right_sample)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).next_sample as *const _ as usize },
152usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(next_sample)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).sites as *const _ as usize },
160usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(sites)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).sites_length as *const _ as usize },
168usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(sites_length)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).direction as *const _ as usize },
172usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(direction)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).left_index as *const _ as usize },
176usize,
concat!(
"Offset of field: ",
stringify!(tsk_tree_t),
"::",
stringify!(left_index)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_tree_t>())).right_index as *const _ as usize },
180usize,
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() {
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::null::<_tsk_edge_list_node_t>())).edge as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_tsk_edge_list_node_t),
"::",
stringify!(edge)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_edge_list_node_t>())).next as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(_tsk_edge_list_node_t),
"::",
stringify!(next)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_edge_list_node_t>())).prev as *const _ 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() {
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::null::<tsk_edge_list_t>())).head as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_edge_list_t),
"::",
stringify!(head)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_edge_list_t>())).tail as *const _ 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() {
assert_eq!(
::std::mem::size_of::<tsk_diff_iter_t>(),
48usize,
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::null::<tsk_diff_iter_t>())).num_nodes as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_diff_iter_t),
"::",
stringify!(num_nodes)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_diff_iter_t>())).num_edges as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_diff_iter_t),
"::",
stringify!(num_edges)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_diff_iter_t>())).tree_left as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_diff_iter_t),
"::",
stringify!(tree_left)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_diff_iter_t>())).tree_sequence as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_diff_iter_t),
"::",
stringify!(tree_sequence)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_diff_iter_t>())).insertion_index as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_diff_iter_t),
"::",
stringify!(insertion_index)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_diff_iter_t>())).removal_index as *const _ as usize },
28usize,
concat!(
"Offset of field: ",
stringify!(tsk_diff_iter_t),
"::",
stringify!(removal_index)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_diff_iter_t>())).tree_index as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_diff_iter_t),
"::",
stringify!(tree_index)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_diff_iter_t>())).last_index as *const _ as usize },
36usize,
concat!(
"Offset of field: ",
stringify!(tsk_diff_iter_t),
"::",
stringify!(last_index)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_diff_iter_t>())).edge_list_nodes as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_diff_iter_t),
"::",
stringify!(edge_list_nodes)
)
);
}
extern "C" {
#[doc = "@defgroup TREESEQ_API_GROUP Tree sequence API"]
#[doc = "@{"]
pub fn tsk_treeseq_init(
self_: *mut tsk_treeseq_t,
tables: *const tsk_table_collection_t,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
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" {
pub fn tsk_treeseq_loadf(
self_: *mut tsk_treeseq_t,
file: *mut FILE,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_treeseq_dump(
self_: *mut tsk_treeseq_t,
filename: *const ::std::os::raw::c_char,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_treeseq_dumpf(
self_: *mut tsk_treeseq_t,
file: *mut FILE,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
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" {
pub fn tsk_treeseq_free(self_: *mut tsk_treeseq_t) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_treeseq_print_state(self_: *const tsk_treeseq_t, out: *mut FILE);
}
extern "C" {
#[doc = " @}"]
pub fn tsk_treeseq_get_num_nodes(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
pub fn tsk_treeseq_get_num_edges(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
pub fn tsk_treeseq_get_num_migrations(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
pub fn tsk_treeseq_get_num_sites(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
pub fn tsk_treeseq_get_num_mutations(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
pub fn tsk_treeseq_get_num_provenances(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
pub fn tsk_treeseq_get_num_populations(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
pub fn tsk_treeseq_get_num_individuals(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
pub fn tsk_treeseq_get_num_trees(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
pub fn tsk_treeseq_get_num_samples(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
pub fn tsk_treeseq_get_metadata(self_: *const tsk_treeseq_t) -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn tsk_treeseq_get_metadata_length(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
pub fn tsk_treeseq_get_metadata_schema(
self_: *const tsk_treeseq_t,
) -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn tsk_treeseq_get_metadata_schema_length(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
pub fn tsk_treeseq_get_file_uuid(self_: *const tsk_treeseq_t) -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn tsk_treeseq_get_sequence_length(self_: *const tsk_treeseq_t) -> f64;
}
extern "C" {
pub fn tsk_treeseq_get_breakpoints(self_: *const tsk_treeseq_t) -> *const f64;
}
extern "C" {
pub fn tsk_treeseq_get_samples(self_: *const tsk_treeseq_t) -> *const tsk_id_t;
}
extern "C" {
pub fn tsk_treeseq_get_sample_index_map(self_: *const tsk_treeseq_t) -> *const tsk_id_t;
}
extern "C" {
pub fn tsk_treeseq_is_sample(self_: *const tsk_treeseq_t, u: tsk_id_t) -> bool;
}
extern "C" {
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" {
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" {
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" {
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" {
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" {
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" {
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" {
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" {
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" {
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: size_t,
reference_sets: *const *const tsk_id_t,
reference_set_size: *const size_t,
num_reference_sets: 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 size_t,
num_reference_sets: 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: size_t,
state: *const f64,
result_dim: 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: size_t,
W: *const f64,
M: size_t,
f: general_stat_func_t,
f_params: *mut ::std::os::raw::c_void,
num_windows: size_t,
windows: *const f64,
sigma: *mut f64,
options: tsk_flags_t,
) -> ::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,
result: *mut f64,
options: tsk_flags_t,
) -> ::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,
result: *mut f64,
options: tsk_flags_t,
) -> ::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,
result: *mut f64,
options: tsk_flags_t,
) -> ::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,
result: *mut f64,
options: tsk_flags_t,
) -> ::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,
result: *mut f64,
options: tsk_flags_t,
) -> ::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,
result: *mut f64,
options: tsk_flags_t,
) -> ::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,
result: *mut f64,
options: tsk_flags_t,
) -> ::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,
result: *mut f64,
options: tsk_flags_t,
) -> ::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,
result: *mut f64,
options: tsk_flags_t,
) -> ::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,
result: *mut f64,
options: tsk_flags_t,
) -> ::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,
result: *mut f64,
options: tsk_flags_t,
) -> ::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,
result: *mut f64,
options: tsk_flags_t,
) -> ::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,
result: *mut f64,
options: tsk_flags_t,
) -> ::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,
result: *mut f64,
options: tsk_flags_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = "@defgroup TREE_API_GROUP Tree sequence API"]
#[doc = "@{"]
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" {
pub fn tsk_tree_free(self_: *mut tsk_tree_t) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_tree_get_index(self_: *const tsk_tree_t) -> tsk_id_t;
}
extern "C" {
pub fn tsk_tree_get_num_roots(self_: *const tsk_tree_t) -> tsk_size_t;
}
extern "C" {
pub fn tsk_tree_first(self_: *mut tsk_tree_t) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_tree_last(self_: *mut tsk_tree_t) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_tree_next(self_: *mut tsk_tree_t) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_tree_prev(self_: *mut tsk_tree_t) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_tree_clear(self_: *mut tsk_tree_t) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_tree_print_state(self_: *const tsk_tree_t, out: *mut FILE);
}
extern "C" {
#[doc = " @}"]
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_lists(self_: *const tsk_tree_t) -> bool;
}
extern "C" {
pub fn tsk_tree_has_sample_counts(self_: *const tsk_tree_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_tree_is_descendant(self_: *const tsk_tree_t, u: tsk_id_t, v: tsk_id_t) -> bool;
}
extern "C" {
pub fn tsk_tree_is_sample(self_: *const tsk_tree_t, u: tsk_id_t) -> bool;
}
extern "C" {
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" {
pub fn tsk_tree_set_tracked_samples(
self_: *mut tsk_tree_t,
num_tracked_samples: size_t,
tracked_samples: *const tsk_id_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_tree_set_tracked_samples_from_sample_list(
self_: *mut tsk_tree_t,
other: *mut tsk_tree_t,
node: tsk_id_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
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" {
pub fn tsk_tree_get_time(
self_: *const tsk_tree_t,
u: tsk_id_t,
t: *mut f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
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" {
pub fn tsk_tree_get_num_samples(
self_: *const tsk_tree_t,
u: tsk_id_t,
num_samples: *mut size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tsk_tree_get_num_tracked_samples(
self_: *const tsk_tree_t,
u: tsk_id_t,
num_tracked_samples: *mut size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
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" {
pub fn tsk_tree_depth(
self_: *const tsk_tree_t,
u: tsk_id_t,
depth: *mut tsk_size_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: i8,
}
#[test]
fn bindgen_test_layout_tsk_state_transition_t() {
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::null::<tsk_state_transition_t>())).node as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_state_transition_t),
"::",
stringify!(node)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_state_transition_t>())).parent as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_state_transition_t),
"::",
stringify!(parent)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_state_transition_t>())).state as *const _ 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 i8,
cost_matrix: *mut f64,
options: tsk_flags_t,
ancestral_state: *mut i8,
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_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);
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct tsk_variant_t {
pub site: *const tsk_site_t,
pub alleles: *mut *const ::std::os::raw::c_char,
pub allele_lengths: *mut tsk_size_t,
pub num_alleles: tsk_size_t,
pub max_alleles: tsk_size_t,
pub has_missing_data: bool,
pub genotypes: tsk_variant_t__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union tsk_variant_t__bindgen_ty_1 {
pub i8_: *mut i8,
pub i16_: *mut i16,
_bindgen_union_align: u64,
}
#[test]
fn bindgen_test_layout_tsk_variant_t__bindgen_ty_1() {
assert_eq!(
::std::mem::size_of::<tsk_variant_t__bindgen_ty_1>(),
8usize,
concat!("Size of: ", stringify!(tsk_variant_t__bindgen_ty_1))
);
assert_eq!(
::std::mem::align_of::<tsk_variant_t__bindgen_ty_1>(),
8usize,
concat!("Alignment of ", stringify!(tsk_variant_t__bindgen_ty_1))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_variant_t__bindgen_ty_1>())).i8_ as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t__bindgen_ty_1),
"::",
stringify!(i8_)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_variant_t__bindgen_ty_1>())).i16_ as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t__bindgen_ty_1),
"::",
stringify!(i16_)
)
);
}
#[test]
fn bindgen_test_layout_tsk_variant_t() {
assert_eq!(
::std::mem::size_of::<tsk_variant_t>(),
48usize,
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::null::<tsk_variant_t>())).site as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(site)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_variant_t>())).alleles as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(alleles)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_variant_t>())).allele_lengths as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(allele_lengths)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_variant_t>())).num_alleles as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(num_alleles)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_variant_t>())).max_alleles as *const _ as usize },
28usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(max_alleles)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_variant_t>())).has_missing_data as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(has_missing_data)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_variant_t>())).genotypes as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_variant_t),
"::",
stringify!(genotypes)
)
);
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct tsk_vargen_t {
pub num_samples: size_t,
pub num_sites: size_t,
pub tree_sequence: *const tsk_treeseq_t,
pub sample_index_map: *const tsk_id_t,
pub alt_samples: *mut tsk_id_t,
pub alt_sample_index_map: *mut tsk_id_t,
pub user_alleles: bool,
pub user_alleles_mem: *mut ::std::os::raw::c_char,
pub tree_site_index: size_t,
pub finished: ::std::os::raw::c_int,
pub traversal_stack: *mut tsk_id_t,
pub tree: tsk_tree_t,
pub options: tsk_flags_t,
pub variant: tsk_variant_t,
}
#[test]
fn bindgen_test_layout_tsk_vargen_t() {
assert_eq!(
::std::mem::size_of::<tsk_vargen_t>(),
328usize,
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::null::<tsk_vargen_t>())).num_samples as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_vargen_t),
"::",
stringify!(num_samples)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_vargen_t>())).num_sites as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_vargen_t),
"::",
stringify!(num_sites)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_vargen_t>())).tree_sequence as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_vargen_t),
"::",
stringify!(tree_sequence)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_vargen_t>())).sample_index_map as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_vargen_t),
"::",
stringify!(sample_index_map)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_vargen_t>())).alt_samples as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_vargen_t),
"::",
stringify!(alt_samples)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_vargen_t>())).alt_sample_index_map as *const _ as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_vargen_t),
"::",
stringify!(alt_sample_index_map)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_vargen_t>())).user_alleles as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_vargen_t),
"::",
stringify!(user_alleles)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_vargen_t>())).user_alleles_mem as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(tsk_vargen_t),
"::",
stringify!(user_alleles_mem)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_vargen_t>())).tree_site_index as *const _ as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(tsk_vargen_t),
"::",
stringify!(tree_site_index)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_vargen_t>())).finished as *const _ as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(tsk_vargen_t),
"::",
stringify!(finished)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_vargen_t>())).traversal_stack as *const _ as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(tsk_vargen_t),
"::",
stringify!(traversal_stack)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_vargen_t>())).tree as *const _ as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(tsk_vargen_t),
"::",
stringify!(tree)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_vargen_t>())).options as *const _ as usize },
272usize,
concat!(
"Offset of field: ",
stringify!(tsk_vargen_t),
"::",
stringify!(options)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_vargen_t>())).variant as *const _ as usize },
280usize,
concat!(
"Offset of field: ",
stringify!(tsk_vargen_t),
"::",
stringify!(variant)
)
);
}
extern "C" {
pub fn tsk_vargen_init(
self_: *mut tsk_vargen_t,
tree_sequence: *const tsk_treeseq_t,
samples: *const tsk_id_t,
num_samples: 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: size_t,
options: tsk_flags_t,
buffer_size: size_t,
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 outer_tree: *mut tsk_tree_t,
pub inner_tree: *mut tsk_tree_t,
pub num_sites: tsk_size_t,
pub tree_changed: ::std::os::raw::c_int,
pub tree_sequence: *const tsk_treeseq_t,
}
#[test]
fn bindgen_test_layout_tsk_ld_calc_t() {
assert_eq!(
::std::mem::size_of::<tsk_ld_calc_t>(),
32usize,
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::null::<tsk_ld_calc_t>())).outer_tree as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_ld_calc_t),
"::",
stringify!(outer_tree)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_ld_calc_t>())).inner_tree as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_ld_calc_t),
"::",
stringify!(inner_tree)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_ld_calc_t>())).num_sites as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_ld_calc_t),
"::",
stringify!(num_sites)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_ld_calc_t>())).tree_changed as *const _ as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(tsk_ld_calc_t),
"::",
stringify!(tree_changed)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_ld_calc_t>())).tree_sequence as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_ld_calc_t),
"::",
stringify!(tree_sequence)
)
);
}
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() {
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::null::<tsk_value_transition_t>())).tree_node as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_value_transition_t),
"::",
stringify!(tree_node)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_value_transition_t>())).value_index as *const _ as usize
},
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_value_transition_t),
"::",
stringify!(value_index)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_value_transition_t>())).value as *const _ 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: size_t,
pub value: f64,
}
#[test]
fn bindgen_test_layout_tsk_argsort_t() {
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::null::<tsk_argsort_t>())).index as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_argsort_t),
"::",
stringify!(index)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_argsort_t>())).value as *const _ 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() {
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::null::<tsk_transition_stack_t>())).tree_node as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_transition_stack_t),
"::",
stringify!(tree_node)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_transition_stack_t>())).old_state as *const _ as usize
},
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_transition_stack_t),
"::",
stringify!(old_state)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_transition_stack_t>())).new_state as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_transition_stack_t),
"::",
stringify!(new_state)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_transition_stack_t>())).transition_parent as *const _
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() {
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::null::<tsk_site_probability_t>())).normalisation_factor as *const _
as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_probability_t),
"::",
stringify!(normalisation_factor)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_site_probability_t>())).value as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_probability_t),
"::",
stringify!(value)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_site_probability_t>())).node as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_site_probability_t),
"::",
stringify!(node)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_site_probability_t>())).num_values as *const _ 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() {
assert_eq!(
::std::mem::size_of::<tsk_compressed_matrix_t>(),
112usize,
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::null::<tsk_compressed_matrix_t>())).tree_sequence as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_compressed_matrix_t),
"::",
stringify!(tree_sequence)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_compressed_matrix_t>())).options as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(tsk_compressed_matrix_t),
"::",
stringify!(options)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_compressed_matrix_t>())).num_sites as *const _ as usize
},
12usize,
concat!(
"Offset of field: ",
stringify!(tsk_compressed_matrix_t),
"::",
stringify!(num_sites)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_compressed_matrix_t>())).num_samples as *const _ as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(tsk_compressed_matrix_t),
"::",
stringify!(num_samples)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_compressed_matrix_t>())).normalisation_factor as *const _
as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(tsk_compressed_matrix_t),
"::",
stringify!(normalisation_factor)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_compressed_matrix_t>())).num_transitions as *const _ as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(tsk_compressed_matrix_t),
"::",
stringify!(num_transitions)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_compressed_matrix_t>())).values as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(tsk_compressed_matrix_t),
"::",
stringify!(values)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_compressed_matrix_t>())).nodes as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(tsk_compressed_matrix_t),
"::",
stringify!(nodes)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_compressed_matrix_t>())).memory as *const _ as usize },
56usize,
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() {
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::null::<tsk_recomb_required_record>())).site as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_recomb_required_record),
"::",
stringify!(site)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tsk_recomb_required_record>())).node as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(tsk_recomb_required_record),
"::",
stringify!(node)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_recomb_required_record>())).required as *const _ 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: size_t,
pub max_recomb_records: size_t,
}
#[test]
fn bindgen_test_layout_tsk_viterbi_matrix_t() {
assert_eq!(
::std::mem::size_of::<tsk_viterbi_matrix_t>(),
136usize,
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::null::<tsk_viterbi_matrix_t>())).matrix as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(tsk_viterbi_matrix_t),
"::",
stringify!(matrix)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_viterbi_matrix_t>())).recombination_required as *const _
as usize
},
112usize,
concat!(
"Offset of field: ",
stringify!(tsk_viterbi_matrix_t),
"::",
stringify!(recombination_required)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_viterbi_matrix_t>())).num_recomb_records as *const _ as usize
},
120usize,
concat!(
"Offset of field: ",
stringify!(tsk_viterbi_matrix_t),
"::",
stringify!(num_recomb_records)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tsk_viterbi_matrix_t>())).max_recomb_records as *const _ as usize
},
128usize,
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 u8,
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: size_t,
pub max_transitions: size_t,
pub values: *mut f64,
pub num_values: size_t,
pub max_values: size_t,
pub num_fitch_words: size_t,
pub fitch_sets: *mut u64,
pub transition_parent: *mut tsk_id_t,
pub num_transition_samples: *mut tsk_id_t,
pub allelic_state: *mut i8,
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() {
assert_eq!(
::std::mem::size_of::<_tsk_ls_hmm_t>(),
448usize,
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::null::<_tsk_ls_hmm_t>())).tree_sequence as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(tree_sequence)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<_tsk_ls_hmm_t>())).recombination_rate as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(recombination_rate)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).mutation_rate as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(mutation_rate)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).alleles as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(alleles)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).precision as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(precision)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).num_alleles as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(num_alleles)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).num_samples as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(num_samples)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).num_sites as *const _ as usize },
52usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(num_sites)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).num_nodes as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(num_nodes)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).tree as *const _ as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(tree)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).diffs as *const _ as usize },
248usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(diffs)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).parent as *const _ as usize },
296usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(parent)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).transitions as *const _ as usize },
304usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(transitions)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).transitions_copy as *const _ as usize },
312usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(transitions_copy)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).transition_stack as *const _ as usize },
320usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(transition_stack)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).transition_index as *const _ as usize },
328usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(transition_index)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<_tsk_ls_hmm_t>())).transition_time_order as *const _ as usize
},
336usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(transition_time_order)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).num_transitions as *const _ as usize },
344usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(num_transitions)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).max_transitions as *const _ as usize },
352usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(max_transitions)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).values as *const _ as usize },
360usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(values)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).num_values as *const _ as usize },
368usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(num_values)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).max_values as *const _ as usize },
376usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(max_values)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).num_fitch_words as *const _ as usize },
384usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(num_fitch_words)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).fitch_sets as *const _ as usize },
392usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(fitch_sets)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).transition_parent as *const _ as usize },
400usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(transition_parent)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<_tsk_ls_hmm_t>())).num_transition_samples as *const _ as usize
},
408usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(num_transition_samples)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).allelic_state as *const _ as usize },
416usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(allelic_state)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).next_probability as *const _ as usize },
424usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(next_probability)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<_tsk_ls_hmm_t>())).compute_normalisation_factor as *const _
as usize
},
432usize,
concat!(
"Offset of field: ",
stringify!(_tsk_ls_hmm_t),
"::",
stringify!(compute_normalisation_factor)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_tsk_ls_hmm_t>())).output as *const _ as usize },
440usize,
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 i8,
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 i8,
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 i8,
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: 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: 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;
}