diff options
author | Stef Walter <stefw@redhat.com> | 2014-01-10 08:54:41 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-06-02 18:15:56 +0200 |
commit | 9355f5e0b9294f38993763bb131368fb0a229a85 (patch) | |
tree | 8cccd4e4a1989e172889fb201fb7bed88fee4303 /Makefile.am | |
parent | 8ddfc4b55d06d7d2aeb34358628dc8fea186f106 (diff) | |
download | sssd-9355f5e0b9294f38993763bb131368fb0a229a85.tar.gz sssd-9355f5e0b9294f38993763bb131368fb0a229a85.tar.xz sssd-9355f5e0b9294f38993763bb131368fb0a229a85.zip |
sbus: Add sbus_vtable and update codegen to support it
Each interface is a vtable structure derived from
sbus_vtable, in the sense that it has an sbus_vtable
struct as its first argument. This lets us upcast the
interface vtable structure to an sbus_vtable and dispatch
to it dynamically and cleanly.
The interface metadata contains information about which
vtable offset in the interface metadata should be dispatched
to for a given function. This is a common scheme, not only
among dbus implementations, but also compiled languages.
Currently all the vtable functions are of type
sbus_msg_handler_fn. These are the handlers we are familiar
with and perform raw processing of the message. Later commits
will introduce type safe handlers that levelage compile checking
and automatic argument packing/unpacking.
Although this may seem contrived now, the remainder of the
dbus infrastructure work will build on this, including
ofd.Properties, ofd.ObjectManager, ofd.Introspect, compiler
checked type safe unpacking/packing, etc.
The codegen now generates vtable structures for each interface
along-side the metadata, and fills in vtable offsets
appropriately.
It is obviously still possible to hand-craft such vtables and
metadata if needed for a special case.
Once again examples output can be found at:
src/tests/sbus_codegen_tests_generated.h
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Sumit Bose <sbose@redhat.com>
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
(cherry picked from commit fcd8093c58638dc7c4f9cddfc97f273b94ce2ead)
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am index de916d3ac..22a38eb21 100644 --- a/Makefile.am +++ b/Makefile.am @@ -659,7 +659,7 @@ SUFFIXES = .xml _generated.h _generated.c .xml_generated.h: $(srcdir)/$(SBUS_CODEGEN) --mode=header --output=$@ $< .xml_generated.c: - $(srcdir)/$(SBUS_CODEGEN) --mode=source --output=$@ $< + $(srcdir)/$(SBUS_CODEGEN) --mode=source --include=$(@:.c=.h) --output=$@ $< # Regenerate when codegen changes CODEGEN_CODE = \ |