summaryrefslogtreecommitdiff
path: root/rust-src
diff options
context:
space:
mode:
Diffstat (limited to 'rust-src')
-rw-r--r--rust-src/bch_bindgen/build.rs1
-rw-r--r--rust-src/bch_bindgen/src/lib.rs4
2 files changed, 3 insertions, 2 deletions
diff --git a/rust-src/bch_bindgen/build.rs b/rust-src/bch_bindgen/build.rs
index 92ec3cef..819b337e 100644
--- a/rust-src/bch_bindgen/build.rs
+++ b/rust-src/bch_bindgen/build.rs
@@ -60,6 +60,7 @@ fn main() {
.allowlist_var("KEY_SPEC_.*")
.allowlist_var("Fix753_FMODE_.*")
.allowlist_var("bch.*")
+ .allowlist_var("__bch2.*")
.allowlist_var("__BTREE_ITER.*")
.allowlist_var("BTREE_ITER.*")
.blocklist_item("bch2_bkey_ops")
diff --git a/rust-src/bch_bindgen/src/lib.rs b/rust-src/bch_bindgen/src/lib.rs
index 73aeef64..4c549442 100644
--- a/rust-src/bch_bindgen/src/lib.rs
+++ b/rust-src/bch_bindgen/src/lib.rs
@@ -62,7 +62,7 @@ use std::fmt;
impl fmt::Display for c::btree_id {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- let s = unsafe { CStr::from_ptr(*c::bch2_btree_ids.get_unchecked(*self as usize)) };
+ let s = unsafe { CStr::from_ptr(c::bch2_btree_id_str(*self)) };
let s = s.to_str().unwrap();
write!(f, "{}", s)
}
@@ -92,7 +92,7 @@ impl FromStr for c::btree_id {
let s = CString::new(s).unwrap();
let p = s.as_ptr();
- let v = unsafe {c::match_string(c::bch2_btree_ids[..].as_ptr(), (-(1 as isize)) as usize, p)};
+ let v = unsafe {c::match_string(c::__bch2_btree_ids[..].as_ptr(), (-(1 as isize)) as usize, p)};
if v >= 0 {
Ok(unsafe { std::mem::transmute(v) })
} else {