dbus/tools dbus-print-message.c,1.3,1.4 dbus-send.c,1.9,1.10
Havoc Pennington
hp@freedesktop.org
Fri Jan 14 23:15:40 PST 2005
- Previous message: dbus/doc TODO,1.51,1.52
- Next message: dbus/dbus .cvsignore, 1.5, 1.6 Makefile.am, 1.59,
1.60 dbus-auth-script.c, 1.15, 1.16 dbus-bus.c, 1.35,
1.36 dbus-connection.c, 1.87, 1.88 dbus-internals.c, 1.38,
1.39 dbus-internals.h, 1.47, 1.48 dbus-mainloop.c, 1.17,
1.18 dbus-marshal-basic.c, 1.13, 1.14 dbus-marshal-basic.h,
1.11, 1.12 dbus-marshal-header.c, NONE,
1.1 dbus-marshal-header.h, NONE, 1.1 dbus-marshal-recursive.c,
1.38, 1.39 dbus-marshal-recursive.h, 1.24,
1.25 dbus-marshal-validate.c, 1.1, 1.2 dbus-marshal-validate.h,
1.1, 1.2 dbus-marshal.c, 1.53, NONE dbus-marshal.h, 1.25,
NONE dbus-memory.c, 1.24, 1.25 dbus-message-builder.c, 1.25,
1.26 dbus-message-internal.h, 1.18, 1.19 dbus-message.c, 1.146,
1.147 dbus-message.h, 1.56, 1.57 dbus-object-tree.c, 1.9,
1.10 dbus-object-tree.h, 1.6, 1.7 dbus-protocol-new.h, 1.5,
NONE dbus-protocol.h, 1.31, 1.32 dbus-sha.c, 1.7,
1.8 dbus-string.c, 1.60, 1.61 dbus-string.h, 1.34,
1.35 dbus-test.c, 1.34, 1.35 dbus-test.h, 1.26, 1.27
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvs/dbus/dbus/tools
In directory gabe:/tmp/cvs-serv28195/tools
Modified Files:
dbus-print-message.c dbus-send.c
Log Message:
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
Index: dbus-print-message.c
===================================================================
RCS file: /cvs/dbus/dbus/tools/dbus-print-message.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- dbus-print-message.c 30 Sep 2003 02:33:11 -0000 1.3
+++ dbus-print-message.c 15 Jan 2005 07:15:38 -0000 1.4
@@ -84,7 +84,7 @@
do
{
int type = dbus_message_iter_get_arg_type (&iter);
- char *str;
+ const char *str;
dbus_uint32_t uint32;
dbus_int32_t int32;
double d;
@@ -97,32 +97,32 @@
switch (type)
{
case DBUS_TYPE_STRING:
- str = dbus_message_iter_get_string (&iter);
+ dbus_message_iter_get_basic (&iter, &str);
printf ("string:%s\n", str);
break;
case DBUS_TYPE_INT32:
- int32 = dbus_message_iter_get_int32 (&iter);
+ dbus_message_iter_get_basic (&iter, &int32);
printf ("int32:%d\n", int32);
break;
case DBUS_TYPE_UINT32:
- uint32 = dbus_message_iter_get_uint32 (&iter);
+ dbus_message_iter_get_basic (&iter, &uint32);
printf ("int32:%u\n", uint32);
break;
case DBUS_TYPE_DOUBLE:
- d = dbus_message_iter_get_double (&iter);
+ dbus_message_iter_get_basic (&iter, &d);
printf ("double:%f\n", d);
break;
case DBUS_TYPE_BYTE:
- byte = dbus_message_iter_get_byte (&iter);
+ dbus_message_iter_get_basic (&iter, &byte);
printf ("byte:%d\n", byte);
break;
case DBUS_TYPE_BOOLEAN:
- boolean = dbus_message_iter_get_boolean (&iter);
+ dbus_message_iter_get_basic (&iter, &boolean);
printf ("boolean:%s\n", boolean ? "true" : "false");
break;
Index: dbus-send.c
===================================================================
RCS file: /cvs/dbus/dbus/tools/dbus-send.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- dbus-send.c 11 Aug 2004 14:59:33 -0000 1.9
+++ dbus-send.c 15 Jan 2005 07:15:38 -0000 1.10
@@ -215,33 +215,39 @@
{
case DBUS_TYPE_BYTE:
byte = strtoul (c, NULL, 0);
- dbus_message_iter_append_byte (&iter, byte);
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_BYTE, &byte);
break;
case DBUS_TYPE_DOUBLE:
d = strtod (c, NULL);
- dbus_message_iter_append_double (&iter, d);
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_DOUBLE, &d);
break;
case DBUS_TYPE_INT32:
int32 = strtol (c, NULL, 0);
- dbus_message_iter_append_int32 (&iter, int32);
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_INT32, &int32);
break;
case DBUS_TYPE_UINT32:
uint32 = strtoul (c, NULL, 0);
- dbus_message_iter_append_uint32 (&iter, uint32);
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_UINT32, &uint32);
break;
case DBUS_TYPE_STRING:
- dbus_message_iter_append_string (&iter, c);
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &c);
break;
case DBUS_TYPE_BOOLEAN:
if (strcmp(c, "true") == 0)
- dbus_message_iter_append_boolean (&iter, TRUE);
+ {
+ byte = TRUE;
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_BOOLEAN, &c);
+ }
else if (strcmp(c, "false") == 0)
- dbus_message_iter_append_boolean (&iter, FALSE);
+ {
+ byte = FALSE;
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_BOOLEAN, &c);
+ }
else
{
fprintf (stderr, "%s: Expected \"true\" or \"false\" instead of \"%s\"\n", argv[0], c);
- Previous message: dbus/doc TODO,1.51,1.52
- Next message: dbus/dbus .cvsignore, 1.5, 1.6 Makefile.am, 1.59,
1.60 dbus-auth-script.c, 1.15, 1.16 dbus-bus.c, 1.35,
1.36 dbus-connection.c, 1.87, 1.88 dbus-internals.c, 1.38,
1.39 dbus-internals.h, 1.47, 1.48 dbus-mainloop.c, 1.17,
1.18 dbus-marshal-basic.c, 1.13, 1.14 dbus-marshal-basic.h,
1.11, 1.12 dbus-marshal-header.c, NONE,
1.1 dbus-marshal-header.h, NONE, 1.1 dbus-marshal-recursive.c,
1.38, 1.39 dbus-marshal-recursive.h, 1.24,
1.25 dbus-marshal-validate.c, 1.1, 1.2 dbus-marshal-validate.h,
1.1, 1.2 dbus-marshal.c, 1.53, NONE dbus-marshal.h, 1.25,
NONE dbus-memory.c, 1.24, 1.25 dbus-message-builder.c, 1.25,
1.26 dbus-message-internal.h, 1.18, 1.19 dbus-message.c, 1.146,
1.147 dbus-message.h, 1.56, 1.57 dbus-object-tree.c, 1.9,
1.10 dbus-object-tree.h, 1.6, 1.7 dbus-protocol-new.h, 1.5,
NONE dbus-protocol.h, 1.31, 1.32 dbus-sha.c, 1.7,
1.8 dbus-string.c, 1.60, 1.61 dbus-string.h, 1.34,
1.35 dbus-test.c, 1.34, 1.35 dbus-test.h, 1.26, 1.27
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dbus-commit
mailing list