Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

Example

For example, you can use the following code to cycle through multiple license paths and list all their features:

...

This function is currently available for use only with C, C++ (excluding Java) and .NET.

You can use the following code to extract information about available licenses, their paths, ports, types and list all their features.

Code Block
languagecpp
#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("Locale\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;
}