You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

C API example

The following code snippet gives an example of how use the LAC end-user C API calls to create a license request and retrieve the generated license automatically.

#include "lac.h"
...

LAC_STATUS LacStat;

char szResponse[LAC_MAX_RESPONSE_LENGTH] = {0};

const char *szActivationKey = "9EFJK-TVJM0-MCDET-EZKXJ";
const char *szHostid = "HOSTNAME=my_hostname";
const char *szUrl = "http://license.x-formation.com/soap/type/enduser/version/1"

if ((LacStat = LAC_CreateLicenseRequest(szActivationKey, szHostid, szUrl, NULL, 0, NULL, NULL, szResponse)) != LAC_SUCCESS)

Unknown macro: { printf("Error code}

 
do

Unknown macro: {LacStat = LAC_GetLicense(szActivationKey, szHostid, szUrl, NULL, 0, NULL, NULL, szResponse); if (LacStat != LAC_PLEASE_WAIT)printf("Error code}

while (LacStat != LAC_SUCCESS)

printf("License:\n\n%s\n", szResponse);

return 0;

  • No labels