plugin: Add macro to define plugin version and constructor
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright (C) 2010-2025 Tobias Brunner
|
||||||
* Copyright (C) 2008 Martin Willi
|
* Copyright (C) 2008 Martin Willi
|
||||||
*
|
*
|
||||||
* Copyright (C) secunet Security Networks AG
|
* Copyright (C) secunet Security Networks AG
|
||||||
@@ -63,7 +64,6 @@ struct plugin_t {
|
|||||||
void (*destroy)(plugin_t *this);
|
void (*destroy)(plugin_t *this);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plugin constructor function definition.
|
* Plugin constructor function definition.
|
||||||
*
|
*
|
||||||
@@ -75,4 +75,11 @@ struct plugin_t {
|
|||||||
*/
|
*/
|
||||||
typedef plugin_t *(*plugin_constructor_t)(void);
|
typedef plugin_t *(*plugin_constructor_t)(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Macro to simplify defining a plugin version and constructor.
|
||||||
|
*/
|
||||||
|
#define PLUGIN_DEFINE(name) \
|
||||||
|
const char *name##_plugin_version = VERSION; \
|
||||||
|
plugin_t *name##_plugin_create()
|
||||||
|
|
||||||
#endif /** PLUGIN_H_ @}*/
|
#endif /** PLUGIN_H_ @}*/
|
||||||
|
|||||||
Reference in New Issue
Block a user