edbus: rename functions edbus_message{_iter,}_arguments_set

Rename these functions since they do not set the data in the
iterator/message but rather they append the data.

Also improve the documentation of edbus_message_iter_arguments_append()
to clarify its usage.



SVN revision: 81295
This commit is contained in:
Lucas De Marchi 2012-12-18 20:05:02 +00:00
parent e3ae81e65f
commit b98d5f16b3
9 changed files with 82 additions and 78 deletions

View File

@ -214,13 +214,13 @@ main(void)
msg = edbus_proxy_method_call_new(test2_proxy, "ReceiveArrayOfStringIntWithSize"); msg = edbus_proxy_method_call_new(test2_proxy, "ReceiveArrayOfStringIntWithSize");
iter = edbus_message_iter_get(msg); iter = edbus_message_iter_get(msg);
if (!edbus_message_iter_arguments_set(iter, "ia(si)", size_of_array, &array_of_string)) if (!edbus_message_iter_arguments_append(iter, "ia(si)", size_of_array, &array_of_string))
printf("error on edbus_massage_iterator_arguments_set()\n\n"); printf("error on edbus_massage_iterator_arguments_set()\n\n");
for (i = 0; i < size_of_array; i++) for (i = 0; i < size_of_array; i++)
{ {
EDBus_Message_Iter *struct_of_si; EDBus_Message_Iter *struct_of_si;
edbus_message_iter_arguments_set(array_of_string, "(si)", &struct_of_si); edbus_message_iter_arguments_append(array_of_string, "(si)", &struct_of_si);
edbus_message_iter_arguments_set(struct_of_si, "si", array[i], i); edbus_message_iter_arguments_append(struct_of_si, "si", array[i], i);
edbus_message_iter_container_close(array_of_string, struct_of_si); edbus_message_iter_container_close(array_of_string, struct_of_si);
} }
edbus_message_iter_container_close(iter, array_of_string); edbus_message_iter_container_close(iter, array_of_string);
@ -242,19 +242,19 @@ main(void)
* this will cause a error, we could not open another container until * this will cause a error, we could not open another container until
* we close the first one * we close the first one
*/ */
edbus_message_iter_arguments_set(iter, "a(ii)", &array_itr); edbus_message_iter_arguments_append(iter, "a(ii)", &array_itr);
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
{ {
edbus_message_iter_arguments_set(array_itr, "(ii)", &structure); edbus_message_iter_arguments_append(array_itr, "(ii)", &structure);
edbus_message_iter_arguments_set(structure, "ii", i, i*i); edbus_message_iter_arguments_append(structure, "ii", i, i*i);
edbus_message_iter_container_close(array_itr, structure); edbus_message_iter_container_close(array_itr, structure);
} }
edbus_message_iter_container_close(iter, array_itr); edbus_message_iter_container_close(iter, array_itr);
edbus_message_iter_arguments_set(iter, "a(ii)", &array_itr); edbus_message_iter_arguments_append(iter, "a(ii)", &array_itr);
for (i = 0; i < 7; i++) for (i = 0; i < 7; i++)
{ {
edbus_message_iter_arguments_set(array_itr, "(ii)", &structure); edbus_message_iter_arguments_append(array_itr, "(ii)", &structure);
edbus_message_iter_arguments_set(structure, "ii", i, i*i*i); edbus_message_iter_arguments_append(structure, "ii", i, i*i*i);
edbus_message_iter_container_close(array_itr, structure); edbus_message_iter_container_close(array_itr, structure);
} }
edbus_message_iter_container_close(iter, array_itr); edbus_message_iter_container_close(iter, array_itr);

View File

