diff options
author | fulup <fulup.arfoll@iot.bzh> | 2017-08-13 16:50:34 +0200 |
---|---|---|
committer | fulup <fulup.arfoll@iot.bzh> | 2017-08-13 17:31:30 +0200 |
commit | 9777a02c7540fdec145feb948b4bbf1cd44c3352 (patch) | |
tree | 85f64445ef292938839092696c449d1b7c63216e /Controler-afb/ctl-binding.h | |
parent | b65178642727536972d0c04e53b2310be58beb2e (diff) |
Fix AFB_MESSAGE with null arguments
Diffstat (limited to 'Controler-afb/ctl-binding.h')
-rw-r--r-- | Controler-afb/ctl-binding.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/Controler-afb/ctl-binding.h b/Controler-afb/ctl-binding.h index deef93c..01840b8 100644 --- a/Controler-afb/ctl-binding.h +++ b/Controler-afb/ctl-binding.h @@ -28,6 +28,11 @@ #endif #define STATIC static +#ifndef UNUSED_ARG +#define UNUSED_ARG(x) UNUSED_ ## x __attribute__((__unused__)) +#define UNUSED_FUNCTION(x) __attribute__((__unused__)) UNUSED_ ## x +#endif + // sharelib ctl-plugin* typedef struct { long magic; @@ -36,6 +41,9 @@ typedef struct { #define CTL_PLUGIN_REGISTER(pluglabel) CtlPluginMagicT CtlPluginMagic={.magic=CTL_PLUGIN_MAGIC,.label=pluglabel}; struct afb_binding_data_v2; +// ctl-misc.c + + // polctl-binding.c PUBLIC int CtlBindingInit (); @@ -49,12 +57,14 @@ PUBLIC void ctlapi_event_test (afb_req request); // ctl-policy // ----------- - typedef enum { CTL_SCAN_FLAT=0, CTL_SCAN_RECURSIVE=1, } CtlScanDirModeT; +PUBLIC json_object* ScanForConfig (char* searchPath, CtlScanDirModeT mode, char *pre, char *ext); +PUBLIC const char *GetBinderName(); + typedef enum { CTL_MODE_NONE=0, CTL_MODE_API, @@ -70,10 +80,12 @@ typedef struct DispatchActionS{ const char* call; json_object *argsJ; int timeout; - int (*actionCB)(afb_req request, struct DispatchActionS *action, void *context); + int (*actionCB)(struct DispatchActionS *action, json_object *queryJ, void *context); } DispatchActionT; PUBLIC int DispatchInit(void); +PUBLIC int DispatchOneOnLoad(const char *onLoadLabel); +PUBLIC void DispatchOneEvent(const char *evtLabel, json_object *eventJ); PUBLIC void ctlapi_dispatch (char* control, afb_req request); // ctl-lua.c @@ -85,8 +97,7 @@ typedef enum { } LuaDoActionT; PUBLIC int LuaLibInit (); -PUBLIC json_object* ScanForConfig (char* searchPath, CtlScanDirModeT mode, char *pre, char *ext); -PUBLIC int LuaCallFunc (afb_req request, DispatchActionT *action); +PUBLIC int LuaCallFunc (DispatchActionT *action, json_object *queryJ); PUBLIC void ctlapi_lua_docall (afb_req request); PUBLIC void ctlapi_lua_dostring (afb_req request); PUBLIC void ctlapi_lua_doscript (afb_req request); |