#include "afb-apiset.h"
#include "afb-api-so-v2.h"
#include "afb-ditf.h"
+#include "afb-evt.h"
#include "afb-xreq.h"
#include "afb-trace.h"
#include "verbose.h"
static void get_one_api(struct json_object *resu, const char *name, struct json_object *spec)
{
struct json_object *o;
- struct afb_api api;
- int rc;
- rc = afb_apiset_lookup(main_apiset, name, &api);
- if (!rc) {
- o = api.itf->describe ? api.itf->describe(api.closure) : NULL;
+ o = afb_apiset_describe(main_apiset, name);
+ if (o || afb_apiset_has(main_apiset, name))
json_object_object_add(resu, name, o);
- }
}
/**
if (add) {
rc = afb_trace_add(req, add, trace);
if (rc)
- return;
+ goto end;
}
if (drop) {
rc = afb_trace_drop(req, drop, trace);
if (rc)
- return;
+ goto end;
}
afb_req_success(req, NULL, NULL);
+end:
+ afb_apiset_update_hooks(main_apiset, NULL);
+ afb_evt_update_hooks();
}