summaryrefslogtreecommitdiff
path: root/src/lib/eldbus/eldbus_service.c
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2014-07-15 08:01:14 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-07-15 08:01:14 +0900
commit835b8756ece4327df90fe03060c61482de6ec5d4 (patch)
tree27c4bd26d8256d83375240d29c37a522b563462d /src/lib/eldbus/eldbus_service.c
parent831ade54fa69ac6bf1bac2aa611c0942281ca225 (diff)
Fixes ABI breakage in Eldbus for use with C++ Eldbus
Summary: This fixes the breakage when Eldbus_Service_Interface_Desc added a wrongfully methods2 field to a class that is allocated by the user. This patch adds the respective eldbus_service_interface_register2 and eldbus_service_interface_fallback_register2 for registration of Eldbus_Service_Interface_Desc2 which is now versioned. So future the functions can be backwards compatible and the struct be forward compatible and leaves the Eldbus_Service_Interface_Desc and eldbus_service_interface_register and eldbus_service_interface_fallback_register intact as it was in EFL 1.10. This fixes T1408 Reviewers: cedric, stefan_schmidt, raster Reviewed By: raster Subscribers: cedric Maniphest Tasks: T1408 Differential Revision: https://phab.enlightenment.org/D1188
Diffstat (limited to 'src/lib/eldbus/eldbus_service.c')
-rw-r--r--src/lib/eldbus/eldbus_service.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/lib/eldbus/eldbus_service.c b/src/lib/eldbus/eldbus_service.c
index f8f5b7cbfd..f92f821203 100644
--- a/src/lib/eldbus/eldbus_service.c
+++ b/src/lib/eldbus/eldbus_service.c
@@ -928,7 +928,7 @@ fail_signature:
928} 928}
929 929
930static Eldbus_Service_Interface * 930static Eldbus_Service_Interface *
931_eldbus_service_interface_register(Eldbus_Connection *conn, const char *path, const Eldbus_Service_Interface_Desc *desc, Eina_Bool fallback) 931_eldbus_service_interface_register(Eldbus_Connection *conn, const char *path, const Eldbus_Service_Interface_Desc *desc, Eina_Bool fallback, unsigned int version)
932{ 932{
933 Eldbus_Service_Object *obj; 933 Eldbus_Service_Object *obj;
934 Eldbus_Service_Interface *iface; 934 Eldbus_Service_Interface *iface;
@@ -966,8 +966,12 @@ _eldbus_service_interface_register(Eldbus_Connection *conn, const char *path, co
966 for (method = desc->methods; method && method->member; method++) 966 for (method = desc->methods; method && method->member; method++)
967 _eldbus_service_method_add(iface, method); 967 _eldbus_service_method_add(iface, method);
968 968
969 for (method2 = desc->methods2; method2 && method2->method.member; method2++) 969 if(version >= 2)
970 _eldbus_service_method_add(iface, &method2->method); 970 {
971 Eldbus_Service_Interface_Desc2* desc2 = (void*)desc;
972 for (method2 = desc2->methods2; method2 && method2->method.member; method2++)
973 _eldbus_service_method_add(iface, &method2->method);
974 }
971 975
972 iface->signals = desc->signals; 976 iface->signals = desc->signals;
973 iface->sign_of_signals = signatures; 977 iface->sign_of_signals = signatures;
@@ -992,13 +996,25 @@ fail:
992EAPI Eldbus_Service_Interface * 996EAPI Eldbus_Service_Interface *
993eldbus_service_interface_register(Eldbus_Connection *conn, const char *path, const Eldbus_Service_Interface_Desc *desc) 997eldbus_service_interface_register(Eldbus_Connection *conn, const char *path, const Eldbus_Service_Interface_Desc *desc)
994{ 998{
995 return _eldbus_service_interface_register(conn, path, desc, EINA_FALSE); 999 return _eldbus_service_interface_register(conn, path, desc, EINA_FALSE, 1u);
1000}
1001
1002EAPI Eldbus_Service_Interface *
1003eldbus_service_interface_register2(Eldbus_Connection *conn, const char *path, const Eldbus_Service_Interface_Desc2 *desc)
1004{
1005 return _eldbus_service_interface_register(conn, path, &desc->description, EINA_FALSE, desc->version);
996} 1006}
997 1007
998EAPI Eldbus_Service_Interface * 1008EAPI Eldbus_Service_Interface *
999eldbus_service_interface_fallback_register(Eldbus_Connection *conn, const char *path, const Eldbus_Service_Interface_Desc *desc) 1009eldbus_service_interface_fallback_register(Eldbus_Connection *conn, const char *path, const Eldbus_Service_Interface_Desc *desc)
1000{ 1010{
1001 return _eldbus_service_interface_register(conn, path, desc, EINA_TRUE); 1011 return _eldbus_service_interface_register(conn, path, desc, EINA_TRUE, 1u);
1012}
1013
1014EAPI Eldbus_Service_Interface *
1015eldbus_service_interface_fallback_register2(Eldbus_Connection *conn, const char *path, const Eldbus_Service_Interface_Desc2 *desc)
1016{
1017 return _eldbus_service_interface_register(conn, path, &desc->description, EINA_TRUE, desc->version);
1002} 1018}
1003 1019
1004static Eina_Bool 1020static Eina_Bool