[plt-scheme] FFI Question: C-Structures with byte blocks.
Question on using the FFI.
Have made some minimal headway in binding to libusb.
Given the following C structure, what should my define-cstruct look
like? For now, assume the goal is to extract the null terminated
directory name from dirname and to follow the usb_bus *next linked list
chain. i.e. the other structure values can be ignored.
Its how to declare the "block" of char for dirname I'm unsure about.
Given:
struct usb_bus {
struct usb_bus *next, *prev;
char dirname[PATH_MAX + 1];
struct usb_device *devices;
u_int32_t location;
struct usb_device *root_dev;
};
How do get the structure layout to work when dirname is a block of 4097 bytes. (PATH_MAX = 4096 in limits.h)
(define-cstruct _buss_struct
((next _pointer)
(previous _pointer)
(dirname (_bytes o 4097)) ;; not what I really want to do here ??
(devices _pointer)
(location _int)
(root_dev _pointer)))
Thanks