From ce29cd6654265f6f98577bc413c17f6cd3296557 Mon Sep 17 00:00:00 2001 From: Ahmad Kemsan Date: Thu, 8 Feb 2024 13:41:28 +0530 Subject: [PATCH] feat: added deactivation count getter --- lexactivator.go | 37 ++++++++++++++++++++++++++++++++++++- lexactivator/LexActivator.h | 24 ++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/lexactivator.go b/lexactivator.go index 0a2f0f7..2bdd3e4 100644 --- a/lexactivator.go +++ b/lexactivator.go @@ -20,8 +20,8 @@ void newReleaseUpdateCallbackCgoGateway(int status, const char* releaseJson, voi import "C" import ( "encoding/json" + "strings" "unsafe" - "strings" ) type callbackType func(int) @@ -705,6 +705,41 @@ func GetLicenseTotalActivations(totalActivations *uint) int { return int(status) } +/* + FUNCTION: GetLicenseAllowedDeactivations() + + PURPOSE: Gets the allowed deactivations of the license. + + PARAMETERS: + * allowedDeactivations - pointer to the integer that receives the value + + RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED +*/ +func GetLicenseAllowedDeactivations(allowedDeactivations *uint) int { + var cAllowedDeactivations C.uint + status := C.GetLicenseAllowedDeactivations(&cAllowedDeactivations) + *allowedDeactivations = uint(cAllowedDeactivations) + return int(status) +} + +/* + FUNCTION: GetLicenseTotalDeactivations() + + PURPOSE: Gets the total deactivations of the license. + + PARAMETERS: + * totalDeactivations - pointer to the integer that receives the value + + RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED +*/ +func GetLicenseTotalDeactivations(totalDeactivations *uint) int { + var cTotalDeactivations C.uint + status := C.GetLicenseTotalDeactivations(&cTotalDeactivations) + *totalDeactivations = uint(cTotalDeactivations) + return int(status) +} + + /* FUNCTION: GetLicenseCreationDate() diff --git a/lexactivator/LexActivator.h b/lexactivator/LexActivator.h index b2b7719..88bed8b 100644 --- a/lexactivator/LexActivator.h +++ b/lexactivator/LexActivator.h @@ -547,6 +547,30 @@ LEXACTIVATOR_API int LA_CC GetLicenseAllowedActivations(uint32_t *allowedActivat */ LEXACTIVATOR_API int LA_CC GetLicenseTotalActivations(uint32_t *totalActivations); +/* + FUNCTION: GetLicenseAllowedDeactivations() + + PURPOSE: Gets the allowed deactivations of the license. + + PARAMETERS: + * allowedDeactivations - pointer to the integer that receives the value + + RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED +*/ +LEXACTIVATOR_API int LA_CC GetLicenseAllowedDeactivations(uint32_t *allowedDeactivations); + +/* + FUNCTION: GetLicenseTotalDeactivations() + + PURPOSE: Gets the total deactivations of the license. + + PARAMETERS: + * totalDeactivations - pointer to the integer that receives the value + + RETURN CODES: LA_OK, LA_FAIL, LA_E_PRODUCT_ID, LA_E_TIME, LA_E_TIME_MODIFIED +*/ +LEXACTIVATOR_API int LA_CC GetLicenseTotalDeactivations(uint32_t *totalDeactivations); + /* FUNCTION: GetLicenseCreationDate()