blob: 57d2b0b4ea5b1c01f9957a433db659d4a70694de (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
use crate::{
string::{AsCStr, BnString},
types::QualifiedName,
};
use binaryninjacore_sys::{BNRustSimplifyStrToFQN, BNRustSimplifyStrToStr};
pub fn simplify_str_to_str<S: AsCStr>(input: S) -> BnString {
let name = input.to_cstr();
unsafe { BnString::from_raw(BNRustSimplifyStrToStr(name.as_ref().as_ptr() as *mut _)) }
}
pub fn simplify_str_to_fqn<S: AsCStr>(input: S, simplify: bool) -> QualifiedName {
let name = input.to_cstr();
unsafe {
QualifiedName::from_owned_raw(BNRustSimplifyStrToFQN(
name.as_ref().as_ptr() as *mut _,
simplify,
))
}
}
|