The information on this page refers to LM-X v4.9.1 and newer, which added the szHalPath field to the LMX_LICENSE_INFO structure. If you are using an older version of LM-X, refer to documentation for earlier versions. |
The LMX_GetLicenseInfo function retrieves license information from one or more license servers or from a local path.
...
All information in the output data is organized as linked lists. The structures are carefully described in lmx.h, as follows:
Name | Description |
LMX_LICENSE_INFO | Holds information about a particular license server or local license file, including information for borrow, grace and trial licenses. |
LMX_FEATURE_INFO | Holds information about a particular feature present on a license server or local license, including information for borrow, grace and trial licenses. |
LMX_CLIENT_USER | Holds information about a particular user logged onto a license server. (Applies only to network licenses.) |
LMX_CLIENT_LEASE | Holds information about a particular license lease done by a specific user. (Applies only to network licenses.) |
LMX_CLIENT_QUEUE | Holds information about a particular license queue request done by a specific user. (Applies only to network licenses.) |
To enable cycling through objects in a list, each structure contains a pointer named pNext, which identifies the next record. The last record is identified by pNext being NULL.
LMX_LICENSE_INFO contains the following fields.
LMX_LICENSE_INFO field | Description |
char szPath[LMX_MAX_LONG_STRING_LENGTH+1] | The path and name of the license file (for local licenses) or license server host name (for network licenses). |
LMX_STATUS LmxStat | The status of the license path. If this is not LMX_SUCCESS, then all remaining information in LMX_LICENSE_INFO or related structures may be invalid. |
char szHalPath[3][LMX_MAX_LONG_STRING_LENGTH+1] | Paths for the 3 HAL servers, in the form of "port@host", where the first element is the master, the second is the first slave, and the third is the second slave. |
int nPort | The port number of the license server. |
char szVendorName[LMX_MAX_SHORT_STRING_LENGTH+1] | The vendor name. |
char szVersion[LMX_MAX_SHORT_STRING_LENGTH+1] | The version of the license server. |
int nServerUptimeSeconds | The uptime of the license server. |
LMX_FEATURE_INFO *pFeature | Pointers to the features that are present on the license server. |
LMX_CLIENT_USER *pUser | Pointers to the users that are present on the license server. |
Example
You can use the following code to extract information about available licenses, their paths, ports, types and list all their features.
Code Block | ||
---|---|---|
| ||
#include <lmx.h> #include <stdio.h> LMX_HANDLE h; int main() { LMX_STATUS s; LMX_LICENSE_INFO *pLicenseInfo; LMX_FEATURE_INFO *pFI; exit_on_error(LMX_Init(&h)); if ((s = LMX_GetLicenseInfo(h, &pLicenseInfo)) != LMX_SUCCESS) exit_on_error(s); for (; pLicenseInfo != NULL; pLicenseInfo = pLicenseInfo->pNext) { printf("LicencePath : %s\n", pLicenseInfo->szPath); printf("Port : %d\n", pLicenseInfo->nPort); printf("Type : "); if (pLicenseInfo->eLicenseType == LMX_TYPE_LOCAL) printf("LocaleLocal\n"); else if (pLicenseInfo->eLicenseType == LMX_TYPE_NETWORK) printf("Network\n"); printf("Features:\n\n"); for (pFI = pLicenseInfo->pFeature; pFI != NULL; pFI = pFI->pNext) { printf("FeatureName : %s\n", pFI->szFeatureName); printf("VendorName : %s\n", pFI->szVendorName); } } return 0; } |
...
This function is currently available for use only with C, C++ (excluding Java) , and .NET.