summaryrefslogtreecommitdiff
path: root/core/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/main.cpp')
-rw-r--r--core/main.cpp31
1 files changed, 30 insertions, 1 deletions
diff --git a/core/main.cpp b/core/main.cpp
index bcb0e74..44add56 100644
--- a/core/main.cpp
+++ b/core/main.cpp
@@ -104,12 +104,41 @@ plugin::~plugin()
FreeLibrary(hModule);
free(szPluginName);
}
+service::service(const char *name, const SERVICE &service)
+{
+ szName = new char [strlen(name)+1];
+ strcpy(szName, name);
+ *pService = service;
+}
+const char *service::getName()
+{
+ return szName;
+}
+const SERVICE *service::getService()
+{
+ return pService;
+}
INT_PTR CallService(const char *name, WPARAM w, LPARAM l)
{
+ for(list<service*>::iterator p = services.begin(); p != services.end(); p++)
+ {
+ if(!strcmp((*p)->getName(), name))
+ {
+ SERVICE s = *(*p)->getService();
+ return s(w, l);
+ }
+ }
+ return 0;
}
-HANDLE CreateServiceFunction(const char *name, SERVICE pService)
+HANDLE CreateServiceFunction(const char *name, const SERVICE pService)
{
+ services.push_back(new service(name, pService));
}
int ServiceExists(const char *name)
{
+ for(list<service*>::iterator p = services.begin(); p != services.end(); p++)
+ if(!strcmp((*p)->getName(), name))
+ return 1;
+ return 0;
}
+