[ANNOUNCE] D-Bus 1.0 RC 2 (0.94) released
Thiago Macieira
thiago at kde.org
Sun Oct 15 06:29:01 PDT 2006
Daniel Stone wrote:
>On Sat, Oct 14, 2006 at 06:29:10PM -0400, Havoc Pennington wrote:
>> I wonder which distribution will be the first one to accidentally get
>> the machine uuid file in the file list of the package and thus have
>> the same id for all machines running that os ...
>
>http://ozlabs.org/~rusty/ols-2003-keynote/img39.html
>
>Read until img56.html. Really.
>
>(After doing this, go back and check out the plain C bindings wrt
> iterators in messages, particularly the part that requires you to hand
> it a _pointer_ to a string, i.e.:
> dbus_message_iter_append(whatever, "this api sucks horribly");
> is broken, whereas:
> argh = strdup("i cannot believe i'm doing this");
> dbus_message_iter_append(whatever, &argh);
> is correct. Obviously.)
You don't need to strdup. Just assign it to a variable.
The whole point here is that, if you accept 'char*' for strings, you break
the semantic. All other data types take a pointer to the type. Why should
string be any different?
void add_int(int value)
{ dbus_message_iter_append(whatever, &value); }
void add_string(char *value)
{ dbus_message_iter_append(whatever, &value); }
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20061015/01ffac78/attachment.pgp
More information about the dbus
mailing list