cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=5c9f45fe809d86b53e393341637180e074247f4a

commit 5c9f45fe809d86b53e393341637180e074247f4a
Author: Mike Blumenkrantz <[email protected]>
Date:   Fri Mar 23 13:50:06 2018 -0400

    ecore-con-eet: replace void_ptr usage with binbuf in eo api
    
    Reviewed-by: Cedric Bail <[email protected]>
---
 src/lib/ecore_con/ecore_con_eet.c       | 14 ++++++++++++--
 src/lib/ecore_con/ecore_con_eet_base.eo |  3 +--
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/lib/ecore_con/ecore_con_eet.c 
b/src/lib/ecore_con/ecore_con_eet.c
index 134d691f4c..4fa79b7736 100644
--- a/src/lib/ecore_con/ecore_con_eet.c
+++ b/src/lib/ecore_con/ecore_con_eet.c
@@ -535,18 +535,26 @@ _ecore_con_eet_base_send(Eo *obj EINA_UNUSED, 
Ecore_Con_Eet_Base_Data *pd, Ecore
 }
 
 EOLIAN static void
-_ecore_con_eet_base_raw_send(Eo *obj EINA_UNUSED, Ecore_Con_Eet_Base_Data *pd, 
Ecore_Con_Reply *reply, const char *protocol_name, const char *section, void 
*value, unsigned int length)
+_ecore_con_eet_base_raw_send(Eo *obj EINA_UNUSED, Ecore_Con_Eet_Base_Data *pd, 
Ecore_Con_Reply *reply, const char *protocol_name, const char *section, 
Eina_Binbuf *section_data)
 {
    unsigned int protocol[4];
    unsigned int protocol_length;
    unsigned int section_length;
    unsigned int size;
+   unsigned int length = 0;
+   const void *value = NULL;
    char *tmp;
 
    if (!reply) return;
    if (!protocol_name) return;
    if (!section) return;
 
+   if (section_data)
+     {
+        length = eina_binbuf_length_get(section_data);
+        value = eina_binbuf_string_get(section_data);
+     }
+
    protocol_length = strlen(protocol_name) + 1;
    if (protocol_length == 1) return;
    section_length = strlen(section) + 1;
@@ -946,7 +954,9 @@ ecore_con_eet_send(Ecore_Con_Reply *reply, const char 
*name, void *value)
 EAPI void
 ecore_con_eet_raw_send(Ecore_Con_Reply *reply, const char *protocol_name, 
const char *section, void *value, unsigned int length)
 {
-   ecore_con_eet_base_raw_send(reply->ece, reply, protocol_name, section, 
value, length);
+   Eina_Binbuf *buf = eina_binbuf_manage_new(value, length, 1);
+   ecore_con_eet_base_raw_send(reply->ece, reply, protocol_name, section, buf);
+   eina_binbuf_free(buf);
 }
 
 #include "ecore_con_eet_base.eo.c"
diff --git a/src/lib/ecore_con/ecore_con_eet_base.eo 
b/src/lib/ecore_con/ecore_con_eet_base.eo
index 8c5b3a554f..76bdb3aeca 100644
--- a/src/lib/ecore_con/ecore_con_eet_base.eo
+++ b/src/lib/ecore_con/ecore_con_eet_base.eo
@@ -83,8 +83,7 @@ class Ecore.Con.Eet.Base (Efl.Object) {
                                            to which the data has to be sent.]]
             protocol_name: string; [[The name of the eet stream.]]
             section: string; [[Name of section in the eet descriptor.]]
-            value: void_ptr; [[The value of the section.]]
-            length: uint; [[The length of the data that is being sent.]]
+            section_data: ptr(Eina.Binbuf);
          }
       }
    }

-- 


Reply via email to