I am working on haskell bindings for my own library with a rather complicated interface. It has many structures as part of its interface, and I worked on creating interfaces with hsc2hs and the bindings-DSL package to help automate the binding of structures.
One problem that I have encountered is structures containing multidimensional arrays. The bindings-DSL documentation describes macros for binding to a structure such as
struct with_array { char v[5]; struct test *array_pointer; struct test proper_array[10]; };
with macros like
#starttype struct with_array #array_field v , CChar #field array_pointer , Ptr <test> #array_field proper_array , <test> #stoptype
But this library has many structures with multidimensional arrays as fields more similar to
struct with_multidimensional_array { int whatever; struct something big_array[10][25][500]; };
The #array_field macro seems to process only the first dimension of the array. Is it that bindings-DSL just doesn't have a macro to handle multidimensional arrays?
I would really like a macro to bind a (possibly multidimensional) array to a StorableArray arbitrary indices. It seems that the necessary information is possible in bindings-DSL macros provides - for this macro simply does not.
Has anyone added macros to bindings-DSL ? Has anyone added a macro for this in bindings-DSL ? I have already passed by what I should do with hsc2hs , and is there any other tool that will help me do what I want in a more concise way?
source share