From f8aaf21991c2a5adcdca56f3638f321b2ccbe809 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Fri, 31 Jan 2025 13:11:41 -0500 Subject: [Rust] Make some core handles public This is a requirement if we want rust plugins to expose sane FFIs --- rust/src/basic_block.rs | 2 +- rust/src/function.rs | 6 +++--- rust/src/platform.rs | 2 +- rust/src/rc.rs | 2 +- rust/src/symbol.rs | 2 +- rust/src/types.rs | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) (limited to 'rust/src') diff --git a/rust/src/basic_block.rs b/rust/src/basic_block.rs index 67b85987..3e21094a 100644 --- a/rust/src/basic_block.rs +++ b/rust/src/basic_block.rs @@ -112,7 +112,7 @@ pub struct BasicBlock { } impl BasicBlock { - pub(crate) unsafe fn from_raw(handle: *mut BNBasicBlock, context: C) -> Self { + pub unsafe fn from_raw(handle: *mut BNBasicBlock, context: C) -> Self { Self { handle, context } } diff --git a/rust/src/function.rs b/rust/src/function.rs index 1c2bb21b..d126db3b 100644 --- a/rust/src/function.rs +++ b/rust/src/function.rs @@ -137,7 +137,7 @@ pub struct NativeBlock { } impl NativeBlock { - pub(crate) fn new() -> Self { + pub fn new() -> Self { NativeBlock { _priv: () } } } @@ -305,12 +305,12 @@ pub struct Function { } impl Function { - pub(crate) unsafe fn from_raw(handle: *mut BNFunction) -> Self { + pub unsafe fn from_raw(handle: *mut BNFunction) -> Self { debug_assert!(!handle.is_null()); Self { handle } } - pub(crate) unsafe fn ref_from_raw(handle: *mut BNFunction) -> Ref { + pub unsafe fn ref_from_raw(handle: *mut BNFunction) -> Ref { debug_assert!(!handle.is_null()); Ref::new(Self { handle }) } diff --git a/rust/src/platform.rs b/rust/src/platform.rs index 1bbdef4e..609f4edc 100644 --- a/rust/src/platform.rs +++ b/rust/src/platform.rs @@ -72,7 +72,7 @@ macro_rules! cc_func { } impl Platform { - pub(crate) unsafe fn from_raw(handle: *mut BNPlatform) -> Self { + pub unsafe fn from_raw(handle: *mut BNPlatform) -> Self { debug_assert!(!handle.is_null()); Self { handle } } diff --git a/rust/src/rc.rs b/rust/src/rc.rs index 84168876..f6abb036 100644 --- a/rust/src/rc.rs +++ b/rust/src/rc.rs @@ -55,7 +55,7 @@ impl Ref { Self { contents } } - pub(crate) unsafe fn into_raw(obj: Self) -> T { + pub unsafe fn into_raw(obj: Self) -> T { let res = ptr::read(&obj.contents); mem::forget(obj); res diff --git a/rust/src/symbol.rs b/rust/src/symbol.rs index b06a0f2f..094aeba7 100644 --- a/rust/src/symbol.rs +++ b/rust/src/symbol.rs @@ -217,7 +217,7 @@ impl SymbolBuilder { #[derive(Eq)] pub struct Symbol { - pub(crate) handle: *mut BNSymbol, + pub handle: *mut BNSymbol, } impl Symbol { diff --git a/rust/src/types.rs b/rust/src/types.rs index 7fdbe0c6..03e2fc2c 100644 --- a/rust/src/types.rs +++ b/rust/src/types.rs @@ -431,7 +431,7 @@ impl Drop for TypeBuilder { #[repr(transparent)] pub struct Type { - pub(crate) handle: *mut BNType, + pub handle: *mut BNType, } /// ```no_run -- cgit v1.3.1