From 3214977e7a902b15d86c43a917c1438fdee56f95 Mon Sep 17 00:00:00 2001 From: Gabriele Contini <contini.mailing@gmail.com> Date: 周六, 01 2月 2020 17:52:42 +0800 Subject: [PATCH] minor fix --- include/licensecc/datatypes.h | 37 +++++++++++++++++++++++++------------ 1 files changed, 25 insertions(+), 12 deletions(-) diff --git a/include/licensecc/datatypes.h b/include/licensecc/datatypes.h index b66543f..c058630 100644 --- a/include/licensecc/datatypes.h +++ b/include/licensecc/datatypes.h @@ -1,7 +1,8 @@ +/** \addtogroup api + * @{ + */ #ifndef DATATYPES_H_ #define DATATYPES_H_ - -#include <licensecc_properties.h> #ifdef __cplusplus extern "C" { @@ -24,7 +25,16 @@ #define DllExport __declspec(dllexport) #endif +// define api structure sizes +#define PC_IDENTIFIER_SIZE 19 +#define PROPRIETARY_DATA_SIZE 16 +#define AUDIT_EVENT_NUM 5 +#define AUDIT_EVENT_PARAM2 255 +#define VERSION_SIZE 15 +#define PROJECT_NAME_SIZE 15 +#define EXPIRY_DATE_SIZE 10 +#define ERROR_BUFFER_SIZE 256 typedef enum { LICENSE_OK = 0, // OK @@ -58,7 +68,7 @@ * License file name or location where the license is stored. */ char license_reference[MAX_PATH]; - char param2[256]; + char param2[AUDIT_EVENT_PARAM2 + 1]; } AuditEvent; /** @@ -84,8 +94,8 @@ * Informations on the software requiring the license */ typedef struct { - char version[16]; // software version in format xxxx.xxxx.xxxx - char project_name[16]; // name of the project (must correspond to the name in the license) + char version[VERSION_SIZE + 1]; // software version in format xxxx.xxxx.xxxx + char project_name[PROJECT_NAME_SIZE + 1]; // name of the project (must correspond to the name in the license) uint32_t magic; // reserved } CallerInformations; typedef struct { @@ -99,7 +109,7 @@ * Eventual expiration date of the software, * can be '\0' if the software don't expire * */ - char expiry_date[11]; + char expiry_date[EXPIRY_DATE_SIZE + 1]; unsigned int days_left; bool has_expiry; bool linked_to_pc; @@ -116,12 +126,12 @@ * in most cases. */ typedef enum { - DEFAULT, - ETHERNET, - IP_ADDRESS, - DISK_NUM, - DISK_LABEL, - PLATFORM_SPECIFIC, + STRATEGY_DEFAULT, + STRATEGY_ETHERNET, + STRATEGY_IP_ADDRESS, + STRATEGY_DISK_NUM, + STRATEGY_DISK_LABEL, + STRATEGY_PLATFORM_SPECIFIC, STRATEGY_UNKNOWN } IDENTIFICATION_STRATEGY; @@ -130,3 +140,6 @@ #endif #endif +/** + * @} + */ -- Gitblit v1.9.1