This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: wayland and libffi


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]