summaryrefslogtreecommitdiff
path: root/rust/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/src/lib.rs')
-rw-r--r--rust/src/lib.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/rust/src/lib.rs b/rust/src/lib.rs
index 08e31c00..159a7ec5 100644
--- a/rust/src/lib.rs
+++ b/rust/src/lib.rs
@@ -476,12 +476,18 @@ pub fn license_count() -> i32 {
/// If not set the normal license retrieval will occur:
/// 1. Check the BN_LICENSE environment variable
/// 2. Check the Binary Ninja user directory for license.dat
+#[cfg(not(feature = "demo"))]
pub fn set_license<S: BnStrCompatible + Default>(license: Option<S>) {
let license = license.unwrap_or_default().into_bytes_with_nul();
let license_slice = license.as_ref();
unsafe { BNSetLicense(license_slice.as_ptr() as *const c_char) }
}
+#[cfg(feature = "demo")]
+pub fn set_license<S: BnStrCompatible + Default>(_license: Option<S>) {
+ panic!("Cannot set license in demo mode!");
+}
+
pub fn product() -> BnString {
unsafe { BnString::from_raw(BNGetProduct()) }
}