1 Sep 2011 18:10
ANN: bindings-DSL 1.0.14
Maurício CA <mauricio.antunes <at> gmail.com>
2011-09-01 16:10:44 GMT
2011-09-01 16:10:44 GMT
FFI package bindings-DSL provides a language to describe foreign interfaces on top of hsc2hs. http://bitbucket.org/mauricio/bindings-dsl http://hackage.haskell.org/package/bindings-DSL New to this release is that you can get pointers to all declared fields of a structure. Suppose you have the following struct in C: struct a { int b; struct { char c; float d; } e; struct a *f; }; You write this in your .hsc file: #starttype struct a #field b , CInt #field e.c , CChar #field e.d , CFloat #field f , Ptr <a> #stoptype Besides the usual Storable instantiated Haskell version of struct a, (named C'a), now you also get the following: p'a'b :: Ptr C'a -> Ptr CInt p'a'e'c :: Ptr C'a -> Ptr CChar p'a'e'd :: Ptr C'a -> Ptr CFloat p'a'f :: Ptr C'a -> Ptr (Ptr C'a) Hope it's useful to you. Best, Maurício _______________________________________________ Haskell mailing list Haskell <at> haskell.org http://www.haskell.org/mailman/listinfo/haskell
RSS Feed