@ -71,11 +71,11 @@ _receive_variant(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
main_iter = edbus_message_iter_get(reply); main_iter = edbus_message_iter_get(reply);
var = edbus_message_iter_container_new(main_iter, 'v', "as"); var = edbus_message_iter_container_new(main_iter, 'v', "as");
edbus_message_iter_arguments_set(var, "as", &array); edbus_message_iter_arguments_append(var, "as", &array);
edbus_message_iter_arguments_set(array, "s", "item1"); edbus_message_iter_arguments_append(array, "s", "item1");
edbus_message_iter_arguments_set(array, "s", "item2"); edbus_message_iter_arguments_append(array, "s", "item2");
edbus_message_iter_arguments_set(array, "s", "item3"); edbus_message_iter_arguments_append(array, "s", "item3");
edbus_message_iter_container_close(var, array); edbus_message_iter_container_close(var, array);
edbus_message_iter_container_close(main_iter, var); edbus_message_iter_container_close(main_iter, var);
@ -146,7 +146,7 @@ _send_array_int(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
iter = edbus_message_iter_get(reply); iter = edbus_message_iter_get(reply);
array = edbus_message_iter_container_new(iter, 'a', "i"); array = edbus_message_iter_container_new(iter, 'a', "i");
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
edbus_message_iter_arguments_set(array, "i", i); edbus_message_iter_arguments_append(array, "i", i);
edbus_message_iter_container_close(iter, array); edbus_message_iter_container_close(iter, array);
return reply; return reply;
@ -165,7 +165,7 @@ _send_array(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
iter = edbus_message_iter_get(reply); iter = edbus_message_iter_get(reply);
array = edbus_message_iter_container_new(iter, 'a', "s"); array = edbus_message_iter_container_new(iter, 'a', "s");
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
edbus_message_iter_arguments_set(array, "s", array_string[i]); edbus_message_iter_arguments_append(array, "s", array_string[i]);
edbus_message_iter_container_close(iter, array); edbus_message_iter_container_close(iter, array);
return reply; return reply;
@ -184,7 +184,7 @@ _plus_one(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
return reply; return reply;
} }
num++; num++;
edbus_message_arguments_set(reply, "i", num); edbus_message_arguments_append(reply, "i", num);
return reply; return reply;
} }
@ -229,14 +229,14 @@ _properties_get(const EDBus_Service_Interface *iface, const char *propname, EDBu
edbus_message_iter_basic_append(iter, 's', "lalalala"); edbus_message_iter_basic_append(iter, 's', "lalalala");
else if (!strcmp(propname, "int32")) else if (!strcmp(propname, "int32"))
{ {
edbus_message_iter_arguments_set(iter, "i", int32); edbus_message_iter_arguments_append(iter, "i", int32);
int32++; int32++;
} }
else if (!strcmp(propname, "st")) else if (!strcmp(propname, "st"))
{ {
EDBus_Message_Iter *st; EDBus_Message_Iter *st;
edbus_message_iter_arguments_set(iter, "(ss)", &st); edbus_message_iter_arguments_append(iter, "(ss)", &st);
edbus_message_iter_arguments_set(st, "ss", "string1", "string2"); edbus_message_iter_arguments_append(st, "ss", "string1", "string2");
edbus_message_iter_container_close(iter, st); edbus_message_iter_container_close(iter, st);
} }
return EINA_TRUE; return EINA_TRUE;

View File

@ -12,7 +12,7 @@ static EDBus_Message *
_hello(const EDBus_Service_Interface *iface, const EDBus_Message *message) _hello(const EDBus_Service_Interface *iface, const EDBus_Message *message)
{ {
EDBus_Message *reply = edbus_message_method_return_new(message); EDBus_Message *reply = edbus_message_method_return_new(message);
edbus_message_arguments_set(reply, "s", "Hello World"); edbus_message_arguments_append(reply, "s", "Hello World");
printf("Hello\n"); printf("Hello\n");
return reply; return reply;
} }
@ -54,7 +54,7 @@ _send_bool(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
Eina_Bool bool; Eina_Bool bool;
if (!edbus_message_arguments_get(msg, "b", &bool)) if (!edbus_message_arguments_get(msg, "b", &bool))
printf("edbus_message_arguments_get() error\n"); printf("edbus_message_arguments_get() error\n");
edbus_message_arguments_set(reply, "b", bool); edbus_message_arguments_append(reply, "b", bool);
return reply; return reply;
} }
@ -65,7 +65,7 @@ _send_byte(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
unsigned char byte; unsigned char byte;
if (!edbus_message_arguments_get(msg, "y", &byte)) if (!edbus_message_arguments_get(msg, "y", &byte))
printf("edbus_message_arguments_get() error\n"); printf("edbus_message_arguments_get() error\n");
edbus_message_arguments_set(reply, "y", byte); edbus_message_arguments_append(reply, "y", byte);
return reply; return reply;
} }
@ -76,7 +76,7 @@ _send_uint32(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
unsigned int uint32; unsigned int uint32;
if (!edbus_message_arguments_get(msg, "u", &uint32)) if (!edbus_message_arguments_get(msg, "u", &uint32))
printf("edbus_message_arguments_get() error\n"); printf("edbus_message_arguments_get() error\n");
edbus_message_arguments_set(reply, "u", uint32); edbus_message_arguments_append(reply, "u", uint32);
return reply; return reply;
} }
@ -87,7 +87,7 @@ _send_int32(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
int int32; int int32;
if (!edbus_message_arguments_get(msg, "i", &int32)) if (!edbus_message_arguments_get(msg, "i", &int32))
printf("edbus_message_arguments_get() error\n"); printf("edbus_message_arguments_get() error\n");
edbus_message_arguments_set(reply, "i", int32); edbus_message_arguments_append(reply, "i", int32);
return reply; return reply;
} }
@ -98,7 +98,7 @@ _send_int16(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
short int int16; short int int16;
if (!edbus_message_arguments_get(msg, "n", &int16)) if (!edbus_message_arguments_get(msg, "n", &int16))
printf("edbus_message_arguments_get() error\n"); printf("edbus_message_arguments_get() error\n");
edbus_message_arguments_set(reply, "n", int16); edbus_message_arguments_append(reply, "n", int16);
return reply; return reply;
} }
@ -109,7 +109,7 @@ _send_double(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
double d; double d;
if (!edbus_message_arguments_get(msg, "d", &d)) if (!edbus_message_arguments_get(msg, "d", &d))
printf("edbus_message_arguments_get() error\n"); printf("edbus_message_arguments_get() error\n");
edbus_message_arguments_set(reply, "d", d); edbus_message_arguments_append(reply, "d", d);
return reply; return reply;
} }
@ -120,7 +120,7 @@ _send_string(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
const char *txt; const char *txt;
if (!edbus_message_arguments_get(msg, "s", &txt)) if (!edbus_message_arguments_get(msg, "s", &txt))
printf("edbus_message_arguments_get() error\n"); printf("edbus_message_arguments_get() error\n");
edbus_message_arguments_set(reply, "s", txt); edbus_message_arguments_append(reply, "s", txt);
return reply; return reply;
} }
@ -128,7 +128,7 @@ static Eina_Bool
_resp_async(void *data) _resp_async(void *data)
{ {
EDBus_Message *msg = data; EDBus_Message *msg = data;
edbus_message_arguments_set(msg, "s", "Async test ok"); edbus_message_arguments_append(msg, "s", "Async test ok");
edbus_connection_send(conn, msg, NULL, NULL, -1); edbus_connection_send(conn, msg, NULL, NULL, -1);
edbus_message_unref(msg); edbus_message_unref(msg);
return ECORE_CALLBACK_CANCEL; return ECORE_CALLBACK_CANCEL;

View File

@ -36,7 +36,7 @@ static void emit_properties(EDBus_Service_Interface *iface)
{ {
EDBus_Message_Iter *entry = edbus_message_iter_container_new(dict, 'e', EDBus_Message_Iter *entry = edbus_message_iter_container_new(dict, 'e',
NULL); NULL);
edbus_message_iter_arguments_set(entry, "ss", k->key, k->val); edbus_message_iter_arguments_append(entry, "ss", k->key, k->val);
edbus_message_iter_container_close(dict, entry); edbus_message_iter_container_close(dict, entry);
} }

View File

@ -274,7 +274,7 @@ edbus_message_arguments_vget(const EDBus_Message *msg, const char *signature, va
} }
EAPI Eina_Bool EAPI Eina_Bool
edbus_message_iter_arguments_vset(EDBus_Message_Iter *iter, const char *signature, va_list ap) edbus_message_iter_arguments_vappend(EDBus_Message_Iter *iter, const char *signature, va_list ap)
{ {
DBusSignatureIter signature_iter; DBusSignatureIter signature_iter;
Eina_Bool r = EINA_TRUE; Eina_Bool r = EINA_TRUE;
@ -314,7 +314,7 @@ edbus_message_iter_arguments_vset(EDBus_Message_Iter *iter, const char *signatur
else if (type[1] == DBUS_TYPE_VARIANT) else if (type[1] == DBUS_TYPE_VARIANT)
{ {
ERR("variant not supported by \ ERR("variant not supported by \
edbus_message_iter_arguments_set(), \ edbus_message_iter_arguments_append(), \
try edbus_message_iter_container_new()"); try edbus_message_iter_container_new()");
r = EINA_FALSE; r = EINA_FALSE;
goto next; goto next;
@ -343,7 +343,7 @@ next:
} }
EAPI Eina_Bool EAPI Eina_Bool
edbus_message_iter_arguments_set(EDBus_Message_Iter *iter, const char *signature, ...) edbus_message_iter_arguments_append(EDBus_Message_Iter *iter, const char *signature, ...)
{ {
Eina_Bool r; Eina_Bool r;
va_list ap; va_list ap;
@ -351,7 +351,7 @@ edbus_message_iter_arguments_set(EDBus_Message_Iter *iter, const char *signature
EINA_SAFETY_ON_NULL_RETURN_VAL(signature, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(signature, EINA_FALSE);
va_start(ap, signature); va_start(ap, signature);
r = edbus_message_iter_arguments_vset(iter, signature, ap); r = edbus_message_iter_arguments_vappend(iter, signature, ap);
va_end(ap); va_end(ap);
return r; return r;
} }
@ -422,7 +422,7 @@ append_basic(char type, va_list *vl, DBusMessageIter *iter)
} }
static Eina_Bool static Eina_Bool
_edbus_message_arguments_vset(EDBus_Message *msg, const char *signature, va_list ap) _edbus_message_arguments_vappend(EDBus_Message *msg, const char *signature, va_list ap)
{ {
DBusSignatureIter signature_iter; DBusSignatureIter signature_iter;
EDBus_Message_Iter *iter; EDBus_Message_Iter *iter;
@ -444,8 +444,8 @@ _edbus_message_arguments_vset(EDBus_Message *msg, const char *signature, va_list
&iter->dbus_iterator); &iter->dbus_iterator);
else else
{ {
ERR("sig = %s | edbus_message_arguments_set() and \ ERR("sig = %s | edbus_message_arguments_append() and \
edbus_message_arguments_vset() only support basic types, \ edbus_message_arguments_vappend() only support basic types, \
to complex types use edbus_message_iter_* functions", to complex types use edbus_message_iter_* functions",
signature); signature);
r = EINA_FALSE; r = EINA_FALSE;
@ -459,7 +459,7 @@ _edbus_message_arguments_vset(EDBus_Message *msg, const char *signature, va_list
} }
EAPI Eina_Bool EAPI Eina_Bool
edbus_message_arguments_set(EDBus_Message *msg, const char *signature, ...) edbus_message_arguments_append(EDBus_Message *msg, const char *signature, ...)
{ {
Eina_Bool ret; Eina_Bool ret;
va_list ap; va_list ap;
@ -468,17 +468,17 @@ edbus_message_arguments_set(EDBus_Message *msg, const char *signature, ...)
EINA_SAFETY_ON_NULL_RETURN_VAL(signature, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(signature, EINA_FALSE);
va_start(ap, signature); va_start(ap, signature);
ret = _edbus_message_arguments_vset(msg, signature, ap); ret = _edbus_message_arguments_vappend(msg, signature, ap);
va_end(ap); va_end(ap);
return ret; return ret;
} }
EAPI Eina_Bool EAPI Eina_Bool
edbus_message_arguments_vset(EDBus_Message *msg, const char *signature, va_list ap) edbus_message_arguments_vappend(EDBus_Message *msg, const char *signature, va_list ap)
{ {
EDBUS_MESSAGE_CHECK_RETVAL(msg, EINA_FALSE); EDBUS_MESSAGE_CHECK_RETVAL(msg, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(signature, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(signature, EINA_FALSE);
return _edbus_message_arguments_vset(msg, signature, ap); return _edbus_message_arguments_vappend(msg, signature, ap);
} }
EAPI EDBus_Message_Iter * EAPI EDBus_Message_Iter *

View File

@ -94,7 +94,7 @@ EAPI Eina_Bool edbus_message_arguments_vget(const EDBus_Message *msg
* This function only supports basic type, for complex types use * This function only supports basic type, for complex types use
* edbus_message_iter_* functions. * edbus_message_iter_* functions.
*/ */
EAPI Eina_Bool edbus_message_arguments_set(EDBus_Message *msg, const char *signature, ...) EINA_ARG_NONNULL(1, 2); EAPI Eina_Bool edbus_message_arguments_append(EDBus_Message *msg, const char *signature, ...) EINA_ARG_NONNULL(1, 2);
/** /**
* @brief Set data to EDBus_Message. * @brief Set data to EDBus_Message.
@ -102,7 +102,7 @@ EAPI Eina_Bool edbus_message_arguments_set(EDBus_Message *msg, const
* This function only supports basic types, for complex types use * This function only supports basic types, for complex types use
* edbus_message_iter_* functions. * edbus_message_iter_* functions.
*/ */
EAPI Eina_Bool edbus_message_arguments_vset(EDBus_Message *msg, const char *signature, va_list ap) EINA_ARG_NONNULL(1, 2); EAPI Eina_Bool edbus_message_arguments_vappend(EDBus_Message *msg, const char *signature, va_list ap) EINA_ARG_NONNULL(1, 2);
/** /**
* @defgroup EDBus_Message_Iter Iterator * @defgroup EDBus_Message_Iter Iterator
@ -110,7 +110,7 @@ EAPI Eina_Bool edbus_message_arguments_vset(EDBus_Message *msg, cons
*/ */
/** /**
* @brief Create and appends a typed iterator to another iterator. * @brief Create and append a typed iterator to another iterator.
* *
* After append data to returned iterator it must be closed calling * After append data to returned iterator it must be closed calling
* edbus_message_iter_container_close(). * edbus_message_iter_container_close().
@ -130,29 +130,33 @@ EAPI Eina_Bool edbus_message_arguments_vset(EDBus_Message *msg, cons
EAPI EDBus_Message_Iter *edbus_message_iter_container_new(EDBus_Message_Iter *iter, int type, const char* contained_signature) EINA_ARG_NONNULL(1, 3) EINA_WARN_UNUSED_RESULT; EAPI EDBus_Message_Iter *edbus_message_iter_container_new(EDBus_Message_Iter *iter, int type, const char* contained_signature) EINA_ARG_NONNULL(1, 3) EINA_WARN_UNUSED_RESULT;
/** /**
* @brief Append a basic type to EDBus_Iterator. * @brief Append a basic type into an EDBus_Iterator.
*/ */
EAPI Eina_Bool edbus_message_iter_basic_append(EDBus_Message_Iter *iter, int type, ...) EINA_ARG_NONNULL(1, 3); EAPI Eina_Bool edbus_message_iter_basic_append(EDBus_Message_Iter *iter, int type, ...) EINA_ARG_NONNULL(1, 3);
/** /**
* @brief Set data to EDBus_Message_Iter. For each complete in signature * @brief Append an argument into an EDBus_Message_Iter. For each complete type
* you need pass the value, in case of complex type a pointer to be allocated a * you need to provide the correspondent value. In case of complex types you
* EDBus_Message_Iter that you need fill and close. * need to provide an EDBus_Message_Iter** to be allocated and then filled in.
* *
* It's not possible open two iterators at same Iterator. Example: * It's not possible to open two iterators at same iterator with this function.
* "aiai", to set this you need create and put the first array with * For example, to create a message with signature="aiai" you need to create the
* edbus_message_iter_container_new() fill array with data and close then * first container with edbus_message_iter_container_new(), fill the array,
* you could open the second array with edbus_message_iter_container_new(). * close it with edbus_message_iter_container_close() and then do the same for
* the second array.
* *
* @param iter iterator * @param iter iterator in which data will be appended
* @param signature of data * @param signature signature of the contained data
* @param ... values * @param ... values for each complete type
* *
* @note This function don't support variant, use instead * @see edbus_message_iter_container_new()
* edbus_message_iter_container_new() to create the variant fill * @see edbus_message_iter_container_close()
* data and close it.. *
* @note This function doesn't support variant, use
* edbus_message_iter_container_new() instead to create the variant, fill
* with data and close it.
*/ */
EAPI Eina_Bool edbus_message_iter_arguments_set(EDBus_Message_Iter *iter, const char *signature, ...) EINA_ARG_NONNULL(1, 2); EAPI Eina_Bool edbus_message_iter_arguments_append(EDBus_Message_Iter *iter, const char *signature, ...) EINA_ARG_NONNULL(1, 2);
/** /**
* @brief Set data to EDBus_Message_Iter. For each complete in signature * @brief Set data to EDBus_Message_Iter. For each complete in signature
@ -172,7 +176,7 @@ EAPI Eina_Bool edbus_message_iter_arguments_set(EDBus_Message_Iter
* edbus_message_iter_container_new() to create the variant fill * edbus_message_iter_container_new() to create the variant fill
* data and close it. * data and close it.
*/ */
EAPI Eina_Bool edbus_message_iter_arguments_vset(EDBus_Message_Iter *iter, const char *signature, va_list ap) EINA_ARG_NONNULL(1, 2, 3); EAPI Eina_Bool edbus_message_iter_arguments_vappend(EDBus_Message_Iter *iter, const char *signature, va_list ap) EINA_ARG_NONNULL(1, 2, 3);
/** /**
* @brief Closes a container-typed value appended to the message. * @brief Closes a container-typed value appended to the message.

View File

@ -49,7 +49,7 @@ _array_append(const char *type, const Eina_Value *value_array, EDBus_Message_Ite
EDBus_Message_Iter *array; EDBus_Message_Iter *array;
EINA_SAFETY_ON_FALSE_RETURN_VAL( EINA_SAFETY_ON_FALSE_RETURN_VAL(
edbus_message_iter_arguments_set(iter, type, &array), EINA_FALSE); edbus_message_iter_arguments_append(iter, type, &array), EINA_FALSE);
DBG("array of type %c", type[1]); DBG("array of type %c", type[1]);
switch (type[1]) switch (type[1])
{ {
@ -66,7 +66,7 @@ _array_append(const char *type, const Eina_Value *value_array, EDBus_Message_Ite
Eina_Value st; Eina_Value st;
EDBus_Message_Iter *entry; EDBus_Message_Iter *entry;
eina_value_array_value_get(value_array, i, &st); eina_value_array_value_get(value_array, i, &st);
edbus_message_iter_arguments_set(array, type+1, &entry); edbus_message_iter_arguments_append(array, type+1, &entry);
_message_iter_from_eina_value_struct(entry_sig, entry, &st); _message_iter_from_eina_value_struct(entry_sig, entry, &st);
edbus_message_iter_container_close(array, entry); edbus_message_iter_container_close(array, entry);
eina_value_flush(&st); eina_value_flush(&st);
@ -82,7 +82,7 @@ _array_append(const char *type, const Eina_Value *value_array, EDBus_Message_Ite
Eina_Value inner_array; Eina_Value inner_array;
EDBus_Message_Iter *sub_array; EDBus_Message_Iter *sub_array;
eina_value_array_value_get(value_array, i, &inner_array); eina_value_array_value_get(value_array, i, &inner_array);
edbus_message_iter_arguments_set(array, type+1, &sub_array); edbus_message_iter_arguments_append(array, type+1, &sub_array);
_array_append(type+1, &inner_array, sub_array); _array_append(type+1, &inner_array, sub_array);
edbus_message_iter_container_close(array, sub_array); edbus_message_iter_container_close(array, sub_array);
eina_value_flush(&inner_array); eina_value_flush(&inner_array);
@ -333,7 +333,7 @@ _message_iter_from_eina_value_struct(const char *signature, EDBus_Message_Iter *
_compatible_type(type[0], st.desc->members[i].type), _compatible_type(type[0], st.desc->members[i].type),
EINA_FALSE); EINA_FALSE);
eina_value_struct_value_get(value, st.desc->members[i].name, &inner_st); eina_value_struct_value_get(value, st.desc->members[i].name, &inner_st);
edbus_message_iter_arguments_set(iter, type, &sub_iter); edbus_message_iter_arguments_append(iter, type, &sub_iter);
r = _message_iter_from_eina_value_struct(sub_sig, sub_iter, r = _message_iter_from_eina_value_struct(sub_sig, sub_iter,
&inner_st); &inner_st);
edbus_message_iter_container_close(iter, sub_iter); edbus_message_iter_container_close(iter, sub_iter);

View File

@ -543,7 +543,7 @@ _edbus_proxy_vcall(EDBus_Proxy *proxy, const char *member, EDBus_Message_Cb cb,
EDBus_Message *msg = edbus_proxy_method_call_new(proxy, member); EDBus_Message *msg = edbus_proxy_method_call_new(proxy, member);
EINA_SAFETY_ON_NULL_RETURN_VAL(msg, NULL); EINA_SAFETY_ON_NULL_RETURN_VAL(msg, NULL);
if (!edbus_message_arguments_vset(msg, signature, ap)) if (!edbus_message_arguments_vappend(msg, signature, ap))
{ {
edbus_message_unref(msg); edbus_message_unref(msg);
ERR("Error setting arguments"); ERR("Error setting arguments");

View File

@ -251,7 +251,7 @@ _props_getall(EDBus_Service_Interface *iface, Eina_Iterator *iterator, EDBus_Mes
if (!getter || prop->is_invalidate) if (!getter || prop->is_invalidate)
continue; continue;
if (!edbus_message_iter_arguments_set(dict, "{sv}", &entry)) if (!edbus_message_iter_arguments_append(dict, "{sv}", &entry))
continue; continue;
edbus_message_iter_basic_append(entry, 's', prop->property->name); edbus_message_iter_basic_append(entry, 's', prop->property->name);
@ -289,7 +289,7 @@ _cb_property_getall(const EDBus_Service_Interface *piface, const EDBus_Message *
reply = edbus_message_method_return_new(msg); reply = edbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(reply, NULL); EINA_SAFETY_ON_NULL_RETURN_VAL(reply, NULL);
main_iter = edbus_message_iter_get(reply); main_iter = edbus_message_iter_get(reply);
if (!edbus_message_iter_arguments_set(main_iter, "a{sv}", &dict)) if (!edbus_message_iter_arguments_append(main_iter, "a{sv}", &dict))
{ {
edbus_message_unref(reply); edbus_message_unref(reply);
return NULL; return NULL;
@ -386,7 +386,7 @@ cb_introspect(const EDBus_Service_Interface *_iface, const EDBus_Message *messag
obj->introspection_dirty = EINA_FALSE; obj->introspection_dirty = EINA_FALSE;
} }
edbus_message_arguments_set(reply, "s", eina_strbuf_string_get(obj->introspection_data)); edbus_message_arguments_append(reply, "s", eina_strbuf_string_get(obj->introspection_data));
return reply; return reply;
} }
@ -480,9 +480,9 @@ _propmgr_iface_props_append(EDBus_Service_Interface *iface, EDBus_Message_Iter *
Eina_Iterator *iterator; Eina_Iterator *iterator;
EDBus_Message *error_msg; EDBus_Message *error_msg;
edbus_message_iter_arguments_set(array, "{sa{sv}}", &iface_entry); edbus_message_iter_arguments_append(array, "{sa{sv}}", &iface_entry);
edbus_message_iter_arguments_set(iface_entry, "sa{sv}", iface->name, &props_array); edbus_message_iter_arguments_append(iface_entry, "sa{sv}", iface->name, &props_array);
iterator = eina_hash_iterator_data_new(iface->properties); iterator = eina_hash_iterator_data_new(iface->properties);
if (!_props_getall(iface, iterator, props_array, NULL, &error_msg)) if (!_props_getall(iface, iterator, props_array, NULL, &error_msg))
{ {
@ -508,8 +508,8 @@ _managed_obj_append(EDBus_Service_Object *obj, EDBus_Message_Iter *array, Eina_B
if (first) goto foreach; if (first) goto foreach;
if (obj->has_objectmanager) return EINA_TRUE; if (obj->has_objectmanager) return EINA_TRUE;
edbus_message_iter_arguments_set(array, "{oa{sa{sv}}}", &obj_entry); edbus_message_iter_arguments_append(array, "{oa{sa{sv}}}", &obj_entry);
edbus_message_iter_arguments_set(obj_entry, "oa{sa{sv}}", obj->path, edbus_message_iter_arguments_append(obj_entry, "oa{sa{sv}}", obj->path,
&array_interface); &array_interface);
iface_iter = eina_hash_iterator_data_new(obj->interfaces); iface_iter = eina_hash_iterator_data_new(obj->interfaces);
EINA_ITERATOR_FOREACH(iface_iter, children_iface) EINA_ITERATOR_FOREACH(iface_iter, children_iface)
@ -544,7 +544,7 @@ _cb_managed_objects(const EDBus_Service_Interface *iface, const EDBus_Message *m
EINA_SAFETY_ON_NULL_RETURN_VAL(reply, NULL); EINA_SAFETY_ON_NULL_RETURN_VAL(reply, NULL);
main_iter = edbus_message_iter_get(reply); main_iter = edbus_message_iter_get(reply);
edbus_message_iter_arguments_set(main_iter, "a{oa{sa{sv}}}", &array_path); edbus_message_iter_arguments_append(main_iter, "a{oa{sa{sv}}}", &array_path);
ret = _managed_obj_append(iface->obj, array_path, EINA_TRUE); ret = _managed_obj_append(iface->obj, array_path, EINA_TRUE);
if (!ret) if (!ret)
@ -730,7 +730,7 @@ _iface_changed_send(void *data)
continue; continue;
} }
main_iter = edbus_message_iter_get(msg); main_iter = edbus_message_iter_get(msg);
edbus_message_iter_arguments_set(main_iter, "oa{sa{sv}}", edbus_message_iter_arguments_append(main_iter, "oa{sa{sv}}",
iface->obj->path, &array_iface); iface->obj->path, &array_iface);
if (!_propmgr_iface_props_append(iface, array_iface)) if (!_propmgr_iface_props_append(iface, array_iface))
goto error; goto error;
@ -769,7 +769,7 @@ error:
EINA_SAFETY_ON_NULL_GOTO(msg, error2); EINA_SAFETY_ON_NULL_GOTO(msg, error2);
main_iter = edbus_message_iter_get(msg); main_iter = edbus_message_iter_get(msg);
edbus_message_iter_arguments_set(main_iter, "oas", iface_data->obj_path, edbus_message_iter_arguments_append(main_iter, "oas", iface_data->obj_path,
&array_iface); &array_iface);
edbus_message_iter_basic_append(array_iface, 's', iface_data->iface); edbus_message_iter_basic_append(array_iface, 's', iface_data->iface);
@ -1242,7 +1242,7 @@ edbus_service_signal_emit(const EDBus_Service_Interface *iface, unsigned int sig
signature = eina_array_data_get(iface->sign_of_signals, signal_id); signature = eina_array_data_get(iface->sign_of_signals, signal_id);
va_start(ap, signal_id); va_start(ap, signal_id);
r = edbus_message_arguments_vset(sig, signature, ap); r = edbus_message_arguments_vappend(sig, signature, ap);
va_end(ap); va_end(ap);
EINA_SAFETY_ON_FALSE_RETURN_VAL(r, EINA_FALSE); EINA_SAFETY_ON_FALSE_RETURN_VAL(r, EINA_FALSE);
@ -1302,7 +1302,7 @@ _idler_propschanged(void *data)
EINA_SAFETY_ON_NULL_GOTO(msg, error); EINA_SAFETY_ON_NULL_GOTO(msg, error);
main_iter = edbus_message_iter_get(msg); main_iter = edbus_message_iter_get(msg);
if (!edbus_message_iter_arguments_set(main_iter, "sa{sv}", iface->name, &dict)) if (!edbus_message_iter_arguments_append(main_iter, "sa{sv}", iface->name, &dict))
{ {
edbus_message_unref(msg); edbus_message_unref(msg);
goto error; goto error;
@ -1330,7 +1330,7 @@ _idler_propschanged(void *data)
continue; continue;
EINA_SAFETY_ON_FALSE_GOTO( EINA_SAFETY_ON_FALSE_GOTO(
edbus_message_iter_arguments_set(dict, "{sv}", &entry), error); edbus_message_iter_arguments_append(dict, "{sv}", &entry), error);
edbus_message_iter_basic_append(entry, 's', prop->property->name); edbus_message_iter_basic_append(entry, 's', prop->property->name);
var = edbus_message_iter_container_new(entry, 'v', var = edbus_message_iter_container_new(entry, 'v',
@ -1355,7 +1355,7 @@ _idler_propschanged(void *data)
invalidate: invalidate:
edbus_message_iter_container_close(main_iter, dict); edbus_message_iter_container_close(main_iter, dict);
edbus_message_iter_arguments_set(main_iter, "as", &array_invalidate); edbus_message_iter_arguments_append(main_iter, "as", &array_invalidate);
if (!iface->prop_invalidated) if (!iface->prop_invalidated)
goto end; goto end;