Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: =?UTF-8?Q?Maur=C3=ADcio?= CA <mauricio.antunes <at> gmail.com>
Subject: ANN: bindings-DSL 1.0.14
Newsgroups: gmane.comp.lang.haskell.general
Date: Thursday 1st September 2011 16:10:44 UTC (over 5 years ago)
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 
   #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
[email protected]
http://www.haskell.org/mailman/listinfo/haskell
 
CD: 4ms