This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: wayland and libffi
- From: William Ahern <william at 25thandClement dot com>
- To: libffi-discuss at sourceware dot org
- Date: Fri, 10 Dec 2010 12:04:44 -0800
- Subject: Re: wayland and libffi
- References: <m3mxodh1jx.fsf@redhat.com>
On Fri, Dec 10, 2010 at 02:26:26PM -0500, Anthony Green wrote:
>
> Damian's note from earlier today about libffi and wayland made me
> curious. Wayland is a desktop display server that's been making news
> because Ubuntu plans to offer wayland as an alternative to X windows.
> Fedora will eventually go that way as well, and Intel/Nokia will use it
> for MeeGo.
>
> From my quick scan of the source, it looks like libffi is fundamental to
> how wayland protocol events are handled - although I'm not sure I really
> understand it all. Anybody familiar with it?
>
It's an RPC mechanism. An RPC message is composed of an opcode along with
marshalled arguments. This is where FFI comes in, obviously, and all the
relevant marshalling and unmarshalling code is in connection.c.
Remote procedures are declared in protocol/wayland.xml. wayland/scanner.c
appears to parse wayland.xml to generate C structure definitions which map
opcodes to argument signatures. To demarshal the argument signature is
traversed and the arguments taken from the message, with hopefully rock
solid verification.
The use of closure terminology everywhere was a little confusing at first.
It's all straight-forward RPC. FFI isn't used to pass state AFAICT.