C Struct Field Access

Manuel M T Chakravarty chak at cse.unsw.edu.au
Thu Oct 17 20:55:13 EDT 2002


Ashley Yakeley <ashley at semantic.org> wrote,

> What's the best strategy for accessing fields in someone else's C struct? 
> Should I write my own glue file with accessor functions? Or should I make 
> a Storable instance for the struct?

Well, my answer to this is the same as to Antony's C enum
question.  Specifically, see

  http://www.cse.unsw.edu.au/~chak/haskell/c2hs/docu/c2hs-3.html#ss3.8

Why do all the work yourself when a tool can do it for you?

Manuel



More information about the FFI mailing list