diff options
author | José Bollo <jose.bollo@iot.bzh> | 2017-06-28 15:51:54 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2017-06-28 18:34:49 +0200 |
commit | e48b6fb595d90509d70f850244fc962f8440a14b (patch) | |
tree | f59f6f218761538278de3cbab842904c8bc18138 /bindings | |
parent | 305d98f7b6db1a3207cc877bd2cda819e3b90656 (diff) |
Bindings V2: reintroduce field 'info' for verbs
CAUTION, this breaks binary compatibility
Change-Id: I67acfffe1f04cdddee0ad1230b227b080da1ab06
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'bindings')
-rw-r--r-- | bindings/samples/HelloWorld.c | 38 | ||||
-rw-r--r-- | bindings/samples/tic-tac-toe.c | 19 |
2 files changed, 28 insertions, 29 deletions
diff --git a/bindings/samples/HelloWorld.c b/bindings/samples/HelloWorld.c index 0f58a43b..77de24a2 100644 --- a/bindings/samples/HelloWorld.c +++ b/bindings/samples/HelloWorld.c @@ -411,25 +411,25 @@ static void onevent(const char *event, struct json_object *object) // NOTE: this sample does not use session to keep test a basic as possible // in real application most APIs should be protected with AFB_SESSION_CHECK static const afb_verb_v2 verbs[]= { - { "ping" , pingSample , NULL, AFB_SESSION_NONE }, - { "pingfail" , pingFail , NULL, AFB_SESSION_NONE }, - { "pingnull" , pingNull , NULL, AFB_SESSION_NONE }, - { "pingbug" , pingBug , NULL, AFB_SESSION_NONE }, - { "pingJson" , pingJson , NULL, AFB_SESSION_NONE }, - { "pingevent", pingEvent , NULL, AFB_SESSION_NONE }, - { "subcall", subcall , NULL, AFB_SESSION_NONE }, - { "subcallsync", subcallsync, NULL, AFB_SESSION_NONE }, - { "eventadd", eventadd , NULL, AFB_SESSION_NONE }, - { "eventdel", eventdel , NULL, AFB_SESSION_NONE }, - { "eventsub", eventsub , NULL, AFB_SESSION_NONE }, - { "eventunsub", eventunsub , NULL, AFB_SESSION_NONE }, - { "eventpush", eventpush , NULL, AFB_SESSION_NONE }, - { "call", call , NULL, AFB_SESSION_NONE }, - { "callsync", callsync , NULL, AFB_SESSION_NONE }, - { "verbose", verbose , NULL, AFB_SESSION_NONE }, - { "broadcast", broadcast , NULL, AFB_SESSION_NONE }, - { "exit", exitnow , NULL, AFB_SESSION_NONE }, - { NULL} + { .verb="ping", .callback=pingSample }, + { .verb="pingfail", .callback=pingFail }, + { .verb="pingnull", .callback=pingNull }, + { .verb="pingbug", .callback=pingBug }, + { .verb="pingJson", .callback=pingJson }, + { .verb="pingevent", .callback=pingEvent }, + { .verb="subcall", .callback=subcall }, + { .verb="subcallsync", .callback=subcallsync }, + { .verb="eventadd", .callback=eventadd }, + { .verb="eventdel", .callback=eventdel }, + { .verb="eventsub", .callback=eventsub }, + { .verb="eventunsub", .callback=eventunsub }, + { .verb="eventpush", .callback=eventpush }, + { .verb="call", .callback=call }, + { .verb="callsync", .callback=callsync }, + { .verb="verbose", .callback=verbose }, + { .verb="broadcast", .callback=broadcast }, + { .verb="exit", .callback=exitnow }, + { .verb=NULL} }; const afb_binding_v2 afbBindingV2 = { diff --git a/bindings/samples/tic-tac-toe.c b/bindings/samples/tic-tac-toe.c index 3cff9afc..bf4904ea 100644 --- a/bindings/samples/tic-tac-toe.c +++ b/bindings/samples/tic-tac-toe.c @@ -564,16 +564,15 @@ static void wait(struct afb_req req) * array of the verbs exported to afb-daemon */ static const struct afb_verb_v2 verbs[] = { - /* VERB'S NAME SESSION MANAGEMENT FUNCTION TO CALL SHORT DESCRIPTION */ - { "new", new, NULL, AFB_SESSION_NONE }, - { "play", play, NULL, AFB_SESSION_NONE }, - { "move", move, NULL, AFB_SESSION_NONE }, - { "board", board, NULL, AFB_SESSION_NONE }, - { "level", level, NULL, AFB_SESSION_NONE }, - { "join", join, NULL, AFB_SESSION_NONE }, - { "undo", undo, NULL, AFB_SESSION_NONE }, - { "wait", wait, NULL, AFB_SESSION_NONE }, - { NULL, NULL, NULL, AFB_SESSION_NONE } /* marker for end of the array */ + { .verb="new", .callback=new }, + { .verb="play", .callback=play }, + { .verb="move", .callback=move }, + { .verb="board", .callback=board }, + { .verb="level", .callback=level }, + { .verb="join", .callback=join }, + { .verb="undo", .callback=undo }, + { .verb="wait", .callback=wait }, + { .verb=NULL } }; /* |