I have many structures, which looks like:
struct S {
float a;
uint8_t b;
uint8_t c : 4;
uint8_t d : 2;
uint8_t e : 1;
uint8_t f : 1;
uint8_t g : 1;
...
} __attribute__((packed));
Number of members, their names, type and size of bit fields are different. I need create this structures according to data from xml.
<S>
<a type="float", size=""/>
<a type="uint8_t", size=""/>
<a type="uint8_t", size="4"/>
<a type="uint8_t", size="2"/>
<a type="uint8_t", size="1"/>
<a type="uint8_t", size="1"/>
<a type="uint8_t", size="1"/>
</S>
How can I do this?