aboutsummaryrefslogtreecommitdiffstats
path: root/include/afb/afb-binding.hpp
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2018-06-19 20:16:28 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2018-06-22 09:48:48 +0200
commit525e9eaa644ca92fad23adfbb7c3119ae8b57a30 (patch)
tree41de59627ccc937450daf4da6488efd4f4b2f3c2 /include/afb/afb-binding.hpp
parent9e15212d26916f59fae2be6d9e618ae9b75a4f40 (diff)
Improve documentation of api v3
The documentation is improved to reflect the new version. Tune the options Change-Id: I894c3db3bc0c10e89db66a9a51a9ad049bb8c0c4 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'include/afb/afb-binding.hpp')
-rw-r--r--include/afb/afb-binding.hpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/afb/afb-binding.hpp b/include/afb/afb-binding.hpp
index 27715f39..21847722 100644
--- a/include/afb/afb-binding.hpp
+++ b/include/afb/afb-binding.hpp
@@ -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 <class T>
-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<void(*)(void*,int,json_object*,afb_api_t)>(callback), reinterpret_cast<void*>(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<void(*)(void*,int,json_object*)>(callback), reinterpret_cast<void*>(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 */