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>
Tue, 26 Feb 2013 16:31:55 +0000 (11:31 -0500)
commit2fc248dc2c877d02694db40aad52180d71373d5a
treebc5c098f2b50318b8be2179e30379442f93cf633
parenta51ed6d50f220488108a4c48fec4858f9fd91cdc
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