![](https://secure.gravatar.com/avatar/9ed6ab1d1019fe41799ee83440518e36.jpg?s=120&d=mm&r=g)
1 Feb
2006
1 Feb
'06
7:33 p.m.
Jeremy Smith <jeremy@decompiler.org> writes:
I want an array of structs. Not pointers to structs, but actual structs. So with an array of 4 16-byte structs, it should be 64 bytes.
I've got around the problem by using a struct which has 16 entries (4 * the 4-entry struct), but that's not desirable because it doesn't scale to more module entries without increasing the struct by 4 more entries.
I think this is what you want: (defcstruct foo (x :int) (y :int) (z :int)) (with-foreign-object (foo-array 'foo 4) ...) FOO-ARRAY will be a pointer to storage for 4 FOO structures. Macroexpanding this WITH-FOREIGN-OBJECT: (WITH-FOREIGN-POINTER (FOO-ARRAY 48) ...) James