diff options
author | Havoc Pennington <hp@redhat.com> | 2005-01-15 07:15:38 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2005-01-15 07:15:38 +0000 |
commit | 9c3d566e95c9080f6040c64531b0ccae22bd5d74 (patch) | |
tree | d21a18baa5a5ee9855c8a00eb2c1985bc23ca65f /dbus/dbus-message.h | |
parent | 6ec04e917c8b4d477e818aa65ebb5e1fd50e4395 (diff) |
2005-01-15 Havoc Pennington <hp@redhat.com>
* Land the new message args API and type system.
This patch is huge, but the public API change is not
really large. The set of D-BUS types has changed somewhat,
and the arg "getters" are more geared toward language bindings;
they don't make a copy, etc.
There are also some known issues. See these emails for details
on this huge patch:
http://lists.freedesktop.org/archives/dbus/2004-December/001836.html
http://lists.freedesktop.org/archives/dbus/2005-January/001922.html
* dbus/dbus-marshal-*: all the new stuff
* dbus/dbus-message.c: basically rewritten
* dbus/dbus-memory.c (check_guards): with "guards" enabled, init
freed blocks to be all non-nul bytes so using freed memory is less
likely to work right
* dbus/dbus-internals.c (_dbus_test_oom_handling): add
DBUS_FAIL_MALLOC=N environment variable, so you can do
DBUS_FAIL_MALLOC=0 to skip the out-of-memory checking, or
DBUS_FAIL_MALLOC=10 to make it really, really, really slow and
thorough.
* qt/message.cpp: port to the new message args API
(operator<<): use str.utf8() rather than str.unicode()
(pretty sure this is right from the Qt docs?)
* glib/dbus-gvalue.c: port to the new message args API
* bus/dispatch.c, bus/driver.c: port to the new message args API
* dbus/dbus-string.c (_dbus_string_init_const_len): initialize the
"locked" flag to TRUE and align_offset to 0; I guess we never
looked at these anyhow, but seems cleaner.
* dbus/dbus-string.h (_DBUS_STRING_ALLOCATION_PADDING):
move allocation padding macro to this header; use it to implement
(_DBUS_STRING_STATIC): ability to declare a static string.
* dbus/dbus-message.c (_dbus_message_has_type_interface_member):
change to return TRUE if the interface is not set.
* dbus/dbus-string.[hc]: move the D-BUS specific validation stuff
to dbus-marshal-validate.[hc]
* dbus/dbus-marshal-basic.c (_dbus_type_to_string): move here from
dbus-internals.c
* dbus/Makefile.am: cut over from dbus-marshal.[hc]
to dbus-marshal-*.[hc]
* dbus/dbus-object-tree.c (_dbus_decompose_path): move this
function here from dbus-marshal.c
Diffstat (limited to 'dbus/dbus-message.h')
-rw-r--r-- | dbus/dbus-message.h | 150 |
1 files changed, 23 insertions, 127 deletions
diff --git a/dbus/dbus-message.h b/dbus/dbus-message.h index e1894c72..fd6b96d4 100644 --- a/dbus/dbus-message.h +++ b/dbus/dbus-message.h @@ -144,14 +144,6 @@ dbus_bool_t dbus_message_get_args_valist (DBusMessage *message, DBusError *error, int first_arg_type, va_list var_args); -dbus_bool_t dbus_message_iter_get_args (DBusMessageIter *iter, - DBusError *error, - int first_arg_type, - ...); -dbus_bool_t dbus_message_iter_get_args_valist (DBusMessageIter *iter, - DBusError *error, - int first_arg_type, - va_list var_args); dbus_bool_t dbus_message_iter_init (DBusMessage *message, @@ -160,125 +152,29 @@ dbus_bool_t dbus_message_iter_has_next (DBusMessageIter *iter dbus_bool_t dbus_message_iter_next (DBusMessageIter *iter); int dbus_message_iter_get_arg_type (DBusMessageIter *iter); int dbus_message_iter_get_array_type (DBusMessageIter *iter); -unsigned char dbus_message_iter_get_byte (DBusMessageIter *iter); -dbus_bool_t dbus_message_iter_get_boolean (DBusMessageIter *iter); -dbus_int32_t dbus_message_iter_get_int32 (DBusMessageIter *iter); -dbus_uint32_t dbus_message_iter_get_uint32 (DBusMessageIter *iter); -#ifdef DBUS_HAVE_INT64 -dbus_int64_t dbus_message_iter_get_int64 (DBusMessageIter *iter); -dbus_uint64_t dbus_message_iter_get_uint64 (DBusMessageIter *iter); -#endif /* DBUS_HAVE_INT64 */ -double dbus_message_iter_get_double (DBusMessageIter *iter); -char * dbus_message_iter_get_string (DBusMessageIter *iter); -char * dbus_message_iter_get_object_path (DBusMessageIter *iter); -char * dbus_message_iter_get_dict_key (DBusMessageIter *iter); -dbus_bool_t dbus_message_iter_get_custom (DBusMessageIter *iter, - char **name, - unsigned char **value, - int *len); - -dbus_bool_t dbus_message_iter_init_array_iterator (DBusMessageIter *iter, - DBusMessageIter *array_iter, - int *array_type); -dbus_bool_t dbus_message_iter_init_dict_iterator (DBusMessageIter *iter, - DBusMessageIter *dict_iter); -dbus_bool_t dbus_message_iter_get_byte_array (DBusMessageIter *iter, - unsigned char **value, - int *len); -dbus_bool_t dbus_message_iter_get_boolean_array (DBusMessageIter *iter, - unsigned char **value, - int *len); -dbus_bool_t dbus_message_iter_get_int32_array (DBusMessageIter *iter, - dbus_int32_t **value, - int *len); -dbus_bool_t dbus_message_iter_get_uint32_array (DBusMessageIter *iter, - dbus_uint32_t **value, - int *len); -#ifdef DBUS_HAVE_INT64 -dbus_bool_t dbus_message_iter_get_int64_array (DBusMessageIter *iter, - dbus_int64_t **value, - int *len); -dbus_bool_t dbus_message_iter_get_uint64_array (DBusMessageIter *iter, - dbus_uint64_t **value, - int *len); -#endif /* DBUS_HAVE_INT64 */ -dbus_bool_t dbus_message_iter_get_double_array (DBusMessageIter *iter, - double **value, - int *len); -dbus_bool_t dbus_message_iter_get_string_array (DBusMessageIter *iter, - char ***value, - int *len); -dbus_bool_t dbus_message_iter_get_object_path_array (DBusMessageIter *iter, - char ***value, - int *len); - - -void dbus_message_append_iter_init (DBusMessage *message, - DBusMessageIter *iter); -dbus_bool_t dbus_message_iter_append_nil (DBusMessageIter *iter); -dbus_bool_t dbus_message_iter_append_boolean (DBusMessageIter *iter, - dbus_bool_t value); -dbus_bool_t dbus_message_iter_append_byte (DBusMessageIter *iter, - unsigned char value); -dbus_bool_t dbus_message_iter_append_int32 (DBusMessageIter *iter, - dbus_int32_t value); -dbus_bool_t dbus_message_iter_append_uint32 (DBusMessageIter *iter, - dbus_uint32_t value); -#ifdef DBUS_HAVE_INT64 -dbus_bool_t dbus_message_iter_append_int64 (DBusMessageIter *iter, - dbus_int64_t value); -dbus_bool_t dbus_message_iter_append_uint64 (DBusMessageIter *iter, - dbus_uint64_t value); -#endif /* DBUS_HAVE_INT64 */ -dbus_bool_t dbus_message_iter_append_double (DBusMessageIter *iter, - double value); -dbus_bool_t dbus_message_iter_append_string (DBusMessageIter *iter, - const char *value); -dbus_bool_t dbus_message_iter_append_object_path (DBusMessageIter *iter, - const char *value); -dbus_bool_t dbus_message_iter_append_custom (DBusMessageIter *iter, - const char *name, - const unsigned char *data, - int len); -dbus_bool_t dbus_message_iter_append_dict_key (DBusMessageIter *iter, - const char *value); -dbus_bool_t dbus_message_iter_append_array (DBusMessageIter *iter, - DBusMessageIter *array_iter, - int element_type); -dbus_bool_t dbus_message_iter_append_dict (DBusMessageIter *iter, - DBusMessageIter *dict_iter); - -/* Helpers for normal types: */ -dbus_bool_t dbus_message_iter_append_boolean_array (DBusMessageIter *iter, - unsigned const char *value, - int len); -dbus_bool_t dbus_message_iter_append_int32_array (DBusMessageIter *iter, - const dbus_int32_t *value, - int len); -dbus_bool_t dbus_message_iter_append_uint32_array (DBusMessageIter *iter, - const dbus_uint32_t *value, - int len); -#ifdef DBUS_HAVE_INT64 -dbus_bool_t dbus_message_iter_append_int64_array (DBusMessageIter *iter, - const dbus_int64_t *value, - int len); -dbus_bool_t dbus_message_iter_append_uint64_array (DBusMessageIter *iter, - const dbus_uint64_t *value, - int len); -#endif /* DBUS_HAVE_INT64 */ -dbus_bool_t dbus_message_iter_append_double_array (DBusMessageIter *iter, - const double *value, - int len); -dbus_bool_t dbus_message_iter_append_byte_array (DBusMessageIter *iter, - unsigned const char *value, - int len); -dbus_bool_t dbus_message_iter_append_string_array (DBusMessageIter *iter, - const char **value, - int len); -dbus_bool_t dbus_message_iter_append_object_path_array (DBusMessageIter *iter, - const char **value, - int len); - +void dbus_message_iter_recurse (DBusMessageIter *iter, + DBusMessageIter *sub); +void dbus_message_iter_get_basic (DBusMessageIter *iter, + void *value); +void dbus_message_iter_get_fixed_array (DBusMessageIter *iter, + void *value, + int *n_elements); + +void dbus_message_append_iter_init (DBusMessage *message, + DBusMessageIter *iter); +dbus_bool_t dbus_message_iter_append_basic (DBusMessageIter *iter, + int type, + const void *value); +dbus_bool_t dbus_message_iter_append_fixed_array (DBusMessageIter *iter, + int element_type, + const void *value, + int n_elements); +dbus_bool_t dbus_message_iter_open_container (DBusMessageIter *iter, + int type, + const char *contained_signature, + DBusMessageIter *sub); +dbus_bool_t dbus_message_iter_close_container (DBusMessageIter *iter, + DBusMessageIter *sub); dbus_bool_t dbus_set_error_from_message (DBusError *error, |