From 99572b757ccfe50582bfc4ae2545eb43c39019c0 Mon Sep 17 00:00:00 2001 From: Ahmad Kemsan Date: Thu, 1 May 2025 11:47:15 +0530 Subject: [PATCH 1/2] chore: updated header files --- examples/LexFloatClient.h | 82 +++++++++++++++++++++++++++++----- examples/LexFloatClientTypes.h | 39 ++++++++++++++++ examples/LexFloatStatusCodes.h | 14 ++++++ 3 files changed, 125 insertions(+), 10 deletions(-) create mode 100644 examples/LexFloatClientTypes.h diff --git a/examples/LexFloatClient.h b/examples/LexFloatClient.h index 51d1c5a..3494e02 100644 --- a/examples/LexFloatClient.h +++ b/examples/LexFloatClient.h @@ -4,11 +4,7 @@ #include #include #include "LexFloatStatusCodes.h" - -typedef struct -{ - int maxOfflineLeaseDuration; -} HostConfig; +#include "LexFloatClientTypes.h" #ifdef _WIN32 /* @@ -171,6 +167,8 @@ LEXFLOATCLIENT_API int LF_CC GetFloatingClientLibraryVersion(STRTYPE libraryVers PURPOSE: Gets the product version name. + DEPRECATED: This function is deprecated. Use GetHostLicenseEntitlementSetName() instead. + PARAMETERS: * name - pointer to a buffer that receives the value of the string * length - size of the buffer pointed to by the name parameter @@ -184,6 +182,8 @@ LEXFLOATCLIENT_API int LF_CC GetHostProductVersionName(STRTYPE name, uint32_t le PURPOSE: Gets the product version display name. + DEPRECATED: This function is deprecated. Use GetHostLicenseEntitlementSetDisplayName() instead. + PARAMETERS: * displayName - pointer to a buffer that receives the value of the string * length - size of the buffer pointed to by the displayName parameter @@ -197,6 +197,8 @@ LEXFLOATCLIENT_API int LF_CC GetHostProductVersionDisplayName(STRTYPE displayNam PURPOSE: Gets the product version feature flag. + DEPRECATED: This function is deprecated. Use GetHostFeatureEntitlement() instead. + PARAMETERS: * name - name of the feature flag * enabled - pointer to the integer that receives the value - 0 or 1 @@ -207,6 +209,66 @@ LEXFLOATCLIENT_API int LF_CC GetHostProductVersionDisplayName(STRTYPE displayNam */ LEXFLOATCLIENT_API int LF_CC GetHostProductVersionFeatureFlag(CSTRTYPE name, uint32_t *enabled, STRTYPE data, uint32_t length); +/* + FUNCTION: GetHostLicenseEntitlementSetName() + + PURPOSE: Gets the name of the entitlement set associated with the LexFloatServer license. + + PARAMETERS: + * name - pointer to a buffer that receives the value of the string + * length - size of the buffer pointed to by the name parameter + + RETURN CODES: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_BUFFER_SIZE, LF_E_ENTITLEMENT_SET_NOT_LINKED +*/ +LEXFLOATCLIENT_API int LF_CC GetHostLicenseEntitlementSetName(STRTYPE name, uint32_t length); + +/* + FUNCTION: GetHostLicenseEntitlementSetDisplayName() + + PURPOSE: Gets the display name of the entitlement set associated with the LexFloatServer license. + + PARAMETERS: + * displayName - pointer to a buffer that receives the value of the string + * length - size of the buffer pointed to by the displayName parameter + + RETURN CODES: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_BUFFER_SIZE, LF_E_ENTITLEMENT_SET_NOT_LINKED +*/ +LEXFLOATCLIENT_API int LF_CC GetHostLicenseEntitlementSetDisplayName(STRTYPE displayName, uint32_t length); + +/* + FUNCTION: GetHostFeatureEntitlements() + + PURPOSE: Gets the feature entitlements associated with the LexFloatServer license. + + Feature entitlements can be linked directly to a license (license feature entitlements) + or via entitlement sets. If a feature entitlement is defined in both, the value from + the license feature entitlement takes precedence, overriding the entitlement set value. + + PARAMETERS: + * hostFeatureEntitlements - pointer to the buffer that receives the value of an array of HostFeatureEntitlement structs + * length - size of the hostFeatureEntitlements array + + RETURN CODES: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_BUFFER_SIZE +*/ +LEXFLOATCLIENT_API int LF_CC GetHostFeatureEntitlements(HostFeatureEntitlement* hostFeatureEntitlements, uint32_t length); + +/* + FUNCTION: GetHostFeatureEntitlement() + + PURPOSE: Gets the feature entitlement associated with the LexFloatServer license. + + Feature entitlements can be linked directly to a license (license feature entitlements) + or via entitlement sets. If a feature entitlement is defined in both, the value from + the license feature entitlement takes precedence, overriding the entitlement set value. + + PARAMETERS: + * featureName - name of the feature + * hostFeatureEntitlement - pointer to the buffer that receives the value of the HostFeatureEntitlement struct + + RETURN CODES: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_BUFFER_SIZE, LF_E_FEATURE_ENTITLEMENT_NOT_FOUND +*/ +LEXFLOATCLIENT_API int LF_CC GetHostFeatureEntitlement(CSTRTYPE featureName, HostFeatureEntitlement *hostFeatureEntitlement); + /* FUNCTION: GetHostLicenseMetadata() @@ -258,13 +320,13 @@ LEXFLOATCLIENT_API int LF_CC GetHostLicenseExpiryDate(uint32_t *expiryDate); This function sends a network request to LexFloatServer to get the configuration details. PARAMETERS: - * hostConfigPtr - pointer to a buffer that receives the value of the string - * length - size of the buffer pointed to by the hostConfigPtr parameter + * hostConfig - pointer to the buffer that receives the value of the HostConfig struct + * length - size of the buffer pointed to by the hostConfig parameter RETURN CODES: LF_OK, LF_E_PRODUCT_ID, LF_E_HOST_URL, LF_E_BUFFER_SIZE LF_E_INET, LF_E_CLIENT, LF_E_IP, LF_E_SERVER */ -LEXFLOATCLIENT_API int LF_CC GetHostConfig(HostConfig *hostConfigPtr, uint32_t length); +LEXFLOATCLIENT_API int LF_CC GetHostConfig(HostConfig *hostConfig, uint32_t length); /* FUNCTION: GetFloatingClientMetadata() @@ -300,12 +362,12 @@ LEXFLOATCLIENT_API int LF_CC GetFloatingClientMeterAttributeUses(CSTRTYPE name, PURPOSE: Gets the mode of the floating license (online or offline). PARAMETERS: - * value - pointer to a buffer that receives the value of the string + * mode - pointer to a buffer that receives the value of the string * length - size of the buffer pointed to by the value parameter RETURN CODES: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_BUFFER_SIZE */ -LEXFLOATCLIENT_API int LF_CC GetFloatingLicenseMode(STRTYPE modePtr, uint32_t length); +LEXFLOATCLIENT_API int LF_CC GetFloatingLicenseMode(STRTYPE mode, uint32_t length); /* FUNCTION: GetFloatingClientLeaseExpiryDate() diff --git a/examples/LexFloatClientTypes.h b/examples/LexFloatClientTypes.h new file mode 100644 index 0000000..cd2d26f --- /dev/null +++ b/examples/LexFloatClientTypes.h @@ -0,0 +1,39 @@ +#ifndef LEX_FLOAT_CLIENT_TYPES_H +#define LEX_FLOAT_CLIENT_TYPES_H + +#include +#define BUFFER_SIZE_256 256 + +#ifdef _WIN32 + typedef wchar_t CHARTYPE; +#else + typedef char CHARTYPE; +#endif + +/* + STRUCT: HostConfig + + MEMBERS: + * maxOfflineLeaseDuration - Maximum offline lease duration in seconds. +*/ +typedef struct +{ + int maxOfflineLeaseDuration; +} HostConfig; + +/* + STRUCT: HostFeatureEntitlement + + MEMBERS: + * featureName - Name of the feature. + * featureDisplayName - Display name of the feature. + * value - Value associated with the feature. +*/ +typedef struct +{ + CHARTYPE featureName[BUFFER_SIZE_256]; + CHARTYPE featureDisplayName[BUFFER_SIZE_256]; + CHARTYPE value[BUFFER_SIZE_256]; +} HostFeatureEntitlement; + +#endif // LEX_FLOAT_CLIENT_TYPES_H diff --git a/examples/LexFloatStatusCodes.h b/examples/LexFloatStatusCodes.h index c86ba64..788877f 100644 --- a/examples/LexFloatStatusCodes.h +++ b/examples/LexFloatStatusCodes.h @@ -218,6 +218,20 @@ enum LexFloatStatusCodes */ LF_E_PROXY_NOT_TRUSTED = 67, + /* + CODE: LF_E_ENTITLEMENT_SET_NOT_LINKED + + MESSAGE: No entitlement set is linked to the license. + */ + LF_E_ENTITLEMENT_SET_NOT_LINKED = 68, + + /* + CODE: LF_E_FEATURE_ENTITLEMENT_NOT_FOUND + + MESSAGE: The feature entitlement does not exist. + */ + LF_E_FEATURE_ENTITLEMENT_NOT_FOUND = 69, + /* CODE: LF_E_CLIENT From c40a06441426e7876f3520df1150149b541bb745 Mon Sep 17 00:00:00 2001 From: Ahmad Kemsan Date: Thu, 1 May 2025 11:49:58 +0530 Subject: [PATCH 2/2] docs: consistent doc pattern --- examples/LexFloatClient.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/LexFloatClient.h b/examples/LexFloatClient.h index 3494e02..92db702 100644 --- a/examples/LexFloatClient.h +++ b/examples/LexFloatClient.h @@ -320,7 +320,7 @@ LEXFLOATCLIENT_API int LF_CC GetHostLicenseExpiryDate(uint32_t *expiryDate); This function sends a network request to LexFloatServer to get the configuration details. PARAMETERS: - * hostConfig - pointer to the buffer that receives the value of the HostConfig struct + * hostConfig - pointer to a buffer that receives the value of the HostConfig struct * length - size of the buffer pointed to by the hostConfig parameter RETURN CODES: LF_OK, LF_E_PRODUCT_ID, LF_E_HOST_URL, LF_E_BUFFER_SIZE