Commit Graph

13 Commits

Author SHA1 Message Date
Lucas De Marchi ada326a184 edbus: avoid using dbus_signature_iter_get_signature when not needed
SVN revision: 81174
2012-12-17 18:24:54 +00:00
Lucas De Marchi e53c47bcf0 edbus: Let arguments_get fail if getting less args than passed
If user passed a string with more elements, return EINA_FALSE on
edbus_message_arguments_get() so he knows not all elements are
initialized. Before this patch, we would notify user of its error if he
did something like:

	i) edbus_message_arguments_get(msg, "uu", &a)
	ii) edbus_message_arguments_get(msg, "uu", &a, &b)

And "msg" containing only 1 argument.

This also fixes the case in which user is getting the elements of an
array iterator and the array is empty. We were previously returning
EINA_TRUE, even if we were not filling the variable.

Last but not least, if the user was calling
edbus_message_iter_arguments_get() in an empty array, we would return
EINA_FALSE, even if we didn't actually get any element.



SVN revision: 81170
2012-12-17 18:24:31 +00:00
Lucas De Marchi 7a2a31a436 edbus: do not use dbus_signature_iter_get_signature in edbus_message_iter_arguments_vget
we are only interested in the first char of the signature so we can use
dbus_signature_iter_get_current_type and:

a) avoid the allocation of the signature for each complete type
b) simplify the check for struct and dict, since *_get_current_type()
   does TheRightThing (TM)

This also rename some variables to clarify the new semantics:

 iter_type -> iter
 sig_type  -> sig_iter



SVN revision: 81169
2012-12-17 18:24:23 +00:00
José Roberto de Souza 55cd1268b3 edbus: Fix signature check in edbus_message_iter_fixed_array_get()
Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>



SVN revision: 80697
2012-12-11 19:50:53 +00:00
José Roberto de Souza 3134ba4ad0 edbus: Support '(' and '{' in edbus_message_iter_get_and_next()
Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>



SVN revision: 80689
2012-12-11 19:50:11 +00:00
José Roberto de Souza dd7e8ad1a7 edbus: Add some EINA_SAFETY to public API
Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>



SVN revision: 78553
2012-10-26 18:20:19 +00:00
José Roberto de Souza c256bce151 edbus: Break while if a error happen in message_arguments_set
Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>



SVN revision: 78549
2012-10-26 18:19:57 +00:00
José Roberto de Souza cc28164d70 edbus: Add a private function edbus_message_iter_sub_iter_get()
Function will be used in a future patch.

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>



SVN revision: 78199
2012-10-18 20:11:10 +00:00
José Roberto de Souza a0cae1706e edbus: Fix type check of solo structs
When reading messages that contain structs the type that comes from the
wire (and obtained with dbus_message_iter_get_arg_type()) is 'r'.
However 'r' never appears in a signature and dbus_signature_iter_*
returns '('.

Ref: http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-signatures

"STRUCT has a type code, ASCII character 'r', but this type code does not
appear in signatures. Instead, ASCII characters '(' and ')' are used to
mark the beginning and end of the struct. So for example, a struct
containing two integers would have this signature:"

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>



SVN revision: 78072
2012-10-16 22:35:50 +00:00
José Roberto de Souza ea64771a7a edbus: Add const EDBus_Message parameter of
edbus_message_iter_get

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>



SVN revision: 78068
2012-10-16 15:07:17 +00:00
José Roberto de Souza ca539d0fd7 edbus: Rename functions to obey EFL codding style
Rename edbus_message_iter_append_basic to edbus_message_iter_basic_append.
Rename edbus_message_iter_get_basic to edbus_message_iter_basic_get

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>



SVN revision: 78067
2012-10-16 15:07:11 +00:00
Sebastian Dransfeld 9f188af2d8 edbus: check if DBUS_TYPE_UNIX_FD exists
SVN revision: 77629
2012-10-09 08:47:59 +00:00
Lucas De Marchi 5934eb6788 Add new edbus library, aka e_dbus v2
SVN revision: 76775
2012-09-17 20:41:05 +00:00