Gabriele Contini
2019-12-14 e2c2e9dc1a9a7f7eafff371cdf29bb731015238c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef LICENSEPP_H_
#define LICENSEPP_H_
 
/*
 * This include file is the public api di License++
*/
#ifdef __cplusplus
extern "C" {
#endif
 
#include "datatypes.h"
 
/*
 * Method used to convert the LicenseInfo into a human readable
 * representation.
 */
void print_error(char out_buffer[256], LicenseInfo* licenseInfo);
 
/**
 * This method calculate the pc identifier. The string has to be shown
 * to the user in order to calculate the license.
 */
bool identify_pc(IDENTIFICATION_STRATEGY pc_id_method, char* identifier_out, size_t bufSize);
 
/**
 * 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 LICENSE_OK(0) if successful. Other values if there are errors.
 * @param productName[in]
 *             a vendor defined string containing the name of the product we want to request.
 * @param licenseLocation[in] otpional, can be NULL.
 *                     licenseLocation, either the name of the file
 *                                 or the name of the environment variable should be !='\0'
 * @param license[out] optional, can be NULL, if set it will return extra informations about the license.
 */
 
EVENT_TYPE acquire_license(const CallerInformations* callerInformation, const LicenseLocation* licenseLocation,
                           LicenseInfo* license_out);
 
/**
 * Do nothing for now, useful for network licenses.
 * Should be called from time to time to confirm we're still using the
 * license.
 */
EVENT_TYPE confirm_license(char * featureName,
        LicenseLocation* licenseLocation);
/**
 * Do nothing for now, useful for network licenses.
 */
EVENT_TYPE release_license(char * featureName,
        LicenseLocation licenseLocation);
 
#ifdef __cplusplus
}
#endif
 
#endif