/*
- * Copyright (C) 2016, 2017, 2018 "IoT.bzh"
+ * Copyright (C) 2016-2019 "IoT.bzh"
* Author José Bollo <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
#pragma once
+#if WITH_AFB_HOOK /***********************************************************/
+
#include <stdarg.h>
#include <time.h>
#define afb_hook_flag_api_on_event 0x04000000
#define afb_hook_flag_api_legacy_unstore_req 0x08000000
#define afb_hook_flag_api_on_event_handler 0x10000000
+#define afb_hook_flag_api_settings 0x20000000
/* common flags */
/* extra flags */
|afb_hook_flag_api_call\
|afb_hook_flag_api_callsync\
|afb_hook_flag_api_start\
- |afb_hook_flag_api_queue_job)
+ |afb_hook_flag_api_queue_job\
+ |afb_hook_flag_api_settings)
#define afb_hook_flags_api_extra (afb_hook_flag_api_get_event_loop\
void (*hook_api_delete_api)(void *closure, const struct afb_hookid *hookid, const struct afb_export *export, int result);
void (*hook_api_on_event_handler_before)(void *closure, const struct afb_hookid *hookid, const struct afb_export *export, const char *event, int event_x2, struct json_object *object, const char *pattern);
void (*hook_api_on_event_handler_after)(void *closure, const struct afb_hookid *hookid, const struct afb_export *export, const char *event, int event_x2, struct json_object *object, const char *pattern);
+ void (*hook_api_settings)(void *closure, const struct afb_hookid *hookid, const struct afb_export *export, struct json_object *object);
};
extern void afb_hook_api_event_broadcast_before(const struct afb_export *export, const char *name, struct json_object *object);
extern int afb_hook_api_delete_api(const struct afb_export *export, int result);
extern void afb_hook_api_on_event_handler_before(const struct afb_export *export, const char *event, int event_x2, struct json_object *object, const char *pattern);
extern void afb_hook_api_on_event_handler_after(const struct afb_export *export, const char *event, int event_x2, struct json_object *object, const char *pattern);
+extern struct json_object *afb_hook_api_settings(const struct afb_export *export, struct json_object *object);
extern int afb_hook_flags_api(const char *api);
extern struct afb_hook_api *afb_hook_create_api(const char *api, int flags, struct afb_hook_api_itf *itf, void *closure);
#define afb_hook_flag_session_create 0x000001
#define afb_hook_flag_session_close 0x000002
#define afb_hook_flag_session_destroy 0x000004
-#define afb_hook_flag_session_renew 0x000008
-#define afb_hook_flag_session_addref 0x000010
-#define afb_hook_flag_session_unref 0x000020
+#define afb_hook_flag_session_addref 0x000008
+#define afb_hook_flag_session_unref 0x000010
-#define afb_hook_flags_session_common (afb_hook_flag_session_create|afb_hook_flag_session_close\
- |afb_hook_flag_session_renew)
+#define afb_hook_flags_session_common (afb_hook_flag_session_create|afb_hook_flag_session_close)
#define afb_hook_flags_session_all (afb_hook_flags_session_common|afb_hook_flag_session_destroy\
|afb_hook_flag_session_addref|afb_hook_flag_session_unref)
void (*hook_session_create)(void *closure, const struct afb_hookid *hookid, struct afb_session *session);
void (*hook_session_close)(void *closure, const struct afb_hookid *hookid, struct afb_session *session);
void (*hook_session_destroy)(void *closure, const struct afb_hookid *hookid, struct afb_session *session);
- void (*hook_session_renew)(void *closure, const struct afb_hookid *hookid, struct afb_session *session);
void (*hook_session_addref)(void *closure, const struct afb_hookid *hookid, struct afb_session *session);
void (*hook_session_unref)(void *closure, const struct afb_hookid *hookid, struct afb_session *session);
};
extern void afb_hook_session_create(struct afb_session *session);
extern void afb_hook_session_close(struct afb_session *session);
extern void afb_hook_session_destroy(struct afb_session *session);
-extern void afb_hook_session_renew(struct afb_session *session);
extern void afb_hook_session_addref(struct afb_session *session);
extern void afb_hook_session_unref(struct afb_session *session);
extern void afb_hook_unref_global(struct afb_hook_global *hook);
+#endif /* WITH_AFB_HOOK *******************************************************/