From 1d41574c6e8e7bbf3705645feb429df6281ccb83 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Tue, 12 Feb 2013 20:36:08 +0200 Subject: working on service support --- server/api_service.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'server/api_service.h') diff --git a/server/api_service.h b/server/api_service.h index 9d6a656..4f5a183 100644 --- a/server/api_service.h +++ b/server/api_service.h @@ -17,23 +17,29 @@ #ifndef API_SERVICES_H #define API_SERVICES_H +namespace service + +{ + enum service_return {RET_NONE = 2, RET_VOID_PTR = 4, RET_CHAR_PTR = 8, RET_STD_STRING = 16, RET_INT, RET_FLOAT = 32}; enum service_accept {ACC_NONE = 2, ACC_VOID_PTR = 4, ACC_CHAR_PTR = 8, ACC_STD_STRING = 16, ACC_INT, ACC_FLOAT = 32}; -struct command -{ - std::string command, description; -}; //service may have predefined command set struct service_info { + struct command + { + std::string command, description; + bool operator==(const std::string &command); + }; std::string name, description; service_return ret; service_accept acc; void * (*exec)(void *); std::list predefined; + bool operator==(const std::string &name); }; #define services(x) extern "C" void __attribute__((__visibility__("default"))) x(std::list &s) @@ -42,7 +48,7 @@ struct service_info #define init_func(x) extern "C" void __attribute__((__visibility__("default"))) x() //service may export "init" function which will be called on service loading - +}; #endif -- cgit v1.2.3