Fix errors in migration to V3 65/15465/2
authorJosé Bollo <jose.bollo@iot.bzh>
Thu, 19 Jul 2018 12:09:17 +0000 (14:09 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Thu, 19 Jul 2018 14:33:08 +0000 (16:33 +0200)
Fix a tiny error in the migration script and improve it.

Fix declaration of afb_daemon_get... without args for
binding V3 compatibility.

Fix declaration of afb_api_event_handler_...

Fix the correct URL to the sed script:
 valid:   https://git.automotivelinux.org/src/app-framework-binder/plain/docs/migration-to-binding-v3.sed
 invalid: https://git.automotivelinux.org/src/app-framework-binder/tree/docs/migration-to-binding-v3.sed

Bug-AGL: SPEC-1595

Change-Id: I245b20a9c14634a94c69420312afbd97628bc750
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
docs/afb-migration-to-binding-v3.md
docs/migration-to-binding-v3.sed
include/afb/afb-binding-predefs.h
include/afb/afb-binding-v3.h

index 501c79f..266a8b0 100644 (file)
@@ -91,12 +91,16 @@ you want to upgrade. It can be done using **curl** and applied using **sed**
 as below.
 
 ```bash
-BASE=https://git.automotivelinux.org/src/app-framework-binder/tree
+BASE=https://git.automotivelinux.org/src/app-framework-binder/plain
 SED=migration-to-binding-v3.sed
 curl -o $SED $BASE/docs/$SED
 sed -i -f $SED file1 file2 file3...
 ```
 
+You can also follow
+[this link](https://git.automotivelinux.org/src/app-framework-binder/plain/docs/migration-to-binding-v3.sed)
+and save the file.
+
 This automatic action does most of the boring job but not all the job.
 The remaining of this guide explains the missing part.
 
index a668205..13a78f5 100644 (file)
@@ -40,7 +40,7 @@ s:\<afb_api_make_eventid\>:afb_api_make_event:g
 s:\<afb_api_new_api\>:-!&:g
 s:\<afb_api_sub_verb\>:afb_api_del_verb:g
 
-# udate legacy calls
+# update legacy calls
 # ------------------
 s:\<afb_req_subcall\(_req\)\>:afb_req_subcall_legacy:g
 s:\<afb_req_subcall_sync\>:afb_req_subcall_sync_legacy:g
@@ -48,11 +48,14 @@ s:\<afb_api_call\>:afb_api_call_legacy:g
 s:\<afb_api_call_sync\>:afb_api_call_sync_legacy:g
 s:\<afb_req_store\>:afb_req_addref:g
 s:\<afb_req_unstore\> *( *\(.*\) *):\1:g
-s:\<afb_daemon_\([a-z_0-9]* *(\):afb_api_\1afbBindingV3root,:g
-s:\<afb_daemon_\([a-z_0-9]* *(\):afb_api_\1afbBindingV3root,:g
-s:\<afb_service_call_\([a-z_0-9]*\)\( *(\):afb_api_\1_legacy\2afbBindingV3root,:g
-s:\<afb_service_\([a-z_0-9]* *(\):afb_api_\1afbBindingV3root,:g
-s:\<AFB_\(\(ERROR\|WARNING\|NOTICE\|INFO\|DEBUG\)\> *(\):AFB_API_\1afbBindingV3root,:g
+
+# optional but activated by default
+# ---------------------------------
+s:\<afb_daemon_get_\(event_loop\|user_bus\|system_bus\)[ \t]*(:afb_api_get_\1(afbBindingV3root:g
+s:\<afb_daemon_\([a-z_0-9]* *(\):afb_api_\1afbBindingV3root, :g
+s:\<afb_service_call_\([a-z_0-9]*\)\( *(\):afb_api_\1_legacy\2afbBindingV3root, :g
+s:\<afb_service_\([a-z_0-9]* *(\):afb_api_\1afbBindingV3root, :g
+s:\<AFB_\(\(ERROR\|WARNING\|NOTICE\|INFO\|DEBUG\)\> *(\):AFB_API_\1afbBindingV3root, :g
 
 # special app-controller
 # ----------------------
index 5a3d048..791374b 100644 (file)
 #define afb_api_x3_on_init             afb_api_on_init
 #define afb_api_x3_seal                        afb_api_seal
 #define afb_api_x3_add_alias           afb_api_add_alias
+#define afb_api_x3_event_handler_add   afb_api_event_handler_add
+#define afb_api_x3_event_handler_del   afb_api_event_handler_del
 #define afb_api_x3_require_class       afb_api_require_class
 #define afb_api_x3_provide_class       afb_api_provide_class
 
index 52a3a8d..9df2eb9 100644 (file)
@@ -245,9 +245,9 @@ extern const struct afb_binding_v3 afbBindingV3;
 #define afb_get_logmask_v3()                   (afbBindingV3root->logmask)
 #define afb_get_verbosity_v3()                 AFB_SYSLOG_LEVEL_TO_VERBOSITY(_afb_verbomask_to_upper_level_(afbBindingV3root->logmask))
 
-#define afb_daemon_get_event_loop_v3(...)      afb_api_get_event_loop(afbBindingV3root,__VA_ARGS__)
-#define afb_daemon_get_user_bus_v3(...)                afb_api_get_user_bus(afbBindingV3root,__VA_ARGS__)
-#define afb_daemon_get_system_bus_v3(...)      afb_api_get_system_bus(afbBindingV3root,__VA_ARGS__)
+#define afb_daemon_get_event_loop_v3()         afb_api_get_event_loop(afbBindingV3root)
+#define afb_daemon_get_user_bus_v3()           afb_api_get_user_bus(afbBindingV3root)
+#define afb_daemon_get_system_bus_v3()         afb_api_get_system_bus(afbBindingV3root)
 #define afb_daemon_broadcast_event_v3(...)     afb_api_broadcast_event(afbBindingV3root,__VA_ARGS__)
 #define afb_daemon_make_event_v3(...)          afb_api_make_event(afbBindingV3root,__VA_ARGS__)
 #define afb_daemon_verbose_v3(...)             afb_api_verbose(afbBindingV3root,__VA_ARGS__)