[Haskell-cafe] Re: Begginer question about alignment in Storable

2008-11-21 Thread Mauricio
Thanks! This is actually a really nice tutorial! Do you mind if I try to find a place for it in the wiki? Go right ahead (...) For reference: http://haskell.org/haskellwiki/FFI_cook_book Best, MaurĂ­cio ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Re: Begginer question about alignment in Storable

2008-11-20 Thread Michael D. Adams
On Wed, Nov 19, 2008 at 1:01 PM, Mauricio [EMAIL PROTECTED] wrote: If you are using hsc2hs (if you are using Cabal this is easy; just rename the file to *.hsc and Cabal will take care of the rest), then there is a macro for making this easier and so you don't have to think about it. (...)

[Haskell-cafe] Re: Begginer question about alignment in Storable

2008-11-20 Thread Mauricio
(...) But the major advantage of hsc2hs is that if your C struct changes or you use a different C compiler, the allignment and size as well as the offsets used in peek and poke will still be correct since the compiler will calculate it for you. (...) And you wanted to write a

Re: [Haskell-cafe] Re: Begginer question about alignment in Storable

2008-11-20 Thread Michael D. Adams
On Thu, Nov 20, 2008 at 11:26 AM, Mauricio [EMAIL PROTECTED] wrote: (...) But the major advantage of hsc2hs is that if your C struct changes or you use a different C compiler, the allignment and size as well as the offsets used in peek and poke will still be correct since the compiler

[Haskell-cafe] Re: Begginer question about alignment in Storable

2008-11-19 Thread Mauricio
If you are using hsc2hs (if you are using Cabal this is easy; just rename the file to *.hsc and Cabal will take care of the rest), then there is a macro for making this easier and so you don't have to think about it. (...) Well, after reading FFI addendum, I'm using my loyal text editor. Am I