moving file descriptor passing into a header

Thiago Macieira thiago at kde.org
Tue Apr 13 15:29:25 PDT 2010


Em Quarta-feira 14. Abril 2010, às 00.01.12, Ryan Lortie escreveu:
> If by "trans-marshalling" you mean iterating over the structure of a
> DBusMessage and copying it into a new DBusMessage then you can still
> copy file descriptors manually.  If you want to be able to do this over
> the structure of an arbitrary message with an unknown type then you can
> still do it -- and just copy the entire file descriptor header between
> DBusMessages.  We could probably add a call to make this easier if you
> have a concrete use case for it.

My point is that this code MUST still work:

    int code = dbus_message_iter_get_arg_type(&read_iter);
    if (dbus_type_is_basic(code)) {
        // easy: just append
        // do exactly like the D-Bus docs suggest
        // (see apidocs for dbus_message_iter_get_basic)

        dbus_uint64_t value;
        dbus_message_iter_get_basic (&read_iter, &value);
        dbus_message_iter_append_basic (&write_iter, type, &value);
        return true;
    }

See: 
http://dbus.freedesktop.org/doc/api/html/group__DBusMessage.html#g580376979e156abe06bbb3ccc3fc6d4c

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      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: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20100414/5cf8d6c0/attachment.pgp>


More information about the dbus mailing list