summaryrefslogtreecommitdiff
path: root/server/api_service.h
diff options
context:
space:
mode:
Diffstat (limited to 'server/api_service.h')
-rw-r--r--server/api_service.h16
1 files changed, 11 insertions, 5 deletions
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<command> predefined;
+ bool operator==(const std::string &name);
};
#define services(x) extern "C" void __attribute__((__visibility__("default"))) x(std::list<service_info> &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