Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/extern_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ extern "C" {
pub fn GetActivationMode(initialMode: strtype!(), initialModeLength: c_uint, currentMode: strtype!(), currentModeLength: c_uint) -> c_int;
pub fn GetActivationMeterAttributeUses(name: cstrtype!(), uses: *mut c_uint) -> c_int;
pub fn GetServerSyncGracePeriodExpiryDate(gracePeriodExpiryDate: *mut c_uint) -> c_int;
pub fn GetLastActivationError(errorCode: *mut c_uint) -> c_int;
pub fn GetTrialActivationMetadata(key: cstrtype!(), value: strtype!(), length: c_uint) -> c_int;
pub fn GetTrialExpiryDate(trialExpiryDate: *mut c_uint) -> c_int;
pub fn GetTrialId(trialId: strtype!(), length: c_uint) -> c_int;
Expand Down
17 changes: 17 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1688,6 +1688,23 @@ pub fn get_server_sync_grace_period_expiry_date() -> Result<u32, LexActivatorErr
}
}

/// Retrieves the error code that caused the activation data to be cleared.
///
/// # Returns
///
/// Returns `Ok(u32)` with the error code that caused the activation data to be cleared if it is retrieved successfully, If an error occurs, an `Err` containing the `LexActivatorError`is returned.

pub fn get_last_activation_error() -> Result<u32, LexActivatorError> {
let status: i32;
let mut error_code: c_uint = 0;
status = unsafe { GetLastActivationError(&mut error_code) };
if status == 0 {
Ok(error_code)
} else {
return Err(LexActivatorError::from(status));
}
}

/// Retrieves the metadata value associated with the specified key for the trial activation.
///
/// # Arguments
Expand Down
Loading