summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/services.cpp8
-rw-r--r--core/services.h2
2 files changed, 8 insertions, 2 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)
diff --git a/core/services.h b/core/services.h
index 15da2f3..9d397b1 100644
--- a/core/services.h
+++ b/core/services.h
@@ -31,7 +31,7 @@ private:
SERVICE pService;
};
-void CreateServiceFunction(const char* name, SERVICE svc);
+int CreateServiceFunction(const char* name, SERVICE svc);
void* CallService(const char *,void*);
int ServiceExists(const char *);