dbus/dbus dbus-marshal.c,1.42,1.43 dbus-marshal.h,1.18,1.19 dbus-message.c,1.106,1.107 dbus-message.h,1.44,1.45 dbus-protocol.h,1.22,1.23
Havoc Pennington
hp@pdx.freedesktop.org
Sat, 11 Oct 2003 17:55:13 -0700
Update of /cvs/dbus/dbus/dbus
In directory pdx:/tmp/cvs-serv30697/dbus
Modified Files:
dbus-marshal.c dbus-marshal.h dbus-message.c dbus-message.h
dbus-protocol.h
Log Message:
2003-10-11 Havoc Pennington <hp@pobox.com>
* test/decode-gcov.c (function_solve_graph): make broken block
graph a nonfatal error since it seems to be broken. Need to debug
this.
* dbus/dbus-marshal.c (_dbus_type_is_valid): new function since we
can't just check type > INVALID < LAST anymore
* dbus/dbus-message.c (dbus_message_get_signature): new function
(dbus_message_has_signature): new function
(struct DBusMessage): add signature field (right now it isn't sent
over the wire, just generated on the fly)
(dbus_message_copy): copy the signature, and init strings to
proper length to avoid some reallocs
(dbus_message_iter_init_array_iterator): return void, since it
can't fail
(dbus_message_iter_init_dict_iterator): return void since it can't fail
(_dbus_message_loader_queue_messages): add silly temporary hack to
fill in message->signature on load
* dbus/dbus-protocol.h: change DBUS_TYPE_* values to be ASCII
characters, so they are relatively human-readable.
Index: dbus-marshal.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-marshal.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- dbus-marshal.c 30 Sep 2003 02:32:52 -0000 1.42
+++ dbus-marshal.c 12 Oct 2003 00:55:11 -0000 1.43
@@ -1801,7 +1801,7 @@
data = _dbus_string_get_const_data_len (str, pos, 1);
- if (*data > DBUS_TYPE_INVALID && *data <= DBUS_TYPE_LAST)
+ if (_dbus_type_is_valid (*data))
{
*type = *data;
if (end_pos != NULL)
@@ -2207,6 +2207,35 @@
return TRUE;
}
+/**
+ * Return #TRUE if the typecode is a valid typecode
+ *
+ * @returns #TRUE if valid
+ */
+dbus_bool_t
+_dbus_type_is_valid (int typecode)
+{
+ switch (typecode)
+ {
+ case DBUS_TYPE_NIL:
+ case DBUS_TYPE_BYTE:
+ case DBUS_TYPE_BOOLEAN:
+ case DBUS_TYPE_INT32:
+ case DBUS_TYPE_UINT32:
+ case DBUS_TYPE_INT64:
+ case DBUS_TYPE_UINT64:
+ case DBUS_TYPE_DOUBLE:
+ case DBUS_TYPE_STRING:
+ case DBUS_TYPE_NAMED:
+ case DBUS_TYPE_ARRAY:
+ case DBUS_TYPE_DICT:
+ case DBUS_TYPE_OBJECT_PATH:
+ return TRUE;
+
+ default:
+ return FALSE;
+ }
+}
/**
* If in verbose mode, print a block of binary data.
Index: dbus-marshal.h
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-marshal.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- dbus-marshal.h 30 Sep 2003 02:32:52 -0000 1.18
+++ dbus-marshal.h 12 Oct 2003 00:55:11 -0000 1.19
@@ -313,5 +313,6 @@
int pos,
int *end_pos);
+dbus_bool_t _dbus_type_is_valid (int typecode);
#endif /* DBUS_PROTOCOL_H */
Index: dbus-message.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-message.c,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- dbus-message.c 11 Oct 2003 06:20:28 -0000 1.106
+++ dbus-message.c 12 Oct 2003 00:55:11 -0000 1.107
@@ -103,7 +103,9 @@
unsigned int locked : 1; /**< Message being sent, no modifications allowed. */
- DBusDataSlotList slot_list; /**< Data stored by allocated integer ID */
+ DBusDataSlotList slot_list; /**< Data stored by allocated integer ID */
+
+ DBusString signature; /**< Signature */
};
enum {
@@ -1102,6 +1104,14 @@
dbus_free (message);
return NULL;
}
+
+ if (!_dbus_string_init_preallocated (&message->signature, 4))
+ {
+ _dbus_string_free (&message->header);
+ _dbus_string_free (&message->body);
+ dbus_free (message);
+ return NULL;
+ }
return message;
}
@@ -1349,45 +1359,56 @@
retval->header_padding = message->header_padding;
retval->locked = FALSE;
- if (!_dbus_string_init (&retval->header))
+ if (!_dbus_string_init_preallocated (&retval->header,
+ _dbus_string_get_length (&message->header)))
{
dbus_free (retval);
return NULL;
}
- if (!_dbus_string_init (&retval->body))
+ if (!_dbus_string_init_preallocated (&retval->body,
+ _dbus_string_get_length (&message->body)))
{
_dbus_string_free (&retval->header);
dbus_free (retval);
return NULL;
}
- if (!_dbus_string_copy (&message->header, 0,
- &retval->header, 0))
+ if (!_dbus_string_init_preallocated (&retval->signature,
+ _dbus_string_get_length (&message->signature)))
{
_dbus_string_free (&retval->header);
_dbus_string_free (&retval->body);
dbus_free (retval);
-
return NULL;
}
+
+ if (!_dbus_string_copy (&message->header, 0,
+ &retval->header, 0))
+ goto failed_copy;
if (!_dbus_string_copy (&message->body, 0,
&retval->body, 0))
- {
- _dbus_string_free (&retval->header);
- _dbus_string_free (&retval->body);
- dbus_free (retval);
-
- return NULL;
- }
+ goto failed_copy;
+ if (!_dbus_string_copy (&message->signature, 0,
+ &retval->signature, 0))
+ goto failed_copy;
+
for (i = 0; i <= DBUS_HEADER_FIELD_LAST; i++)
{
retval->header_fields[i] = message->header_fields[i];
}
return retval;
+
+ failed_copy:
+ _dbus_string_free (&retval->header);
+ _dbus_string_free (&retval->body);
+ _dbus_string_free (&retval->signature);
+ dbus_free (retval);
+
+ return NULL;
}
@@ -1448,6 +1469,7 @@
_dbus_string_free (&message->header);
_dbus_string_free (&message->body);
+ _dbus_string_free (&message->signature);
dbus_free (message);
}
@@ -2371,6 +2393,9 @@
return pos;
}
+/* FIXME what are these _dbus_type_is_valid() checks for?
+ * haven't we validated the message?
+ */
static int
dbus_message_iter_get_data_start (DBusMessageRealIter *iter, int *type)
{
@@ -2382,7 +2407,7 @@
case DBUS_MESSAGE_ITER_TYPE_MESSAGE:
data = _dbus_string_get_const_data_len (&iter->message->body,
iter->pos, 1);
- if (*data > DBUS_TYPE_INVALID && *data <= DBUS_TYPE_LAST)
+ if (_dbus_type_is_valid (*data))
*type = *data;
else
*type = DBUS_TYPE_INVALID;
@@ -2392,7 +2417,7 @@
case DBUS_MESSAGE_ITER_TYPE_ARRAY:
data = _dbus_string_get_const_data_len (&iter->message->body,
iter->array_type_pos, 1);
- if (*data > DBUS_TYPE_INVALID && *data <= DBUS_TYPE_LAST)
+ if (_dbus_type_is_valid (*data))
*type = *data;
else
*type = DBUS_TYPE_INVALID;
@@ -2408,7 +2433,7 @@
data = _dbus_string_get_const_data_len (&iter->message->body,
pos, 1);
- if (*data > DBUS_TYPE_INVALID && *data <= DBUS_TYPE_LAST)
+ if (_dbus_type_is_valid (*data))
*type = *data;
else
*type = DBUS_TYPE_INVALID;
@@ -2509,6 +2534,9 @@
return type;
}
+/* FIXME why do we validate the typecode in here, hasn't the message
+ * already been verified?
+ */
static int
iter_get_array_type (DBusMessageRealIter *iter, int *array_type_pos)
{
@@ -2544,7 +2572,7 @@
data = _dbus_string_get_const_data_len (&iter->message->body,
_array_type_pos, 1);
- if (*data > DBUS_TYPE_INVALID && *data <= DBUS_TYPE_LAST)
+ if (_dbus_type_is_valid (*data))
return *data;
return DBUS_TYPE_INVALID;
@@ -2851,9 +2879,8 @@
* @param iter the iterator
* @param array_iter pointer to an iterator to initialize
* @param array_type gets set to the type of the array elements
- * @returns #TRUE on success
*/
-dbus_bool_t
+void
dbus_message_iter_init_array_iterator (DBusMessageIter *iter,
DBusMessageIter *array_iter,
int *array_type)
@@ -2863,7 +2890,7 @@
int type, pos, len_pos, len, array_type_pos;
int _array_type;
- _dbus_return_val_if_fail (dbus_message_iter_check (real), FALSE);
+ _dbus_return_if_fail (dbus_message_iter_check (real));
pos = dbus_message_iter_get_data_start (real, &type);
@@ -2891,8 +2918,6 @@
if (array_type != NULL)
*array_type = _array_type;
-
- return TRUE;
}
@@ -2903,9 +2928,8 @@
*
* @param iter the iterator
* @param dict_iter pointer to an iterator to initialize
- * @returns #TRUE on success
*/
-dbus_bool_t
+void
dbus_message_iter_init_dict_iterator (DBusMessageIter *iter,
DBusMessageIter *dict_iter)
{
@@ -2913,7 +2937,7 @@
DBusMessageRealIter *dict_real = (DBusMessageRealIter *)dict_iter;
int type, pos, len_pos, len;
- _dbus_return_val_if_fail (dbus_message_iter_check (real), FALSE);
+ _dbus_return_if_fail (dbus_message_iter_check (real));
pos = dbus_message_iter_get_data_start (real, &type);
@@ -2934,8 +2958,6 @@
dict_real->container_start = pos;
dict_real->container_length_pos = len_pos;
dict_real->wrote_dict_key = 0;
-
- return TRUE;
}
/**
@@ -3324,8 +3346,14 @@
switch (iter->type)
{
case DBUS_MESSAGE_ITER_TYPE_MESSAGE:
+ if (!_dbus_string_append_byte (&iter->message->signature, type))
+ return FALSE;
+
if (!_dbus_string_append_byte (&iter->message->body, type))
- return FALSE;
+ {
+ _dbus_string_shorten (&iter->message->signature, 1);
+ return FALSE;
+ }
break;
case DBUS_MESSAGE_ITER_TYPE_ARRAY:
@@ -3346,7 +3374,7 @@
}
if (!_dbus_string_append_byte (&iter->message->body, type))
- return FALSE;
+ return FALSE;
break;
@@ -3783,10 +3811,18 @@
{
if (array_type_pos != NULL)
*array_type_pos = _dbus_string_get_length (&real->message->body);
+
+
+ if (!_dbus_string_append_byte (&real->message->signature, element_type))
+ {
+ _dbus_string_set_length (&real->message->body, real->pos);
+ return FALSE;
+ }
/* Append element type */
if (!_dbus_string_append_byte (&real->message->body, element_type))
{
+ _dbus_string_shorten (&real->message->signature, 1);
_dbus_string_set_length (&real->message->body, real->pos);
return FALSE;
}
@@ -3796,7 +3832,10 @@
if (element_type != DBUS_TYPE_ARRAY &&
!array_iter_type_mark_done (real))
- return FALSE;
+ {
+ _dbus_string_shorten (&real->message->signature, 1);
+ return FALSE;
+ }
}
return TRUE;
@@ -3881,10 +3920,10 @@
int len_pos;
_dbus_return_val_if_fail (dbus_message_iter_append_check (real), FALSE);
-
+
if (!dbus_message_iter_append_type (real, DBUS_TYPE_DICT))
- return FALSE;
-
+ return FALSE;
+
len_pos = _DBUS_ALIGN_VALUE (_dbus_string_get_length (&real->message->body), sizeof (dbus_uint32_t));
/* Empty length for now, backfill later */
@@ -4258,6 +4297,29 @@
NULL);
}
+/**
+ * Gets the type signature of the message, i.e. the arguments in the
+ * message payload. The signature includes only "in" arguments for
+ * #DBUS_MESSAGE_TYPE_METHOD_CALL and only "out" arguments for
+ * #DBUS_MESSAGE_TYPE_METHOD_RETURN, so is slightly different from
+ * what you might expect (it does not include the signature of the
+ * entire C++-style method).
+ *
+ * The signature is a string made up of type codes such
+ * as #DBUS_TYPE_STRING. The string is terminated with nul
+ * (nul is also the value of #DBUS_TYPE_INVALID).
+ *
+ * @param message the message
+ * @returns the type signature
+ */
+const char*
+dbus_message_get_signature (DBusMessage *message)
+{
+ _dbus_return_val_if_fail (message != NULL, NULL);
+
+ return _dbus_string_get_const_data (&message->signature);
+}
+
static dbus_bool_t
_dbus_message_has_type_interface_member (DBusMessage *message,
int type,
@@ -4419,7 +4481,8 @@
{
const char *s;
- _dbus_assert (service != NULL);
+ _dbus_return_val_if_fail (message != NULL, FALSE);
+ _dbus_return_val_if_fail (service != NULL, FALSE);
s = dbus_message_get_sender (message);
@@ -4430,6 +4493,25 @@
}
/**
+ * Checks whether the message has the given signature;
+ * see dbus_message_get_signature() for more details on
+ * what the signature looks like.
+ *
+ * @param message the message
+ * @param signature typecode array
+ * @returns #TRUE if message has the given signature
+*/
+dbus_bool_t
+dbus_message_has_signature (DBusMessage *message,
+ const char *signature)
+{
+ _dbus_return_val_if_fail (message != NULL, FALSE);
+ _dbus_return_val_if_fail (signature != NULL, FALSE);
+
+ return _dbus_string_equal_c_str (&message->signature, signature);
+}
+
+/**
* Sets a #DBusError based on the contents of the given
* message. The error is only set if the message
* is an error message, as in DBUS_MESSAGE_TYPE_ERROR.
@@ -5198,6 +5280,60 @@
message->byte_order,
CLIENT_SERIAL_OFFSET,
NULL);
+
+ /* Fill in signature (FIXME should do this during validation,
+ * but I didn't want to spend time on it since we want to change
+ * the wire format to contain the signature anyway)
+ */
+ {
+ DBusMessageIter iter;
+
+ dbus_message_iter_init (message, &iter);
+
+ do
+ {
+ int t;
+
+ t = dbus_message_iter_get_arg_type (&iter);
+ if (t == DBUS_TYPE_INVALID)
+ break;
+
+ if (!_dbus_string_append_byte (&message->signature,
+ t))
+ {
+ _dbus_verbose ("failed to append type byte to signature\n");
+ _dbus_list_remove_last (&loader->messages, message);
+ dbus_message_unref (message);
+ return FALSE;
+ }
+
+ if (t == DBUS_TYPE_ARRAY)
+ {
+ DBusMessageIter child_iter;
+ int array_type = t;
+
+ child_iter = iter;
+
+ while (array_type == DBUS_TYPE_ARRAY)
+ {
+ DBusMessageIter parent_iter = child_iter;
+ dbus_message_iter_init_array_iterator (&parent_iter,
+ &child_iter,
+ &array_type);
+
+ if (!_dbus_string_append_byte (&message->signature,
+ array_type))
+ {
+ _dbus_verbose ("failed to append array type byte to signature\n");
+ _dbus_list_remove_last (&loader->messages, message);
+ dbus_message_unref (message);
+ return FALSE;
+ }
+ }
+ }
+ }
+ while (dbus_message_iter_next (&iter));
+ }
_dbus_verbose ("Loaded message %p\n", message);
}
@@ -5512,8 +5648,7 @@
_dbus_assert_not_reached ("Array type not double");
- if (!dbus_message_iter_init_array_iterator (&iter, &array, NULL))
- _dbus_assert_not_reached ("Array init failed");
+ dbus_message_iter_init_array_iterator (&iter, &array, NULL);
if (dbus_message_iter_get_arg_type (&array) != DBUS_TYPE_DOUBLE)
_dbus_assert_not_reached ("Argument type isn't double");
@@ -5542,8 +5677,7 @@
if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_DICT)
_dbus_assert_not_reached ("not dict type");
- if (!dbus_message_iter_init_dict_iterator (&iter, &dict))
- _dbus_assert_not_reached ("dict iter failed");
+ dbus_message_iter_init_dict_iterator (&iter, &dict);
str = dbus_message_iter_get_dict_key (&dict);
if (str == NULL || strcmp (str, "test") != 0)
@@ -5572,8 +5706,7 @@
if (dbus_message_iter_get_array_type (&dict) != DBUS_TYPE_ARRAY)
_dbus_assert_not_reached ("Array type not array");
- if (!dbus_message_iter_init_array_iterator (&dict, &array, NULL))
- _dbus_assert_not_reached ("Array init failed");
+ dbus_message_iter_init_array_iterator (&dict, &array, NULL);
if (dbus_message_iter_get_arg_type (&array) != DBUS_TYPE_ARRAY)
_dbus_assert_not_reached ("Argument type isn't array");
@@ -5581,8 +5714,7 @@
if (dbus_message_iter_get_array_type (&array) != DBUS_TYPE_INT32)
_dbus_assert_not_reached ("Array type not int32");
- if (!dbus_message_iter_init_array_iterator (&array, &array2, NULL))
- _dbus_assert_not_reached ("Array init failed");
+ dbus_message_iter_init_array_iterator (&array, &array2, NULL);
if (dbus_message_iter_get_arg_type (&array2) != DBUS_TYPE_INT32)
_dbus_assert_not_reached ("Argument type isn't int32");
@@ -5727,11 +5859,7 @@
{
int array_type;
- if (!dbus_message_iter_init_array_iterator (iter, &child_iter, &array_type))
- {
- _dbus_warn ("Failed to init array iterator\n");
- return FALSE;
- }
+ dbus_message_iter_init_array_iterator (iter, &child_iter, &array_type);
while (dbus_message_iter_has_next (&child_iter))
{
@@ -5751,11 +5879,7 @@
int entry_type;
char *key;
- if (!dbus_message_iter_init_dict_iterator (iter, &child_iter))
- {
- _dbus_warn ("Failed to init dict iterator\n");
- return FALSE;
- }
+ dbus_message_iter_init_dict_iterator (iter, &child_iter);
while ((entry_type = dbus_message_iter_get_arg_type (&child_iter)) != DBUS_TYPE_INVALID)
{
@@ -6479,8 +6603,7 @@
if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_DICT)
_dbus_assert_not_reached ("not dict type");
- if (!dbus_message_iter_init_dict_iterator (&iter, &dict))
- _dbus_assert_not_reached ("dict iter failed");
+ dbus_message_iter_init_dict_iterator (&iter, &dict);
our_str = dbus_message_iter_get_dict_key (&dict);
if (our_str == NULL || strcmp (our_str, "test") != 0)
@@ -6546,6 +6669,8 @@
const double our_double_array[] = { 0.1234, 9876.54321, -300.0 };
const unsigned char our_byte_array[] = { 'a', 'b', 'c', 234 };
const unsigned char our_boolean_array[] = { TRUE, FALSE, TRUE, TRUE, FALSE };
+ char sig[64];
+ const char *s;
_dbus_assert (sizeof (DBusMessageRealIter) <= sizeof (DBusMessageIter));
@@ -6671,12 +6796,53 @@
dbus_message_iter_append_dict_key (&child_iter, "test");
dbus_message_iter_append_uint32 (&child_iter, 0xDEADBEEF);
dbus_message_iter_append_uint32 (&iter, 0xCAFEBABE);
+
+ i = 0;
+ sig[i++] = DBUS_TYPE_INT32;
+#ifdef DBUS_HAVE_INT64
+ sig[i++] = DBUS_TYPE_INT64;
+ sig[i++] = DBUS_TYPE_UINT64;
+#endif
+ sig[i++] = DBUS_TYPE_STRING;
+ sig[i++] = DBUS_TYPE_DOUBLE;
+ sig[i++] = DBUS_TYPE_BOOLEAN;
+ sig[i++] = DBUS_TYPE_ARRAY;
+ sig[i++] = DBUS_TYPE_UINT32;
+ sig[i++] = DBUS_TYPE_ARRAY;
+ sig[i++] = DBUS_TYPE_INT32;
+#ifdef DBUS_HAVE_INT64
+ sig[i++] = DBUS_TYPE_ARRAY;
+ sig[i++] = DBUS_TYPE_UINT64;
+ sig[i++] = DBUS_TYPE_ARRAY;
+ sig[i++] = DBUS_TYPE_INT64;
+#endif
+ sig[i++] = DBUS_TYPE_ARRAY;
+ sig[i++] = DBUS_TYPE_STRING;
+ sig[i++] = DBUS_TYPE_ARRAY;
+ sig[i++] = DBUS_TYPE_DOUBLE;
+ sig[i++] = DBUS_TYPE_ARRAY;
+ sig[i++] = DBUS_TYPE_BYTE;
+ sig[i++] = DBUS_TYPE_ARRAY;
+ sig[i++] = DBUS_TYPE_BOOLEAN;
+ sig[i++] = DBUS_TYPE_DICT;
+ sig[i++] = DBUS_TYPE_UINT32;
+ sig[i++] = DBUS_TYPE_INVALID;
+
+ _dbus_assert (i < (int) _DBUS_N_ELEMENTS (sig));
_dbus_verbose_bytes_of_string (&message->header, 0,
_dbus_string_get_length (&message->header));
_dbus_verbose_bytes_of_string (&message->body, 0,
_dbus_string_get_length (&message->body));
-
+
+ _dbus_verbose ("Signature expected \"%s\" actual \"%s\"\n",
+ sig, dbus_message_get_signature (message));
+
+ s = dbus_message_get_signature (message);
+
+ _dbus_assert (dbus_message_has_signature (message, sig));
+ _dbus_assert (strcmp (s, sig) == 0);
+
verify_test_message (message);
copy = dbus_message_copy (message);
@@ -6691,6 +6857,9 @@
_dbus_assert (_dbus_string_get_length (&message->body) ==
_dbus_string_get_length (©->body));
+ _dbus_assert (_dbus_string_get_length (&message->signature) ==
+ _dbus_string_get_length (©->signature));
+
verify_test_message (copy);
name1 = dbus_message_get_interface (message);
Index: dbus-message.h
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-message.h,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- dbus-message.h 10 Oct 2003 02:42:21 -0000 1.44
+++ dbus-message.h 12 Oct 2003 00:55:11 -0000 1.45
@@ -96,6 +96,7 @@
dbus_bool_t dbus_message_set_sender (DBusMessage *message,
const char *sender);
const char* dbus_message_get_sender (DBusMessage *message);
+const char* dbus_message_get_signature (DBusMessage *message);
void dbus_message_set_no_reply (DBusMessage *message,
dbus_bool_t no_reply);
dbus_bool_t dbus_message_get_no_reply (DBusMessage *message);
@@ -111,6 +112,8 @@
const char *service);
dbus_bool_t dbus_message_has_sender (DBusMessage *message,
const char *service);
+dbus_bool_t dbus_message_has_signature (DBusMessage *message,
+ const char *signature);
dbus_uint32_t dbus_message_get_serial (DBusMessage *message);
dbus_bool_t dbus_message_set_reply_serial (DBusMessage *message,
dbus_uint32_t reply_serial);
@@ -166,10 +169,10 @@
unsigned char **value,
int *len);
-dbus_bool_t dbus_message_iter_init_array_iterator (DBusMessageIter *iter,
+void 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,
+void 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,
Index: dbus-protocol.h
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-protocol.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- dbus-protocol.h 10 Oct 2003 03:56:30 -0000 1.22
+++ dbus-protocol.h 12 Oct 2003 00:55:11 -0000 1.23
@@ -40,22 +40,22 @@
#define DBUS_MAJOR_PROTOCOL_VERSION 0
/* Data types */
-#define DBUS_TYPE_INVALID 0
-#define DBUS_TYPE_NIL 1
-#define DBUS_TYPE_BYTE 2
-#define DBUS_TYPE_BOOLEAN 3
-#define DBUS_TYPE_INT32 4
-#define DBUS_TYPE_UINT32 5
-#define DBUS_TYPE_INT64 6
-#define DBUS_TYPE_UINT64 7
-#define DBUS_TYPE_DOUBLE 8
-#define DBUS_TYPE_STRING 9
-#define DBUS_TYPE_NAMED 10
-#define DBUS_TYPE_ARRAY 11
-#define DBUS_TYPE_DICT 12
-#define DBUS_TYPE_OBJECT_PATH 13
-
-#define DBUS_TYPE_LAST DBUS_TYPE_OBJECT_PATH
+#define DBUS_TYPE_INVALID ((int) '\0')
+#define DBUS_TYPE_NIL ((int) 'v')
+#define DBUS_TYPE_BYTE ((int) 'y')
+#define DBUS_TYPE_BOOLEAN ((int) 'b')
+#define DBUS_TYPE_INT32 ((int) 'i')
+#define DBUS_TYPE_UINT32 ((int) 'u')
+#define DBUS_TYPE_INT64 ((int) 'x')
+#define DBUS_TYPE_UINT64 ((int) 't')
+#define DBUS_TYPE_DOUBLE ((int) 'd')
+#define DBUS_TYPE_STRING ((int) 's')
+#define DBUS_TYPE_NAMED ((int) 'n')
+#define DBUS_TYPE_ARRAY ((int) 'a')
+#define DBUS_TYPE_DICT ((int) 'c')
+#define DBUS_TYPE_OBJECT_PATH ((int) 'o')
+
+#define DBUS_NUMBER_OF_TYPES (13)
/* Max length in bytes of a service or interface or member name */
#define DBUS_MAXIMUM_NAME_LENGTH 256