diff options
| author | Xusheng <xusheng@vector35.com> | 2021-09-28 14:19:23 +0800 |
|---|---|---|
| committer | Xusheng <xusheng@vector35.com> | 2022-04-29 11:21:47 +0800 |
| commit | 87a8a04db5c0a80c06819ec6caf1568b7202cf51 (patch) | |
| tree | 8850056e2ade5dd60262b20a76e035658136b965 /rust/src/custombinaryview.rs | |
| parent | dbb5c9d47b3db0a478aab57b9ef43d0dd3f6d4b5 (diff) | |
Check in the debugger
Diffstat (limited to 'rust/src/custombinaryview.rs')
| -rw-r--r-- | rust/src/custombinaryview.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/rust/src/custombinaryview.rs b/rust/src/custombinaryview.rs index 3afc6dc6..d547c388 100644 --- a/rust/src/custombinaryview.rs +++ b/rust/src/custombinaryview.rs @@ -55,6 +55,16 @@ where }) } + extern "C" fn cb_deprecated<T>(ctxt: *mut c_void) -> bool + where + T: CustomBinaryViewType, + { + ffi_wrap!("BinaryViewTypeBase::is_deprecated", unsafe { + let view_type = &*(ctxt as *mut T); + view_type.is_deprecated() + }) + } + extern "C" fn cb_create<T>(ctxt: *mut c_void, data: *mut BNBinaryView) -> *mut BNBinaryView where T: CustomBinaryViewType, @@ -117,6 +127,7 @@ where create: Some(cb_create::<T>), parse: Some(cb_parse::<T>), isValidForData: Some(cb_valid::<T>), + isDeprecated: Some(cb_deprecated::<T>), getLoadSettingsForData: Some(cb_load_settings::<T>), }; @@ -141,6 +152,8 @@ where pub trait BinaryViewTypeBase: AsRef<BinaryViewType> { fn is_valid_for(&self, data: &BinaryView) -> bool; + fn is_deprecated(&self) -> bool; + fn load_settings_for_data(&self, data: &BinaryView) -> Result<Ref<Settings>> { let settings_handle = unsafe { BNGetBinaryViewDefaultLoadSettingsForData(self.as_ref().0, data.handle) }; @@ -233,6 +246,10 @@ impl BinaryViewTypeBase for BinaryViewType { unsafe { BNIsBinaryViewTypeValidForData(self.0, data.handle) } } + fn is_deprecated(&self) -> bool { + unsafe { BNIsBinaryViewTypeDeprecated(self.0) } + } + fn load_settings_for_data(&self, data: &BinaryView) -> Result<Ref<Settings>> { let settings_handle = unsafe { BNGetBinaryViewDefaultLoadSettingsForData(self.as_ref().0, data.handle) }; |
