+ /* check the mid of the slice */
+ i = (lo + up) >> 1;
+ a = &apis_array[i];
+ c = strcasecmp(a->name, api);
+ if (c == 0) {
+ /* api found */
+ context->api_key = a->api.closure;
+ a->api.call(a->api.closure, req, context, verb);
+ break;
+ }
+ /* update the slice */
+ if (c < 0)
+ lo = i + 1;
+ else
+ up = i;
+ }
+}
+
+int afb_apis_start_service(const char *api, int share_session, int onneed)
+{
+ int i;
+
+ for (i = 0 ; i < apis_count ; i++) {
+ if (!strcasecmp(apis_array[i].name, api))
+ return apis_array[i].api.service_start(apis_array[i].api.closure, share_session, onneed);