summaryrefslogtreecommitdiff
path: root/core/services.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss123next@list.ru>2011-03-18 00:12:17 +0200
committerGluzskiy Alexandr <sss123next@list.ru>2011-03-18 00:12:17 +0200
commit4bcc86b7413f5ce76a1ceac92aa566a9bf13d685 (patch)
tree323cd03aaea1f5ff69cce4236b66f1130e9452b9 /core/services.cpp
parentf4a5bae0c010e3c20d6420c9de2bb74182b26b6e (diff)
service usage example in plugin example
modified: api/ec_pluginapi.h modified: core/services.cpp modified: core/services.h modified: plugins/example/main.cpp
Diffstat (limited to 'core/services.cpp')
-rw-r--r--core/services.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/services.cpp b/core/services.cpp
index 903ee1a..27574b2 100644
--- a/core/services.cpp
+++ b/core/services.cpp
@@ -21,10 +21,16 @@ extern std::list<service*> services;
extern boost::mutex service_list_mutex;
int ServiceExists(const char *name);
-void CreateServiceFunction(const char* name, SERVICE svc)
+int CreateServiceFunction(const char* name, SERVICE svc)
{
if(!ServiceExists(name))
+ {
+ logger.log(LM_DEBUG, "Succesfuly registered service %s.\n", name);
services.push_back(new service(name, svc));
+ return 0;
+ }
+ logger.log(LM_DEBUG, "Failed to register service %s.\n", name);
+ return 1;
}
void* CallService(const char *name,void* data)