Skip to content
Open
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
82 changes: 72 additions & 10 deletions examples/LexFloatClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
#include <stdint.h>
#include <stddef.h>
#include "LexFloatStatusCodes.h"

typedef struct
{
int maxOfflineLeaseDuration;
} HostConfig;
#include "LexFloatClientTypes.h"

#ifdef _WIN32
/*
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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()

Expand Down Expand Up @@ -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 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
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()
Expand Down Expand Up @@ -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()
Expand Down
39 changes: 39 additions & 0 deletions examples/LexFloatClientTypes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#ifndef LEX_FLOAT_CLIENT_TYPES_H
#define LEX_FLOAT_CLIENT_TYPES_H

#include <stdint.h>
#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
14 changes: 14 additions & 0 deletions examples/LexFloatStatusCodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down