/*
- * Copyright (C) 2018 "IoT.bzh"
+ * Copyright (C) 2018, 2019 "IoT.bzh"
* Author José Bollo <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* limitations under the License.
*/
+#if WITH_DYNAMIC_BINDING
+
#define _GNU_SOURCE
#include <stdlib.h>
goto error;
}
- api = afb_api_v3_create(declare_set, call_set, a.desc->api, a.desc->info, a.desc->noconcurrency, init, &a, 0);
+ api = afb_api_v3_create(declare_set, call_set, a.desc->api, a.desc->info, a.desc->noconcurrency, init, &a, 0, NULL, path);
if (api)
return 1;
} else {
}
export = afb_export_create_none_for_path(declare_set, call_set, path, init, &a);
- if (export)
+ if (export) {
+ /*
+ * No call is done to afb_export_unref(export) because:
+ * - legacy applications may use the root API emitting messages
+ * - it allows writting applications like bindings without API
+ * But this has the sad effect to introduce a kind of leak.
+ * To avoid this, if necessary further developement should list bindings
+ * and their data.
+ */
return 1;
+ }
}
ERROR("binding [%s] initialisation failed", path);
return -1;
}
+#endif