Code Review
/
src
/
app-framework-binder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Make status common
[src/app-framework-binder.git]
/
bindings
/
samples
/
HelloWorld.c
diff --git
a/bindings/samples/HelloWorld.c
b/bindings/samples/HelloWorld.c
index
77de24a
..
731ea53
100644
(file)
--- a/
bindings/samples/HelloWorld.c
+++ b/
bindings/samples/HelloWorld.c
@@
-169,10
+169,10
@@
static void pingJson (afb_req request) {
ping(request, jresp, "pingJson");
}
ping(request, jresp, "pingJson");
}
-static void subcallcb (void *prequest, int
iserror
, json_object *object)
+static void subcallcb (void *prequest, int
status
, json_object *object)
{
afb_req request = afb_req_unstore(prequest);
{
afb_req request = afb_req_unstore(prequest);
- if (
iserror
)
+ if (
status < 0
)
afb_req_fail(request, "failed", json_object_to_json_string(object));
else
afb_req_success(request, json_object_get(object), NULL);
afb_req_fail(request, "failed", json_object_to_json_string(object));
else
afb_req_success(request, json_object_get(object), NULL);
@@
-204,7
+204,7
@@
static void subcallsync (afb_req request)
afb_req_fail(request, "failed", "bad arguments");
else {
rc = afb_req_subcall_sync(request, api, verb, object, &result);
afb_req_fail(request, "failed", "bad arguments");
else {
rc = afb_req_subcall_sync(request, api, verb, object, &result);
- if (rc)
+ if (rc
>= 0
)
afb_req_success(request, result, NULL);
else {
afb_req_fail(request, "failed", json_object_to_json_string(result));
afb_req_success(request, result, NULL);
else {
afb_req_fail(request, "failed", json_object_to_json_string(result));
@@
-287,10
+287,10
@@
static void eventpush (afb_req request)
json_object_put(object);
}
json_object_put(object);
}
-static void callcb (void *prequest, int
iserror
, json_object *object)
+static void callcb (void *prequest, int
status
, json_object *object)
{
afb_req request = afb_req_unstore(prequest);
{
afb_req request = afb_req_unstore(prequest);
- if (
iserror
)
+ if (
status < 0
)
afb_req_fail(request, "failed", json_object_to_json_string(object));
else
afb_req_success(request, json_object_get(object), NULL);
afb_req_fail(request, "failed", json_object_to_json_string(object));
else
afb_req_success(request, json_object_get(object), NULL);
@@
-322,7
+322,7
@@
static void callsync (afb_req request)
afb_req_fail(request, "failed", "bad arguments");
else {
rc = afb_service_call_sync(api, verb, object, &result);
afb_req_fail(request, "failed", "bad arguments");
else {
rc = afb_service_call_sync(api, verb, object, &result);
- if (rc)
+ if (rc
>= 0
)
afb_req_success(request, result, NULL);
else {
afb_req_fail(request, "failed", json_object_to_json_string(result));
afb_req_success(request, result, NULL);
else {
afb_req_fail(request, "failed", json_object_to_json_string(result));
@@
-361,7
+361,7
@@
static void exitnow (afb_req request)
if (!json_object_object_get_ex(query,"reason",&l))
l = NULL;
if (!json_object_object_get_ex(query,"reason",&l))
l = NULL;
- REQ_NOTICE(request, "in phase of exiting with code %d, reason: %s", code, l ? json_object_get_string(l) : "unknown");
+
AFB_
REQ_NOTICE(request, "in phase of exiting with code %d, reason: %s", code, l ? json_object_get_string(l) : "unknown");
afb_req_success(request, NULL, NULL);
exit(code);
}
afb_req_success(request, NULL, NULL);
exit(code);
}
@@
-393,19
+393,19
@@
static void broadcast(afb_req request)
static int preinit()
{
static int preinit()
{
- NOTICE("hello binding comes to live");
+
AFB_
NOTICE("hello binding comes to live");
return 0;
}
static int init()
{
return 0;
}
static int init()
{
- NOTICE("hello binding starting");
+
AFB_
NOTICE("hello binding starting");
return 0;
}
static void onevent(const char *event, struct json_object *object)
{
return 0;
}
static void onevent(const char *event, struct json_object *object)
{
- NOTICE("received event %s(%s)", event, json_object_to_json_string(object));
+
AFB_
NOTICE("received event %s(%s)", event, json_object_to_json_string(object));
}
// NOTE: this sample does not use session to keep test a basic as possible
}
// NOTE: this sample does not use session to keep test a basic as possible