Hello!
I've no knowledge about c, so please excuse for this silly question
about how to convert this struct from c:
struct usb_device {
struct usb_device *next, *prev;
char filename[PATH_MAX + 1];
struct usb_bus *bus;
struct usb_device_descriptor descriptor;
struct usb_config_descriptor *config;
void *dev; /* Darwin support */
u_int8_t devnum;
unsigned char num_children;
struct usb_device **children;
};
I'd usually think, a struct would be a reference just by its meaning, so
the line "struct usb_device *next, *prev;" would refer to arrays.
However, this seems not to make sense, as the line will refer to a
linked list. So the second question is about the line "struct
usb_device_descriptor descriptor;" If the first line does not refer to
arrays - do I have to inline all the fields of usb_device_descriptor
then? I.e., do I have to write
UsbDevice[] next, prev;
...
UsbDeviceDescriptor descriptor;
UsbConfigDescriptor[] config;
...
or
UsbDevice next, prev;
...
byte ... // duplicate all the fields of UsbDeviceDescriptor
....
UsbConfigDescriptor config;
...
or am I totally wrong?
Kind regards