the c2ffi output contains offset for each field in a struct, which enables us to generate partial bindings where not all struct fields need to have a defined type.
and on this note, where can i find info/examples on bitfield support in cffi? (as in { int bar : 3}, not DEFBITFIELD) IIRC it does support bitfields, but i couldn't find it in the code.
the OFFSET slot in FOREIGN-STRUCT-SLOT doesn't say anything about the unit it's assuming, but the way it's used in MEM-REF suggests it's in bytes (as opposed to bits), right?
as an example, this is what c2ffi emits:
struct { unsigned int f1 : 1; int f2 : 3; } teststruct;
=>
{ "type": { "fields": [ { "type": { "type": { "tag": ":unsigned-int" }, "width": 1, "tag": ":bitfield" }, "bit-alignment": 32, "bit-size": 32, "bit-offset": 0, "name": "f1", "tag": "field" }, { "type": { "type": { "tag": ":int" }, "width": 3, "tag": ":bitfield" }, "bit-alignment": 32, "bit-size": 32, "bit-offset": 1, "name": "f2", "tag": "field" } ], "bit-alignment": 32, "bit-size": 32, "location": "[...]/autospec/bluez.h:1:1", "id": 1, "name": "", "ns": 0, "tag": "struct" }, "location": "[...]/autospec/bluez.h:4:3", "name": "teststruct", "tag": "const" },