diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2018-12-13 14:42:49 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-12-17 10:04:07 +0100 |
commit | eaf644db7106061481710adb75023122ce4bc150 (patch) | |
tree | 9b06621a42861997b96a6f0921a0b33dc685d654 /ctl-lib/ctl-config.h | |
parent | eaf8c0808d54d987a532254887919822438b7848 (diff) |
Shared library: update to a v3 shared library
- AFB_BINDING_VERSION = 3
- remove preprocessor variables
- mandatory lua
- name of library is ctl-utilities
- does not work with v2 versions
- remove afb-definitions.h
- use of the GNUinstalldirs module to set the destination directories.
Change-Id: Ifdf12885ffad5003ecbbcf3639af63060f0ebc7e
Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-config.h')
-rw-r--r-- | ctl-lib/ctl-config.h | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/ctl-lib/ctl-config.h b/ctl-lib/ctl-config.h index 1facf39..285de7d 100644 --- a/ctl-lib/ctl-config.h +++ b/ctl-lib/ctl-config.h @@ -59,7 +59,7 @@ typedef struct ConfigSectionS { const char *uid; const char *info; const char *prefix; - int (*loadCB)(AFB_ApiT apihandle, struct ConfigSectionS *section, json_object *sectionJ); + int (*loadCB)(afb_api_t apihandle, struct ConfigSectionS *section, json_object *sectionJ); void *handle; CtlActionT *actions; } CtlSectionT; @@ -75,7 +75,7 @@ typedef struct { json_object *configJ; json_object *requireJ; CtlSectionT *sections; - CtlPluginT *ctlPlugins; + CtlPluginT **ctlPlugins; void *external; } CtlConfigT; @@ -91,43 +91,39 @@ typedef enum { } SectionEnumT; // ctl-action.c -extern int AddActionsToSection(AFB_ApiT apiHandle, CtlSectionT *section, json_object *actionsJ, int exportApi); -extern CtlActionT *ActionConfig(AFB_ApiT apiHandle, json_object *actionsJ, int exportApi); -extern void ActionExecUID(AFB_ReqT request, CtlConfigT *ctlConfig, const char *uid, json_object *queryJ); +extern int AddActionsToSection(afb_api_t apiHandle, CtlSectionT *section, json_object *actionsJ, int exportApi); +extern CtlActionT *ActionConfig(afb_api_t apiHandle, json_object *actionsJ, int exportApi); +extern void ActionExecUID(afb_req_t request, CtlConfigT *ctlConfig, const char *uid, json_object *queryJ); extern int ActionExecOne( CtlSourceT *source, CtlActionT* action, json_object *queryJ); -extern int ActionLoadOne(AFB_ApiT apiHandle, CtlActionT *action, json_object *, int exportApi); +extern int ActionLoadOne(afb_api_t apiHandle, CtlActionT *action, json_object *, int exportApi); extern int ActionLabelToIndex(CtlActionT* actions, const char* actionLabel); // ctl-config.c extern int CtlConfigMagicNew(); -extern void* getExternalData(CtlConfigT *ctlConfig); -extern void setExternalData(CtlConfigT *ctlConfig, void *data); extern json_object* CtlConfigScan(const char *dirList, const char *prefix) ; -extern char* ConfigSearch(AFB_ApiT apiHandle, json_object *responseJ); -extern char* CtlConfigSearch(AFB_ApiT apiHandle, const char *dirList, const char *prefix) ; -extern void DispatchRequireApi(AFB_ApiT apiHandle, json_object * requireJ); -extern int CtlConfigExec(AFB_ApiT apiHandle, CtlConfigT *ctlConfig) ; -extern CtlConfigT *CtlLoadMetaDataJson(AFB_ApiT apiHandle,json_object *ctlConfigJ, const char *prefix) ; -extern CtlConfigT *CtlLoadMetaDataUsingPrefix(AFB_ApiT apiHandle,const char* filepath, const char *prefix) ; -extern int CtlLoadSections(AFB_ApiT apiHandle, CtlConfigT *ctlHandle, CtlSectionT *sections); +extern char* ConfigSearch(afb_api_t apiHandle, json_object *responseJ); +extern char* CtlConfigSearch(afb_api_t apiHandle, const char *dirList, const char *prefix) ; +extern void DispatchRequireApi(afb_api_t apiHandle, json_object * requireJ); +extern int CtlConfigExec(afb_api_t apiHandle, CtlConfigT *ctlConfig) ; +extern CtlConfigT *CtlLoadMetaDataJson(afb_api_t apiHandle,json_object *ctlConfigJ, const char *prefix) ; +extern CtlConfigT *CtlLoadMetaDataUsingPrefix(afb_api_t apiHandle,const char* filepath, const char *prefix) ; +extern int CtlLoadSections(afb_api_t apiHandle, CtlConfigT *ctlHandle, CtlSectionT *sections); #define CtlLoadMetaData(api, filepath) CtlLoadMetaDataUsingPrefix(api, filepath, NULL) // ctl-event.c -extern int EventConfig(AFB_ApiT apihandle, CtlSectionT *section, json_object *actionsJ); -extern void CtrlDispatchApiEvent (AFB_ApiT apiHandle, const char *evtLabel, struct json_object *eventJ); +extern int EventConfig(afb_api_t apihandle, CtlSectionT *section, json_object *actionsJ); +extern void CtrlDispatchApiEvent (afb_api_t apiHandle, const char *evtLabel, struct json_object *eventJ); extern void CtrlDispatchV2Event(const char *evtLabel, json_object *eventJ); // ctl-control.c -extern int ControlConfig(AFB_ApiT apiHandle, CtlSectionT *section, json_object *actionsJ); +extern int ControlConfig(afb_api_t apiHandle, CtlSectionT *section, json_object *actionsJ); // ctl-onload.c -extern int OnloadConfig(AFB_ApiT apiHandle, CtlSectionT *section, json_object *actionsJ); +extern int OnloadConfig(afb_api_t apiHandle, CtlSectionT *section, json_object *actionsJ); // ctl-plugin.c -extern int PluginConfig(AFB_ApiT UNUSED_ARG(apiHandle), CtlSectionT *section, json_object *pluginsJ); -extern int PluginGetCB (AFB_ApiT apiHandle, CtlActionT *action , json_object *callbackJ); -extern void* getPluginContext(CtlPluginT *plugin); -extern void setPluginContext(CtlPluginT *plugin, void *context); +extern int PluginConfig(afb_api_t UNUSED_ARG(apiHandle), CtlSectionT *section, json_object *pluginsJ); +extern int PluginGetCB (afb_api_t apiHandle, CtlActionT *action , json_object *callbackJ); #ifdef __cplusplus } #endif |