OESzmapIsLicensedΒΆ

bool OESzmapIsLicensed(const char *feature=0, unsigned int *expdate=0)

Determine whether a valid license file is present. This function may be called without a legitimate run-time license to determine whether it is safe to call any of OESzmap’s functionality.

The features argument can be used to check for a valid license to OESzmap along with that feature. For example, to verify that OESzmap can be used from Python:

if not oeszmap.OESzmapIsLicensed("python"):
    print("OESzmap is not licensed for the python feature")

The second argument can be used to get the expiration date of the license. This is an array of size three with the date returned as {day, month, year}. Even if the function returns false due to an expired license, the expdate will show that expiration date. A value of a zeroes implies that no license or date was found.

expdate = oechem.OEUIntArray(3)
if oeszmap.OESzmapIsLicensed(0, expdate):
    print("License expires: day: %d  month: %d year: %d" % \
                  (expdate[0], expdate[1], expdate[2]))