-const struct AFB_restapi *afb_apis_get(int apiidx, int verbidx)
-{
- assert(0 <= apiidx && apiidx < apis_count);
- return &apis_array[apiidx].plugin->apis[verbidx];
-}
-
-int afb_apis_get_verbidx(int apiidx, const char *name)
-{
- const struct AFB_restapi *apis;
- int idx;
-
- assert(0 <= apiidx && apiidx < apis_count);
- apis = apis_array[apiidx].plugin->apis;
- for (idx = 0 ; apis[idx].name ; idx++)
- if (!strcasecmp(apis[idx].name, name))
- return idx;
- return -1;
-}
-
-int afb_apis_get_apiidx(const char *prefix, size_t length)
-{
- int i;
- const struct api_desc *a;
-
- if (!length)
- length = strlen(prefix);
-
- for (i = 0 ; i < apis_count ; i++) {
- a = &apis_array[i];
- if (a->prefixlen == length && !strcasecmp(a->prefix, prefix))
- return i;
- }
- return -1;
-}
-