summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss123next@list.ru>2011-03-17 21:08:25 +0200
committerGluzskiy Alexandr <sss123next@list.ru>2011-03-17 21:08:25 +0200
commit4c917f2e2a43ea50cd287dd322dda9d08b213b7d (patch)
treec990c65226c78a2ee6595c05a3b2be36755d5b8f /core
parentee695f119bbc7b3f1557ab01b7953de2ca03e00b (diff)
modified: api/ec_pluginapi.h
modified: api/ec_services.h modified: core/events.cpp modified: core/events.h modified: core/globals.h modified: core/main.cpp modified: core/modules.cpp modified: core/modules.h modified: plugins/example/main.cpp
Diffstat (limited to 'core')
-rw-r--r--core/events.cpp4
-rw-r--r--core/events.h2
-rw-r--r--core/globals.h2
-rw-r--r--core/main.cpp1
-rw-r--r--core/modules.cpp8
-rw-r--r--core/modules.h2
6 files changed, 15 insertions, 4 deletions
diff --git a/core/events.cpp b/core/events.cpp
index d858696..b4a2396 100644
--- a/core/events.cpp
+++ b/core/events.cpp
@@ -55,7 +55,7 @@ bool RegisterEventHandler(int type, EVENT_HANDLER func)
}
return true;
}
-void* RegisterEventType(int type)
+int RegisterEventType(int type)
{
if(!event_handlers.empty())
{
@@ -64,7 +64,7 @@ void* RegisterEventType(int type)
for(std::list<evt_handler*>::iterator i = event_handlers.begin(); i != end; ++i)
{
if((*i)->getType() == type)
- return (void*)-1;
+ return -1;
}
}
event_handlers.push_back(new evt_handler(type));
diff --git a/core/events.h b/core/events.h
index 909efa7..1d968df 100644
--- a/core/events.h
+++ b/core/events.h
@@ -17,7 +17,7 @@
#ifndef EVENTS_H_INCLUDED
#define EVENTS_H_INCLUDED
bool RegisterEventHandler(int, EVENT_HANDLER);
-void* RegisterEventType(int);
+int RegisterEventType(int);
class evt_handler{
public:
diff --git a/core/globals.h b/core/globals.h
index e9c94a1..a82e512 100644
--- a/core/globals.h
+++ b/core/globals.h
@@ -20,5 +20,5 @@
#define GLOBALS_H
extern ACE_Log_Msg logger;
-
+extern int current_plugin_id;
#endif \ No newline at end of file
diff --git a/core/main.cpp b/core/main.cpp
index 9f3e25c..03b314b 100644
--- a/core/main.cpp
+++ b/core/main.cpp
@@ -24,6 +24,7 @@ boost::mutex service_list_mutex;
std::list<evt_handler*> event_handlers;
boost::mutex event_handlers_mutex;
ACE_Log_Msg logger;
+int current_plugin_id = 13;
bool halt_requested = false;
diff --git a/core/modules.cpp b/core/modules.cpp
index e5e9bc7..6eaf038 100644
--- a/core/modules.cpp
+++ b/core/modules.cpp
@@ -123,6 +123,9 @@ plugin::plugin(ACE_DLL *lib, PLUGININFO *info, exported_functions_s *funcs)
exported_funcs = funcs;
else
exported_funcs = NULL;
+ pluginid = current_plugin_id;
+ plugininfo->pluginid = pluginid;
+ ++current_plugin_id;
}
plugin::~plugin()
@@ -142,3 +145,8 @@ const plugin::exported_functions_s* plugin::get_exported_functions()
{
return exported_funcs;
}
+
+const int plugin::get_plugin_id()
+{
+ return pluginid;
+}
diff --git a/core/modules.h b/core/modules.h
index 6cdd0f6..ca61aee 100644
--- a/core/modules.h
+++ b/core/modules.h
@@ -45,12 +45,14 @@ public:
// void set_plugin();
const PLUGININFO *get_plugininfo();
const exported_functions_s *get_exported_functions();
+ const int get_plugin_id();
plugin(ACE_DLL *lib, PLUGININFO *info, exported_functions_s *funcs);
~plugin();
private:
ACE_DLL *plug;
exported_functions_s *exported_funcs;
PLUGININFO *plugininfo;
+ int pluginid;
};
#endif // MODULE_H_INCLUDED