Clean up and refactor wl_closure and associated functions
authorJason Ekstrand <jason@jlekstrand.net>
Tue, 26 Feb 2013 16:30:51 +0000 (11:30 -0500)
committerKristian Høgsberg <krh@bitplanet.net>
Fri, 8 Mar 2013 00:19:24 +0000 (19:19 -0500)
commit2551feb17ef0e55c0efa5d3c24a429bb2d09a7dc
treec0d177ff295c693bc4e61788c3a2824b98a4c1ee
parentb30be63c1f7993380e57a5f3044c98401b90e414
Clean up and refactor wl_closure and associated functions

The primary purpose of this patch is to clean up wl_closure and separate
closure storage, libffi, and the wire format.  To that end, a number of changes
have been made:

 - The maximum number of closure arguments has been changed from a magic number
   to a #define WL_CLOSURE_MAX_ARGS

 - A wl_argument union has been added for storing a generalized closure
   argument and wl_closure has been converted to use wl_argument instead of the
   combination of libffi, the wire format, and a dummy extra buffer.  As of
   now, the "extra" field in wl_closure should be treated as bulk storage and
   never direclty referenced outside of wl_connection_demarshal.

 - Everything having to do with libffi has been moved into wl_closure_invoke
   and the convert_arguments_to_ffi helper function.

 - Everything having to do with the wire format has been restricted to
   wl_connection_demarshal and the new static serialize_closure function.  The
   wl_closure_send and wl_closure_queue functions are now light wrappers around
   serialize_closure.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
src/connection.c
src/wayland-client.c
src/wayland-private.h
src/wayland-server.c