From d663f702c0e4fa562783504a483dce8f362d628e Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Tue, 12 Sep 2017 00:29:28 +0200 Subject: Progression on config parsing. Change-Id: Idd8d8987ccabef381f6d79c1d508930a2d4bae3c Signed-off-by: Romain Forlot --- controller/ctl-config.h | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'controller/ctl-config.h') diff --git a/controller/ctl-config.h b/controller/ctl-config.h index 2e3a16a..3b39f53 100644 --- a/controller/ctl-config.h +++ b/controller/ctl-config.h @@ -21,7 +21,14 @@ #ifndef _CTL_CONFIG_INCLUDE_ #define _CTL_CONFIG_INCLUDE_ +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif + +#ifdef __cplusplus +extern "C" { +#endif + #define AFB_BINDING_VERSION 2 #include #include @@ -72,7 +79,7 @@ typedef struct ConfigSectionS { const char *label; const char *info; int (*loadCB)(struct ConfigSectionS *section, json_object *sectionJ); - void *handle; + void *handle; } CtlSectionT; typedef struct { @@ -84,30 +91,28 @@ typedef struct { CtlSectionT *sections; } CtlConfigT; - #ifdef CONTROL_SUPPORT_LUA #include "ctl-lua.h" -#else - typedef void* Lua2cWrapperT; #endif - // ctl-action.c -PUBLIC CtlActionT *ActionLoad(json_object *actionsJ); -PUBLIC int ActionExecOne(CtlActionT* action, json_object *queryJ); -PUBLIC int ActionLoadOne(CtlActionT *action, json_object *actionJ); +CtlActionT *ActionLoad(json_object *actionsJ); +int ActionExecOne(CtlActionT* action, json_object *queryJ); +int ActionLoadOne(CtlActionT *action, json_object *actionJ); // ctl-config.c -PUBLIC CtlConfigT *CtlConfigLoad(const char* filepath, CtlSectionT *sections); -PUBLIC int CtlConfigExec(CtlConfigT *ctlConfig); +CtlConfigT *CtlConfigLoad(const char* filepath, CtlSectionT *sections); +int CtlConfigExec(CtlConfigT *ctlConfig); // ctl-onload.c -PUBLIC int OnloadConfig(CtlSectionT *section, json_object *actionsJ); - +int OnloadConfig(CtlSectionT *section, json_object *actionsJ); // ctl-plugin.c -PUBLIC int PluginConfig(CtlSectionT *section, json_object *pluginsJ); -PUBLIC int PluginGetCB (CtlActionT *action , json_object *callbackJ); +int PluginConfig(CtlSectionT *section, json_object *pluginsJ); +int PluginGetCB (CtlActionT *action , json_object *callbackJ); +#ifdef __cplusplus +} +#endif -#endif /* _CTL_CONFIG_INCLUDE_ */ \ No newline at end of file +#endif /* _CTL_CONFIG_INCLUDE_ */ -- cgit 1.2.3-korg