From 8bbef2865455754425a84b86680a89bff8aa7691 Mon Sep 17 00:00:00 2001 From: gcontini <1121667+gcontini@users.noreply.github.com> Date: 周六, 19 10月 2019 08:50:45 +0800 Subject: [PATCH] issue #64 , issue #56 (part) --- src/library/api/license++.h | 46 +++++++++++++++++++++------------------------- 1 files changed, 21 insertions(+), 25 deletions(-) diff --git a/src/library/api/license++.h b/src/library/api/license++.h index 713692a..ef1fbb6 100644 --- a/src/library/api/license++.h +++ b/src/library/api/license++.h @@ -3,20 +3,9 @@ /* * This include file is the public api di License++ - * You should include this file if your software don't plan to use - * the part of the library dealing with features. - * Otherwise licensepp-features.h should be included. - */ +*/ #ifdef __cplusplus extern "C" { -#endif - -#ifdef __unix__ -#define DllExport -#define MAX_PATH 1024 -#else -#include <windows.h> -#define DllExport __declspec( dllexport ) #endif #include "datatypes.h" @@ -25,7 +14,7 @@ * Method used to convert the LicenseInfo into a human readable * representation. */ -DllExport void print_error(char out_buffer[256], LicenseInfo* licenseInfo); +void print_error(char out_buffer[256], LicenseInfo* licenseInfo); /** * This method calculate the pc identifier. The string has to be shown @@ -33,30 +22,37 @@ */ void identify_pc(IDENTIFICATION_STRATEGY pc_id_method, char chbuffer[PC_IDENTIFIER_SIZE + 1]); -/* - * The optional parameter License contains the information the program that uses the library - * should display: + + +/** + * 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. + * [In case of network licenses this will decrease the count of the available + * licenses] * - * @return true if successful. False if there are errors. - * @param licenseLocation[in] licenseLocation, either the name of the file + * @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. + * @param license[out] optional, can be NULL, if set it will return extra informations about the license. */ -DllExport EVENT_TYPE acquire_license(const char * productName, - LicenseLocation licenseLocation, LicenseInfo* license); +EVENT_TYPE acquire_license(const char * productName, + const LicenseLocation* licenseLocation, LicenseInfo* license); /** * Do nothing for now, useful for network licenses. * Should be called from time to time to confirm we're still using the - * slicense. + * license. */ -DllExport enum EVENT_TYPE confirm_license(char * productName, - LicenseLocation licenseLocation); +EVENT_TYPE confirm_license(char * featureName, + LicenseLocation* licenseLocation); /** * Do nothing for now, useful for network licenses. */ -DllExport enum EVENT_TYPE release_license(char * productName, +EVENT_TYPE release_license(char * featureName, LicenseLocation licenseLocation); #ifdef __cplusplus -- Gitblit v1.9.1