X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=include%2Fafb%2Fafb-binding.hpp;h=0cb6442342e3169fdfefceb14d04c11923892e5a;hb=043c27c3a8fd323d59e41288b6fd24f0e9bfa9a3;hp=27715f39c2ee84254cad5c82fa482f387e674ab2;hpb=4521c1e7ae5371ab9d639adc617d17fb4e8ded0c;p=src%2Fapp-framework-binder.git diff --git a/include/afb/afb-binding.hpp b/include/afb/afb-binding.hpp index 27715f39..0cb64423 100644 --- a/include/afb/afb-binding.hpp +++ b/include/afb/afb-binding.hpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016, 2017, 2018 "IoT.bzh" + * Copyright (C) 2016-2019 "IoT.bzh" * Author: José Bollo * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -496,16 +496,21 @@ inline bool wants_debugs() { return AFB_SYSLOG_MASK_WANT_DEBUG(logmask()); } #if AFB_BINDING_VERSION >= 3 -inline void call(const char *api, const char *verb, struct json_object *args, void (*callback)(void*closure, int iserror, struct json_object *result, afb_api_t api), void *closure) +inline void call(const char *api, const char *verb, struct json_object *args, void (*callback)(void*closure, struct json_object *result, const char *error, const char *info, afb_api_t api), void *closure) { afb_service_call(api, verb, args, callback, closure); } template -inline void call(const char *api, const char *verb, struct json_object *args, void (*callback)(T*closure, int iserror, struct json_object *result, afb_api_t api), T *closure) +inline void call(const char *api, const char *verb, struct json_object *args, void (*callback)(T*closure, struct json_object *result, const char *error, const char *info, afb_api_t api), T *closure) { afb_service_call(api, verb, args, reinterpret_cast(callback), reinterpret_cast(closure)); } + +inline bool callsync(const char *api, const char *verb, struct json_object *args, struct json_object *&result, char *&error, char *&info) +{ + return !!afb_service_call_sync(api, verb, args, &result, &error, &info); +} #else inline void call(const char *api, const char *verb, struct json_object *args, void (*callback)(void*closure, int iserror, struct json_object *result), void *closure) { @@ -517,12 +522,12 @@ inline void call(const char *api, const char *verb, struct json_object *args, vo { afb_service_call(api, verb, args, reinterpret_cast(callback), reinterpret_cast(closure)); } -#endif inline bool callsync(const char *api, const char *verb, struct json_object *args, struct json_object *&result) { return !!afb_service_call_sync(api, verb, args, &result); } +#endif /*************************************************************************/ /* declaration of the binding's authorization s */