array of string

yohann (yrc) coppel yohann at varyoh.com
Fri Oct 28 22:22:37 PDT 2005


Hi!

I have one more problem...

On the server sid, i have (it's a reply):
...
dbus_message_append_args (reply,
			DBUS_TYPE_INT32, &size,
			DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &list, &size,
			DBUS_TYPE_INVALID);
...
//// EOF

and, for the client:
...
dbus_message_get_args (reply,
				&error,
				DBUS_TYPE_INT32, &size,
				DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, 
				&list, &size2,
				DBUS_TYPE_INVALID);
	
	...
	
	printf("size  : %i\n", size);
	printf("size2 : %i\n", size2);
	int i = 0;

	for(; i < size; ++i) {
		printf("%i :", i); fflush(stdout);
		printf("%s\n", list[i]);
	}
	...
//// EOF 

The argument size (Int32) works fine, but the two others no... (so
segfault in the for)

I've found this code:
http://cvs.gnome.org/viewcvs/NetworkManager/test/nm-tool.c?rev=1.2&view=markup

in the function detail_device, the author do the same.... and it
works ?!

Thanks!
yrc



More information about the dbus mailing list