24 #ifndef _CORE_PLUGIN_H_
25 #define _CORE_PLUGIN_H_
27 #include <core/threading/thread_list.h>
40 const char *
name()
const;
76 typedef void (*PluginDestroyFunc)(
Plugin *plugin);
81 typedef const char *(*PluginDescriptionFunc)();
87 typedef const char *(*PluginDependenciesFunc)();
92 #define PLUGIN_FACTORY(plugin_class) \
93 extern "C" fawkes::Plugin *plugin_factory(fawkes::Configuration *config) \
95 return new plugin_class(config); \
102 #define PLUGIN_DESTROY(plugin_class) \
103 extern "C" void plugin_destroy(plugin_class *plugin) \
112 #define PLUGIN_DESCRIPTION(info_string) \
113 extern "C" const char _plugin_description[] __attribute((__section__(".fawkes_plugin"))) \
114 __attribute((__used__)) = info_string; \
116 extern "C" const char *plugin_description() \
118 return _plugin_description; \
125 #define PLUGIN_DEPENDS(plugin_list) \
126 extern "C" const char _plugin_dependencies[] __attribute((__section__(".fawkes_plugin"))) \
127 __attribute((__used__)) = info_string; \
129 extern "C" const char *plugin_depends() \
131 return _plugin_dependencies; \
137 #define EXPORT_PLUGIN(plugin_class) \
138 PLUGIN_FACTORY(plugin_class) \
140 PLUGIN_DESTROY(plugin_class)
Interface for configuration handling.
virtual bool persistent()
Determines if the plugin can be unloaded.
void set_name(const char *name)
Set plugin name.
Plugin(Configuration *config)
Constructor.
ThreadList thread_list
Thread list member.
ThreadList & threads()
Get a list of threads.
virtual ~Plugin()
Virtual destructor.
Configuration * config
Fawkes configuration.
const char * name() const
Get the name of the plugin.
Fawkes library namespace.