Public api

The public api of the library can be found in include/licensecc/licensecc.h that is the only file you should include when you want to use the library.

Verify a license

LCC_EVENT_TYPE acquire_license(const CallerInformations *callerInformation, const LicenseLocation *licenseLocation, LicenseInfo *license_out)

This method is used to request the use of one license for a product. In case of local license it’s used to check if the product is licensed.

Return

LCC_EVENT_TYPE::LICENSE_OK(0) if successful. Other values if there are errors.

Parameters
  • callerInformation[in]: optional, can be NULL. contains informations on the software that is requesting the license verification. Let the software specify its version or request verification for features that need to be enabled separately.

  • licenseLocation[in]: optional, can be NULL. licenseLocation, either the name of the file or the name of the environment variable should be !=’\0’

  • license_out[out]: optional, can be NULL, if set it will return extra informations about the license.

struct CallerInformations

Informations about the software requesting the license verification (eg, software version, feature to verify).

Public Members

char version[LCC_API_VERSION_LENGTH + 1]

software version in format xxxx[.xxxx.xxxx] NOT IMPLEMENTED pass ‘\0’

char feature_name[LCC_API_FEATURE_NAME_SIZE + 1]

Name of the feature you want to verify. If empty (‘\0’) the ‘default’ feature will be verified. (every project has a default feature that is equal to the project name). Every feature has a separate section in the license file:

unsigned int magic

this number passed in by the application must correspond to the magic number used when compiling the library. See cmake parameter -DLCC_PROJECT_MAGIC_NUM and licensecc_properties.h macro VERIFY_MAGIC

struct LicenseLocation

This structure contains informations on the raw license data. Software authors can specify the location of the license file or its full content.

Can be NULL, in this case OpenLicenseManager will try to figure out the license file location on its own.

struct LicenseInfo

Public Members

AuditEvent status[LCC_API_AUDIT_EVENT_NUM]

Detailed reason of success/failure. Reasons for a failure can be multiple (for instance, license expired and signature not verified). Only the last AUDIT_EVENT_NUM are reported.

char expiry_date[LCC_API_EXPIRY_DATE_SIZE + 1]

Eventual expiration date of the software, can be ‘\0’ if the software don’t expire