ecore-con-eet: replace void_ptr usage with binbuf in eo api

Reviewed-by: Cedric Bail <cedric@osg.samsung.com>
This commit is contained in:
Mike Blumenkrantz 2018-03-23 13:50:06 -04:00 committed by Cedric Bail
parent 07d54832e5
commit 5c9f45fe80
2 changed files with 13 additions and 4 deletions

View File

@ -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"

View File

@ -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);
}
}
}