Skip to content

Commit

Permalink
Merge pull request #30 from cryptlex/feat/deactivation-count
Browse files Browse the repository at this point in the history
feat: added deactivation count getter
  • Loading branch information
azan-n authored Feb 9, 2024
2 parents b5dc11b + ce29cd6 commit 4af395e
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
37 changes: 36 additions & 1 deletion lexactivator.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ void newReleaseUpdateCallbackCgoGateway(int status, const char* releaseJson, voi
import "C"
import (
"encoding/json"
"strings"
"unsafe"
"strings"
)

type callbackType func(int)
Expand Down Expand Up @@ -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()
Expand Down
24 changes: 24 additions & 0 deletions lexactivator/LexActivator.h
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 4af395e

Please sign in to comment.