Skip to content

Commit

Permalink
feat: unlimited implementation of meter attribute getter
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmad-kemsan committed Jul 30, 2024
1 parent 2781d3c commit 1092b41
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions lexfloatclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,21 +224,21 @@ func GetHostLicenseMetadata(key string, value *string) int {
PARAMETERS:
* name - name of the meter attribute
* allowedUses - pointer to the integer that receives the value
* allowedUses - pointer to the integer that receives the value. A value of -1 indicates unlimited allowed uses.
* totalUses - pointer to the integer that receives the value
* grossUses - pointer to the integer that receives the value
RETURN CODES: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_METER_ATTRIBUTE_NOT_FOUND
*/
func GetHostLicenseMeterAttribute(name string, allowedUses *uint, totalUses *uint, grossUses *uint) int {
func GetHostLicenseMeterAttribute(name string, allowedUses *int64, totalUses *uint64, grossUses *uint64) int {
cName := goToCString(name)
var cAllowedUses C.uint
var cTotalUses C.uint
var cGrossUses C.uint
var cAllowedUses C.int64_t
var cTotalUses C.uint64_t
var cGrossUses C.uint64_t
status := C.GetHostLicenseMeterAttribute(cName, &cAllowedUses, &cTotalUses, &cGrossUses)
*allowedUses = uint(cAllowedUses)
*totalUses = uint(cTotalUses)
*grossUses = uint(cGrossUses)
*allowedUses = int64(cAllowedUses)
*totalUses = uint64(cTotalUses)
*grossUses = uint64(cGrossUses)
freeCString(cName)
return int(status)
}
Expand Down
4 changes: 2 additions & 2 deletions lexfloatclient/LexFloatClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,13 @@ LEXFLOATCLIENT_API int LF_CC GetHostLicenseMetadata(CSTRTYPE key, STRTYPE value,
PARAMETERS:
* name - name of the meter attribute
* allowedUses - pointer to the integer that receives the value
* allowedUses - pointer to the integer that receives the value. A value of -1 indicates unlimited allowed uses.
* totalUses - pointer to the integer that receives the value
* grossUses - pointer to the integer that receives the value
RETURN CODES: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_METER_ATTRIBUTE_NOT_FOUND
*/
LEXFLOATCLIENT_API int LF_CC GetHostLicenseMeterAttribute(CSTRTYPE name, uint32_t *allowedUses, uint32_t *totalUses, uint32_t *grossUses);
LEXFLOATCLIENT_API int LF_CC GetHostLicenseMeterAttribute(CSTRTYPE name, int64_t *allowedUses, uint64_t *totalUses, uint64_t *grossUses);

/*
FUNCTION: GetHostLicenseExpiryDate()
Expand Down

0 comments on commit 1092b41

Please sign in to comment.