summaryrefslogtreecommitdiffstats
path: root/src/afb-hook.h
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-09-21 11:26:07 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-10-09 14:08:32 +0200
commitbb73f5b6fb216b4badb94767558e83e60cf08fd0 (patch)
treed6b66264ea13a780b4426d56b2546ae097040432 /src/afb-hook.h
parentf2e72e1858d0be1a9cf3c0c4263f0bd81570d0e8 (diff)
afb-evt: prepare futur afb_eventid
Change-Id: Ie4668c2dadbdfbe79bac2c27a1b188edecbcf847 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-hook.h')
-rw-r--r--src/afb-hook.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/afb-hook.h b/src/afb-hook.h
index be4ba54a..9cdca9c7 100644
--- a/src/afb-hook.h
+++ b/src/afb-hook.h
@@ -293,11 +293,14 @@ extern void afb_hook_unref_svc(struct afb_hook_svc *hook);
#define afb_hook_flag_evt_broadcast_after 0x000010
#define afb_hook_flag_evt_name 0x000020
#define afb_hook_flag_evt_drop 0x000040
+#define afb_hook_flag_evt_addref 0x000080
+#define afb_hook_flag_evt_unref 0x000100
#define afb_hook_flags_evt_common (afb_hook_flag_evt_push_before|afb_hook_flag_evt_broadcast_before)
#define afb_hook_flags_evt_extra (afb_hook_flags_evt_common\
|afb_hook_flag_evt_push_after|afb_hook_flag_evt_broadcast_after\
- |afb_hook_flag_evt_create|afb_hook_flag_evt_drop)
+ |afb_hook_flag_evt_create|afb_hook_flag_evt_drop\
+ |afb_hook_flag_evt_addref|afb_hook_flag_evt_unref)
#define afb_hook_flags_evt_all (afb_hook_flags_evt_extra|afb_hook_flag_evt_name)
struct afb_hook_evt_itf {
@@ -306,8 +309,10 @@ struct afb_hook_evt_itf {
void (*hook_evt_push_after)(void *closure, const struct afb_hookid *hookid, const char *evt, int id, struct json_object *obj, int result);
void (*hook_evt_broadcast_before)(void *closure, const struct afb_hookid *hookid, const char *evt, int id, struct json_object *obj);
void (*hook_evt_broadcast_after)(void *closure, const struct afb_hookid *hookid, const char *evt, int id, struct json_object *obj, int result);
- void (*hook_evt_name)(void *closure, const struct afb_hookid *hookid, const char *evt, int id);
+ void (*hook_evt_name)(void *closure, const struct afb_hookid *hookid, const char *evt, int id, const char *result);
void (*hook_evt_drop)(void *closure, const struct afb_hookid *hookid, const char *evt, int id);
+ void (*hook_evt_addref)(void *closure, const struct afb_hookid *hookid, const char *evt, int id);
+ void (*hook_evt_unref)(void *closure, const struct afb_hookid *hookid, const char *evt, int id);
};
extern void afb_hook_evt_create(const char *evt, int id);
@@ -315,8 +320,10 @@ extern void afb_hook_evt_push_before(const char *evt, int id, struct json_object
extern int afb_hook_evt_push_after(const char *evt, int id, struct json_object *obj, int result);
extern void afb_hook_evt_broadcast_before(const char *evt, int id, struct json_object *obj);
extern int afb_hook_evt_broadcast_after(const char *evt, int id, struct json_object *obj, int result);
-extern void afb_hook_evt_name(const char *evt, int id);
+extern void afb_hook_evt_name(const char *evt, int id, const char *result);
extern void afb_hook_evt_drop(const char *evt, int id);
+extern void afb_hook_evt_addref(const char *evt, int id);
+extern void afb_hook_evt_unref(const char *evt, int id);
extern int afb_hook_flags_evt(const char *name);
extern struct afb_hook_evt *afb_hook_create_evt(const char *pattern, int flags, struct afb_hook_evt_itf *itf, void *closure);