pub const tb_MAXPATHLEN: u32 = 1024;
pub type size_t = ::std::os::raw::c_ulong;
impl TB_return_values {
pub const tb_DRAW: TB_return_values = TB_return_values(0);
}
impl TB_return_values {
pub const tb_WMATE: TB_return_values = TB_return_values(1);
}
impl TB_return_values {
pub const tb_BMATE: TB_return_values = TB_return_values(2);
}
impl TB_return_values {
pub const tb_FORBID: TB_return_values = TB_return_values(3);
}
impl TB_return_values {
pub const tb_UNKNOWN: TB_return_values = TB_return_values(7);
}
impl ::std::ops::BitOr<TB_return_values> for TB_return_values {
type Output = Self;
#[inline]
fn bitor(self, other: Self) -> Self {
TB_return_values(self.0 | other.0)
}
}
impl ::std::ops::BitOrAssign for TB_return_values {
#[inline]
fn bitor_assign(&mut self, rhs: TB_return_values) {
self.0 |= rhs.0;
}
}
impl ::std::ops::BitAnd<TB_return_values> for TB_return_values {
type Output = Self;
#[inline]
fn bitand(self, other: Self) -> Self {
TB_return_values(self.0 & other.0)
}
}
impl ::std::ops::BitAndAssign for TB_return_values {
#[inline]
fn bitand_assign(&mut self, rhs: TB_return_values) {
self.0 &= rhs.0;
}
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct TB_return_values(pub ::std::os::raw::c_uint);
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum TB_pieces {
tb_NOPIECE = 0,
tb_PAWN = 1,
tb_KNIGHT = 2,
tb_BISHOP = 3,
tb_ROOK = 4,
tb_QUEEN = 5,
tb_KING = 6,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum TB_sides {
tb_WHITE_TO_MOVE = 0,
tb_BLACK_TO_MOVE = 1,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum TB_squares {
tb_A1 = 0,
tb_B1 = 1,
tb_C1 = 2,
tb_D1 = 3,
tb_E1 = 4,
tb_F1 = 5,
tb_G1 = 6,
tb_H1 = 7,
tb_A2 = 8,
tb_B2 = 9,
tb_C2 = 10,
tb_D2 = 11,
tb_E2 = 12,
tb_F2 = 13,
tb_G2 = 14,
tb_H2 = 15,
tb_A3 = 16,
tb_B3 = 17,
tb_C3 = 18,
tb_D3 = 19,
tb_E3 = 20,
tb_F3 = 21,
tb_G3 = 22,
tb_H3 = 23,
tb_A4 = 24,
tb_B4 = 25,
tb_C4 = 26,
tb_D4 = 27,
tb_E4 = 28,
tb_F4 = 29,
tb_G4 = 30,
tb_H4 = 31,
tb_A5 = 32,
tb_B5 = 33,
tb_C5 = 34,
tb_D5 = 35,
tb_E5 = 36,
tb_F5 = 37,
tb_G5 = 38,
tb_H5 = 39,
tb_A6 = 40,
tb_B6 = 41,
tb_C6 = 42,
tb_D6 = 43,
tb_E6 = 44,
tb_F6 = 45,
tb_G6 = 46,
tb_H6 = 47,
tb_A7 = 48,
tb_B7 = 49,
tb_C7 = 50,
tb_D7 = 51,
tb_E7 = 52,
tb_F7 = 53,
tb_G7 = 54,
tb_H7 = 55,
tb_A8 = 56,
tb_B8 = 57,
tb_C8 = 58,
tb_D8 = 59,
tb_E8 = 60,
tb_F8 = 61,
tb_G8 = 62,
tb_H8 = 63,
tb_NOSQUARE = 64,
}
impl TB_castling {
pub const tb_NOCASTLE: TB_castling = TB_castling(0);
}
impl TB_castling {
pub const tb_WOO: TB_castling = TB_castling(8);
}
impl TB_castling {
pub const tb_WOOO: TB_castling = TB_castling(4);
}
impl TB_castling {
pub const tb_BOO: TB_castling = TB_castling(2);
}
impl TB_castling {
pub const tb_BOOO: TB_castling = TB_castling(1);
}
impl ::std::ops::BitOr<TB_castling> for TB_castling {
type Output = Self;
#[inline]
fn bitor(self, other: Self) -> Self {
TB_castling(self.0 | other.0)
}
}
impl ::std::ops::BitOrAssign for TB_castling {
#[inline]
fn bitor_assign(&mut self, rhs: TB_castling) {
self.0 |= rhs.0;
}
}
impl ::std::ops::BitAnd<TB_castling> for TB_castling {
type Output = Self;
#[inline]
fn bitand(self, other: Self) -> Self {
TB_castling(self.0 & other.0)
}
}
impl ::std::ops::BitAndAssign for TB_castling {
#[inline]
fn bitand_assign(&mut self, rhs: TB_castling) {
self.0 &= rhs.0;
}
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct TB_castling(pub ::std::os::raw::c_uint);
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum TB_compression_scheme {
tb_UNCOMPRESSED = 0,
tb_CP1 = 1,
tb_CP2 = 2,
tb_CP3 = 3,
tb_CP4 = 4,
}
extern "C" {
pub fn tb_init(
verbosity: ::std::os::raw::c_int,
compression_scheme: ::std::os::raw::c_int,
paths: *mut *const ::std::os::raw::c_char,
) -> *mut ::std::os::raw::c_char;
}
extern "C" {
pub fn tb_restart(
verbosity: ::std::os::raw::c_int,
compression_scheme: ::std::os::raw::c_int,
paths: *mut *const ::std::os::raw::c_char,
) -> *mut ::std::os::raw::c_char;
}
extern "C" {
pub fn tb_done();
}
extern "C" {
pub fn tb_probe_hard(
stm: ::std::os::raw::c_uint,
epsq: ::std::os::raw::c_uint,
castles: ::std::os::raw::c_uint,
inp_wSQ: *const ::std::os::raw::c_uint,
inp_bSQ: *const ::std::os::raw::c_uint,
inp_wPC: *const ::std::os::raw::c_uchar,
inp_bPC: *const ::std::os::raw::c_uchar,
tbinfo: *mut ::std::os::raw::c_uint,
plies: *mut ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tb_probe_soft(
stm: ::std::os::raw::c_uint,
epsq: ::std::os::raw::c_uint,
castles: ::std::os::raw::c_uint,
inp_wSQ: *const ::std::os::raw::c_uint,
inp_bSQ: *const ::std::os::raw::c_uint,
inp_wPC: *const ::std::os::raw::c_uchar,
inp_bPC: *const ::std::os::raw::c_uchar,
tbinfo: *mut ::std::os::raw::c_uint,
plies: *mut ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tb_probe_WDL_hard(
stm: ::std::os::raw::c_uint,
epsq: ::std::os::raw::c_uint,
castles: ::std::os::raw::c_uint,
inp_wSQ: *const ::std::os::raw::c_uint,
inp_bSQ: *const ::std::os::raw::c_uint,
inp_wPC: *const ::std::os::raw::c_uchar,
inp_bPC: *const ::std::os::raw::c_uchar,
tbinfo: *mut ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tb_probe_WDL_soft(
stm: ::std::os::raw::c_uint,
epsq: ::std::os::raw::c_uint,
castles: ::std::os::raw::c_uint,
inp_wSQ: *const ::std::os::raw::c_uint,
inp_bSQ: *const ::std::os::raw::c_uint,
inp_wPC: *const ::std::os::raw::c_uchar,
inp_bPC: *const ::std::os::raw::c_uchar,
tbinfo: *mut ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tb_is_initialized() -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tb_availability() -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn tb_indexmemory() -> size_t;
}
extern "C" {
pub fn tbcache_init(
cache_mem: size_t,
wdl_fraction: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tbcache_restart(
cache_mem: size_t,
wdl_fraction: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tbcache_done();
}
extern "C" {
pub fn tbcache_is_on() -> ::std::os::raw::c_int;
}
extern "C" {
pub fn tbcache_flush();
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct TB_STATS {
pub wdl_easy_hits: [::std::os::raw::c_ulong; 2usize],
pub wdl_hard_prob: [::std::os::raw::c_ulong; 2usize],
pub wdl_soft_prob: [::std::os::raw::c_ulong; 2usize],
pub wdl_cachesize: size_t,
pub wdl_occupancy: f64,
pub dtm_easy_hits: [::std::os::raw::c_ulong; 2usize],
pub dtm_hard_prob: [::std::os::raw::c_ulong; 2usize],
pub dtm_soft_prob: [::std::os::raw::c_ulong; 2usize],
pub dtm_cachesize: size_t,
pub dtm_occupancy: f64,
pub total_hits: [::std::os::raw::c_ulong; 2usize],
pub memory_hits: [::std::os::raw::c_ulong; 2usize],
pub drive_hits: [::std::os::raw::c_ulong; 2usize],
pub drive_miss: [::std::os::raw::c_ulong; 2usize],
pub bytes_read: [::std::os::raw::c_ulong; 2usize],
pub files_opened: ::std::os::raw::c_ulong,
pub memory_efficiency: f64,
}
#[test]
fn bindgen_test_layout_TB_STATS() {
assert_eq!(
::std::mem::size_of::<TB_STATS>(),
224usize,
concat!("Size of: ", stringify!(TB_STATS))
);
assert_eq!(
::std::mem::align_of::<TB_STATS>(),
8usize,
concat!("Alignment of ", stringify!(TB_STATS))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<TB_STATS>())).wdl_easy_hits as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(TB_STATS),
"::",
stringify!(wdl_easy_hits)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<TB_STATS>())).wdl_hard_prob as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(TB_STATS),
"::",
stringify!(wdl_hard_prob)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<TB_STATS>())).wdl_soft_prob as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(TB_STATS),
"::",
stringify!(wdl_soft_prob)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<TB_STATS>())).wdl_cachesize as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(TB_STATS),
"::",
stringify!(wdl_cachesize)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<TB_STATS>())).wdl_occupancy as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(TB_STATS),
"::",
stringify!(wdl_occupancy)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<TB_STATS>())).dtm_easy_hits as *const _ as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(TB_STATS),
"::",
stringify!(dtm_easy_hits)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<TB_STATS>())).dtm_hard_prob as *const _ as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(TB_STATS),
"::",
stringify!(dtm_hard_prob)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<TB_STATS>())).dtm_soft_prob as *const _ as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(TB_STATS),
"::",
stringify!(dtm_soft_prob)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<TB_STATS>())).dtm_cachesize as *const _ as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(TB_STATS),
"::",
stringify!(dtm_cachesize)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<TB_STATS>())).dtm_occupancy as *const _ as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(TB_STATS),
"::",
stringify!(dtm_occupancy)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<TB_STATS>())).total_hits as *const _ as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(TB_STATS),
"::",
stringify!(total_hits)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<TB_STATS>())).memory_hits as *const _ as usize },
144usize,
concat!(
"Offset of field: ",
stringify!(TB_STATS),
"::",
stringify!(memory_hits)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<TB_STATS>())).drive_hits as *const _ as usize },
160usize,
concat!(
"Offset of field: ",
stringify!(TB_STATS),
"::",
stringify!(drive_hits)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<TB_STATS>())).drive_miss as *const _ as usize },
176usize,
concat!(
"Offset of field: ",
stringify!(TB_STATS),
"::",
stringify!(drive_miss)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<TB_STATS>())).bytes_read as *const _ as usize },
192usize,
concat!(
"Offset of field: ",
stringify!(TB_STATS),
"::",
stringify!(bytes_read)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<TB_STATS>())).files_opened as *const _ as usize },
208usize,
concat!(
"Offset of field: ",
stringify!(TB_STATS),
"::",
stringify!(files_opened)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<TB_STATS>())).memory_efficiency as *const _ as usize },
216usize,
concat!(
"Offset of field: ",
stringify!(TB_STATS),
"::",
stringify!(memory_efficiency)
)
);
}
extern "C" {
pub fn tbstats_reset();
}
extern "C" {
pub fn tbstats_get(stats: *mut TB_STATS);
}
extern "C" {
pub fn tbpaths_init() -> *mut *const ::std::os::raw::c_char;
}
extern "C" {
pub fn tbpaths_add(
ps: *mut *const ::std::os::raw::c_char,
newpath: *const ::std::os::raw::c_char,
) -> *mut *const ::std::os::raw::c_char;
}
extern "C" {
pub fn tbpaths_done(
ps: *mut *const ::std::os::raw::c_char,
) -> *mut *const ::std::os::raw::c_char;
}
extern "C" {
pub fn tbpaths_getmain() -> *const ::std::os::raw::c_char;
}