summaryrefslogtreecommitdiffstats
path: root/src/mapis.c
diff options
context:
space:
mode:
authorClément Bénier <clement.benier@iot.bzh>2018-10-05 11:24:12 +0200
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2018-10-08 08:07:08 +0000
commitcef21bdaf75d5cfb220e47b355eda3e1304c2803 (patch)
treeaf876644f27bbd53dad36179c2edc81d17f9c8f3 /src/mapis.c
parent02881ee1864b7f5211ffd804e5c9181a30919c66 (diff)
get rid of afb-definitions
directly use app framework binder api v3 Change-Id: If2587b074ab5215036bce68ff5b42c398512af0d Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
Diffstat (limited to 'src/mapis.c')
-rw-r--r--src/mapis.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mapis.c b/src/mapis.c
index e40f3aa..fbe3e68 100644
--- a/src/mapis.c
+++ b/src/mapis.c
@@ -21,26 +21,26 @@
#include <ctl-config.h>
struct mapisHandleT {
- AFB_ApiT mainApiHandle;
+ afb_api_t mainApiHandle;
CtlSectionT *section;
json_object *mapiJ;
json_object *verbsJ;
json_object *eventsJ;
};
-static int LoadOneMapi(void *data, AFB_ApiT apiHandle) {
+static int LoadOneMapi(void *data, afb_api_t apiHandle) {
int idx = 0;
struct mapisHandleT *mapisHandle = (struct mapisHandleT*)data;
- CtlConfigT *ctrlConfig = AFB_ApiGetUserData(mapisHandle->mainApiHandle);
+ CtlConfigT *ctrlConfig = afb_api_get_userdata(mapisHandle->mainApiHandle);
if(PluginConfig(apiHandle, mapisHandle->section, mapisHandle->mapiJ)) {
- AFB_ApiError(apiHandle, "Problem loading the plugin as an API for %s, see log message above", json_object_get_string(mapisHandle->mapiJ));
+ AFB_API_ERROR(apiHandle, "Problem loading the plugin as an API for %s, see log message above", json_object_get_string(mapisHandle->mapiJ));
return -1;
}
// declare the verbs for this API
if(! ActionConfig(apiHandle, mapisHandle->verbsJ, 1)) {
- AFB_ApiError(apiHandle, "Problems at verbs creations for %s", json_object_get_string(mapisHandle->mapiJ));
+ AFB_API_ERROR(apiHandle, "Problems at verbs creations for %s", json_object_get_string(mapisHandle->mapiJ));
return -1;
}
@@ -52,13 +52,13 @@ static int LoadOneMapi(void *data, AFB_ApiT apiHandle) {
}
if( AddActionsToSection(apiHandle, &ctrlConfig->sections[idx], mapisHandle->eventsJ, 0) ) {
- AFB_ApiError(apiHandle, "Wasn't able to add new events to %s", ctrlConfig->sections[idx].uid);
+ AFB_API_ERROR(apiHandle, "Wasn't able to add new events to %s", ctrlConfig->sections[idx].uid);
return -1;
}
}
// declare an event event manager for this API;
- AFB_ApiOnEvent(apiHandle, CtrlDispatchApiEvent);
+ afb_api_on_event(apiHandle, CtrlDispatchApiEvent);
return 0;
}
@@ -77,7 +77,7 @@ static void OneMapiConfig(void *data, json_object *mapiJ) {
"lua", NULL,
"verbs", &mapisHandle->verbsJ,
"events", &mapisHandle->eventsJ)) {
- AFB_ApiError(mapisHandle->mainApiHandle, "Wrong mapis specification, missing uid|[info]|[spath]|libs|[lua]|verbs|[events] for %s", json_object_get_string(mapiJ));
+ AFB_API_ERROR(mapisHandle->mainApiHandle, "Wrong mapis specification, missing uid|[info]|[spath]|libs|[lua]|verbs|[events] for %s", json_object_get_string(mapiJ));
return;
}
@@ -87,12 +87,12 @@ static void OneMapiConfig(void *data, json_object *mapiJ) {
json_object_object_del(mapiJ, "events");
mapisHandle->mapiJ = mapiJ;
- if (!AFB_NewApi(mapisHandle->mainApiHandle, uid, info, 1, LoadOneMapi, (void*)mapisHandle))
- AFB_ApiError(mapisHandle->mainApiHandle, "Error creating new api: %s", uid);
+ if (!afb_api_new_api(mapisHandle->mainApiHandle, uid, info, 1, LoadOneMapi, (void*)mapisHandle))
+ AFB_API_ERROR(mapisHandle->mainApiHandle, "Error creating new api: %s", uid);
}
}
-int MapiConfig(AFB_ApiT apiHandle, CtlSectionT *section, json_object *mapisJ) {
+int MapiConfig(afb_api_t apiHandle, CtlSectionT *section, json_object *mapisJ) {
struct mapisHandleT mapisHandle = {
.mainApiHandle = apiHandle,
.section = section,