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:

Code Block
languagecpp
LMX_STATUS LmxStat;  
LMX_LICENSE_INFO *pLicenseInfo;
LMX_FEATURE_INFO *pFI;
if ((LmxStat = LMX_GetLicenseInfo(LmxHandle, &pLicenseInfo)) != LMX_SUCCESS) 
{ 
  printf("Error: %s\n", LMX_GetErrorMessageSimple(LmxStat)); 
/* Quit early due to error. */ 
} 
for (; pLicenseInfo != NULL; pLicenseInfo = pLicenseInfo->pNext) 
{ 
  for (pFI = pLicenseInfo->pFeature; pFI != NULL; pFI = pFI->pNext)
  { 
  }
}

For a more complete example of using these structures, see the sample files included in the LM-X distribution.

All memory used by these structures is handled and maintained by LM-X. It is assumed to be valid until a new request to LMX_GetLicenseInfo is made.

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;
}

 

For a more complete example of using these structures, see the sample files included in the LM-X distribution.

 

All memory used by these structures is handled and maintained by LM-X. It is assumed to be valid until a new request to LMX_GetLicenseInfo is made.

 

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