X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-api-dbus.c;h=cace4d2b65a6c4fe85d4b5ad09abfe6e2f0d38ef;hb=a4dcf977a6b9e517a0b32949b5967a6de5064f13;hp=1aad8635cc868fa0a941ae1966c40810fd2a87ce;hpb=5928e8fc14c2edabc0bc104fff7542819e06d45a;p=src%2Fapp-framework-binder.git diff --git a/src/afb-api-dbus.c b/src/afb-api-dbus.c index 1aad8635..cace4d2b 100644 --- a/src/afb-api-dbus.c +++ b/src/afb-api-dbus.c @@ -332,7 +332,7 @@ static void api_dbus_client_call(void *closure, struct afb_xreq *xreq) /* creates the message */ msg = NULL; - rc = sd_bus_message_new_method_call(api->sdbus, &msg, api->name, api->path, api->name, xreq->verb); + rc = sd_bus_message_new_method_call(api->sdbus, &msg, api->name, api->path, api->name, xreq->request.verb); if (rc < 0) goto error; @@ -382,7 +382,7 @@ static struct dbus_event *api_dbus_client_event_search(struct api_dbus *api, int struct dbus_event *ev; ev = api->client.events; - while (ev != NULL && (ev->id != id || 0 != strcmp(afb_evt_event_fullname(ev->eventid), name))) + while (ev != NULL && (ev->id != id || 0 != strcmp(afb_evt_eventid_fullname(ev->eventid), name))) ev = ev->next; return ev; @@ -403,7 +403,7 @@ static void api_dbus_client_event_create(struct api_dbus *api, int id, const cha /* no conflict, try to add it */ ev = malloc(sizeof *ev); if (ev != NULL) { - ev->eventid = afb_evt_create_event(name); + ev->eventid = afb_evt_eventid_create(name); if (ev->eventid == NULL) free(ev); else { @@ -440,7 +440,7 @@ static void api_dbus_client_event_drop(struct api_dbus *api, int id, const char *prv = ev->next; /* destroys the event */ - afb_evt_event_unref(ev->eventid); + afb_evt_eventid_unref(ev->eventid); free(ev); } @@ -459,7 +459,7 @@ static void api_dbus_client_event_push(struct api_dbus *api, int id, const char /* destroys the event */ object = json_tokener_parse(data); - afb_evt_push(ev->eventid, object); + afb_evt_eventid_push(ev->eventid, object); } /* subscribes an event */ @@ -848,9 +848,9 @@ static int dbus_req_subscribe(struct afb_xreq *xreq, struct afb_eventid *eventid uint64_t msgid; int rc; - rc = afb_evt_add_watch(dreq->listener->listener, eventid); + rc = afb_evt_eventid_add_watch(dreq->listener->listener, eventid); sd_bus_message_get_cookie(dreq->message, &msgid); - afb_api_dbus_server_event_send(dreq->listener->origin, 'S', afb_evt_event_fullname(eventid), afb_evt_event_id(eventid), "", msgid); + afb_api_dbus_server_event_send(dreq->listener->origin, 'S', afb_evt_eventid_fullname(eventid), afb_evt_eventid_id(eventid), "", msgid); return rc; } @@ -861,8 +861,8 @@ static int dbus_req_unsubscribe(struct afb_xreq *xreq, struct afb_eventid *event int rc; sd_bus_message_get_cookie(dreq->message, &msgid); - afb_api_dbus_server_event_send(dreq->listener->origin, 'U', afb_evt_event_fullname(eventid), afb_evt_event_id(eventid), "", msgid); - rc = afb_evt_remove_watch(dreq->listener->listener, eventid); + afb_api_dbus_server_event_send(dreq->listener->origin, 'U', afb_evt_eventid_fullname(eventid), afb_evt_eventid_id(eventid), "", msgid); + rc = afb_evt_eventid_remove_watch(dreq->listener->listener, eventid); return rc; } @@ -985,8 +985,8 @@ static int api_dbus_server_on_object_called(sd_bus_message *message, void *userd dreq->json = json_object_new_string(dreq->request); } dreq->listener = listener; - dreq->xreq.api = api->api; - dreq->xreq.verb = method; + dreq->xreq.request.api = api->api; + dreq->xreq.request.verb = method; afb_xreq_process(&dreq->xreq, api->server.apiset); return 1;