-extern struct afb_apiset *main_apiset;
-
-/* CAUTION! KEEP VERBS SORTED */
-#define VERBS \
- V(get) \
- V(hook) \
- V(set)
-
-/**
- * Declare functions of verbs
- */
-#define F(x) static void f_##x(struct afb_xreq *xreq)
-#define V(x) F(x);
- VERBS
-#undef V
-
-/**
- * Name of the known verbs
- */
-static const struct {
- const char *name;
- void (*function)(struct afb_xreq*);
-} verbs[] = {
-#define V(x) { .name = #x, .function = f_##x },
- VERBS
-#undef V
-};
-
-/**
- * get the function of a verb
- * @param verb the name of the verb
- * @return the function for the verb or NULL when no verb of name exists
- */
-static void (*lookfun(const char *verb))(struct afb_xreq*)
-{
- int l, u, i, c;
-
- l = 0;
- u = (int)(sizeof verbs / sizeof *verbs);
- while (l < u) {
- i = (l + u) >> 1;
- c = strcmp(verb, verbs[i].name);
- if (c == 0)
- return verbs[i].function;
- if (c < 0)
- u = i;
- else
- l = i + 1;
- }
- return NULL;
-}
-
-static void call_cb(void *closure, struct afb_xreq *xreq)
-{
- void (*fun)(struct afb_xreq*);