Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: unlimited implementation of meter attribute getter #15

Merged
merged 1 commit into from
Jul 30, 2024
Merged
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
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