summaryrefslogtreecommitdiff
path: root/src/common/plugins.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/plugins.h')
-rw-r--r--src/common/plugins.h33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/common/plugins.h b/src/common/plugins.h
index 34fd18a64..9cb4b94b4 100644
--- a/src/common/plugins.h
+++ b/src/common/plugins.h
@@ -4,17 +4,20 @@
#ifndef _PLUGINS_H_
#define _PLUGINS_H_
+#include "../common/plugin.h"
+
////// Dynamic Link Library functions ///////////////
-#ifdef _WIN32
+#ifdef WIN32
#include <windows.h>
#define DLL_OPEN(x) LoadLibrary(x)
#define DLL_SYM(x,y,z) (FARPROC)(x) = GetProcAddress(y,z)
#define DLL_CLOSE(x) FreeLibrary(x)
+ char *DLL_ERROR(void);
+
#define DLL_EXT ".dll"
#define DLL HINSTANCE
- char *DLL_ERROR(void);
#else
@@ -31,6 +34,8 @@
#endif
#define DLL void *
+ #include <string.h> // size_t
+
#endif
////// Plugin Definitions ///////////////////
@@ -38,24 +43,24 @@
typedef struct _Plugin {
DLL dll;
char state;
- char *filename;
- struct _Plugin_Info *info;
- struct _Plugin *next;
+ char* filename;
+ struct _Plugin_Info* info;
+ struct _Plugin* next;
} Plugin;
/////////////////////////////////////////////
-int register_plugin_func (char *);
-int register_plugin_event (void (*)(void), char *);
-int plugin_event_trigger (char *);
+int register_plugin_func(char* name);
+int register_plugin_event(Plugin_Event_Func* func, char* name);
+int plugin_event_trigger(char* name);
-int export_symbol (void *, int);
+int export_symbol(void* var, size_t offset);
#define EXPORT_SYMBOL(s) export_symbol((s), -1);
-Plugin *plugin_open (const char *);
-void plugin_load (const char *);
-void plugin_unload (Plugin *);
-void plugins_init (void);
-void plugins_final (void);
+Plugin* plugin_open(const char* filename);
+void plugin_load(const char* filename);
+void plugin_unload(Plugin* plugin);
+void plugins_init(void);
+void plugins_final(void);
#endif // _PLUGINS_H_