hooks: Allow to remove hooking (and/or trace)
[src/app-framework-binder.git] / src / afb-export.h
index be8adfd..e8b9a9d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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");
@@ -30,6 +30,8 @@ struct afb_api_v3;
 struct afb_api_x3;
 struct afb_event_x2;
 
+extern void afb_export_set_config(struct json_object *config);
+
 extern struct afb_export *afb_export_create_none_for_path(
                                struct afb_apiset *declare_set,
                                struct afb_apiset *call_set,
@@ -37,19 +39,21 @@ extern struct afb_export *afb_export_create_none_for_path(
                                int (*creator)(void*, struct afb_api_x3*),
                                void *closure);
 
-extern struct afb_export *afb_export_create_v2(
-                               struct afb_apiset *declare_set,
+extern struct afb_export *afb_export_create_v2(struct afb_apiset *declare_set,
                                struct afb_apiset *call_set,
                                const char *apiname,
                                const struct afb_binding_v2 *binding,
                                struct afb_binding_data_v2 *data,
                                int (*init)(),
-                               void (*onevent)(const char*, struct json_object*));
+                               void (*onevent)(const char*, struct json_object*),
+                               const char* path);
 
 extern struct afb_export *afb_export_create_v3(struct afb_apiset *declare_set,
                                struct afb_apiset *call_set,
                                const char *apiname,
-                               struct afb_api_v3 *api);
+                               struct afb_api_v3 *api,
+                               struct afb_export* creator,
+                               const char* path);
 
 extern struct afb_export *afb_export_addref(struct afb_export *export);
 extern void afb_export_unref(struct afb_export *export);
@@ -62,7 +66,6 @@ extern void afb_export_undeclare(struct afb_export *export);
 extern const char *afb_export_apiname(const struct afb_export *export);
 extern int afb_export_add_alias(struct afb_export *export, const char *apiname, const char *aliasname);
 extern int afb_export_rename(struct afb_export *export, const char *apiname);
-extern void afb_export_update_hooks(struct afb_export *export);
 
 extern int afb_export_unshare_session(struct afb_export *export);
 
@@ -111,17 +114,21 @@ extern void afb_export_context_init(struct afb_export *export, struct afb_contex
 extern struct afb_export *afb_export_from_api_x3(struct afb_api_x3 *api);
 extern struct afb_api_x3 *afb_export_to_api_x3(struct afb_export *export);
 
+#if WITH_AFB_HOOK
+extern void afb_export_update_hooks(struct afb_export *export);
+#endif
+
 #if defined(WITH_LEGACY_BINDING_V1)
 
 struct afb_service_x1;
 struct afb_binding_interface_v1;
 
-extern struct afb_export *afb_export_create_v1(
-                               struct afb_apiset *declare_set,
+extern struct afb_export *afb_export_create_v1(struct afb_apiset *declare_set,
                                struct afb_apiset *call_set,
                                const char *apiname,
                                int (*init)(struct afb_service_x1),
-                               void (*onevent)(const char*, struct json_object*));
+                               void (*onevent)(const char*, struct json_object*),
+                               const char* path);
 
 extern struct afb_binding_v1 *afb_export_register_v1(
                                struct afb_export *export,