mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Version info
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#ifndef __ICSNEO_API_VERSION_H_
|
||||
#define __ICSNEO_API_VERSION_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct {
|
||||
uint16_t major;
|
||||
uint16_t minor;
|
||||
uint16_t patch;
|
||||
const char* metadata;
|
||||
const char* buildBranch;
|
||||
const char* buildTag;
|
||||
char reserved[32];
|
||||
} neoversion_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace icsneo {
|
||||
|
||||
neoversion_t GetVersion(void);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "icsneo/communication/message/neomessage.h" // For neomessage_t and friends
|
||||
#include "icsneo/platform/dynamiclib.h" // Dynamic library loading and exporting
|
||||
#include "icsneo/communication/network.h" // Network type and netID defines
|
||||
#include "icsneo/api/version.h" // For version info
|
||||
|
||||
#ifndef ICSNEOC_DYNAMICLOAD
|
||||
|
||||
@@ -63,6 +64,8 @@ extern bool DLLExport icsneo_transmitMessages(const neodevice_t* device, const n
|
||||
|
||||
extern bool DLLExport icsneo_describeDevice(const neodevice_t* device, char* str, size_t* maxLength);
|
||||
|
||||
extern neoversion_t DLLExport icsneo_getVersion(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
@@ -144,6 +147,9 @@ fn_icsneo_transmitMessages icsneo_transmitMessages;
|
||||
typedef bool(*fn_icsneo_describeDevice)(const neodevice_t* device, char* str, size_t* maxLength);
|
||||
fn_icsneo_describeDevice icsneo_describeDevice;
|
||||
|
||||
typedef neoversion_t(*fn_icsneo_getVersion)(void);
|
||||
fn_icsneo_getVersion icsneo_getVersion;
|
||||
|
||||
#define ICSNEO_IMPORT(func) func = (fn_##func)icsneo_dynamicLibraryGetFunction(icsneo_libraryHandle, #func)
|
||||
#define ICSNEO_IMPORTASSERT(func) if((ICSNEO_IMPORT(func)) == NULL) return 3
|
||||
void* icsneo_libraryHandle = NULL;
|
||||
@@ -183,6 +189,7 @@ int icsneo_init() {
|
||||
ICSNEO_IMPORTASSERT(icsneo_transmit);
|
||||
ICSNEO_IMPORTASSERT(icsneo_transmitMessages);
|
||||
ICSNEO_IMPORTASSERT(icsneo_describeDevice);
|
||||
ICSNEO_IMPORTASSERT(icsneo_getVersion);
|
||||
|
||||
icsneo_initialized = true;
|
||||
return 0;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <memory>
|
||||
|
||||
#include "icsneo/device/device.h"
|
||||
#include "icsneo/api/version.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user