+static int afb_api_so_event_broadcast_cb(void *closure, const char *name, struct json_object *object)
+{
+ size_t length;
+ char *event;
+ struct api_so_desc *desc = closure;
+
+ /* makes the event name */
+ assert(desc->binding != NULL);
+ length = strlen(name);
+ event = alloca(length + 2 + desc->apilength);
+ memcpy(event, desc->binding->v1.prefix, desc->apilength);
+ event[desc->apilength] = '/';
+ memcpy(event + desc->apilength + 1, name, length + 1);
+
+ return afb_evt_broadcast(event, object);
+}
+
+static void afb_api_so_vverbose_cb(void *closure, int level, const char *file, int line, const char *fmt, va_list args)
+{
+ char *p;
+ struct api_so_desc *desc = closure;
+
+ if (vasprintf(&p, fmt, args) < 0)
+ vverbose(level, file, line, fmt, args);
+ else {
+ verbose(level, file, line, "%s {binding %s}", p, desc->binding->v1.prefix);
+ free(p);
+ }
+}
+
+static int afb_api_so_rootdir_get_fd(void *closure)
+{
+ return afb_common_rootdir_get_fd();