From daf8d6579e1ae0ea748810b63180bd5eea2ab9c4 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Sun, 21 Sep 2003 18:43:20 +0000 Subject: 2003-09-21 Mark McLoughlin * doc/dbus-specification.sgml: Change the header field name to be an enum and update the rest of the spec to reference the fields using the conventinal name. * dbus/dbus-protocol.h: update to reflect the spec. * doc/TODO: add item to remove the 4 byte alignment requirement. * dbus/dbus-message.c: Remove the code to generalise the header/body length and serial number header fields as named header fields so we can reference field names using the protocol values. (append_int_field), (append_uint_field), (append_string_field): Append the field name as a byte rather than four chars. (delete_int_or_uint_field), (delete_string_field): reflect the fact that the field name and typecode now occupy 4 bytes instead of 8. (decode_string_field), (decode_header_data): update to reflect protocol changes and move the field specific encoding from decode_string_field() back into decode_header_data(). * dbus/dbus-internals.[ch]: (_dbus_header_field_to_string): Add utility to aid debugging. * dbus/dbus-message-builder.c: (append_string_field), (_dbus_message_data_load): Update to reflect protocol changes; Change the FIELD_NAME directive to HEADER_FIELD and allow it to take the field's conventional name rather than the actual value. * test/data/*/*.message: Update to use HEADER_FIELD instead of FIELD_NAME; Always align the header on an 8 byte boundary *before* updating the header length. --- dbus/dbus-protocol.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'dbus/dbus-protocol.h') diff --git a/dbus/dbus-protocol.h b/dbus/dbus-protocol.h index 473a1051..329609dc 100644 --- a/dbus/dbus-protocol.h +++ b/dbus/dbus-protocol.h @@ -71,14 +71,17 @@ extern "C" { #define DBUS_HEADER_FLAG_NO_REPLY_EXPECTED 0x1 /* Header fields */ -#define DBUS_HEADER_FIELD_PATH "path" -#define DBUS_HEADER_FIELD_INTERFACE "ifce" -#define DBUS_HEADER_FIELD_MEMBER "mebr" -#define DBUS_HEADER_FIELD_ERROR_NAME "ernm" -#define DBUS_HEADER_FIELD_SERVICE "srvc" -#define DBUS_HEADER_FIELD_REPLY "rply" -#define DBUS_HEADER_FIELD_SENDER_SERVICE "sdrs" +#define DBUS_HEADER_FIELD_INVALID 0 +#define DBUS_HEADER_FIELD_PATH 1 +#define DBUS_HEADER_FIELD_INTERFACE 2 +#define DBUS_HEADER_FIELD_MEMBER 3 +#define DBUS_HEADER_FIELD_ERROR_NAME 4 +#define DBUS_HEADER_FIELD_REPLY_SERIAL 5 +#define DBUS_HEADER_FIELD_SERVICE 6 +#define DBUS_HEADER_FIELD_SENDER_SERVICE 7 +#define DBUS_HEADER_FIELD_LAST DBUS_HEADER_FIELD_SENDER_SERVICE + /* Services */ #define DBUS_SERVICE_ORG_FREEDESKTOP_DBUS "org.freedesktop.DBus" #define DBUS_SERVICE_ORG_FREEDESKTOP_BROADCAST "org.freedesktop.Broadcast" -- cgit