[C2hs] Binding to Libdb, FunPtrs

Udo Stenzel u.stenzel at web.de
Sat Apr 22 18:43:56 EDT 2006


I'd like to use c2hs to create a binding for Sleepy Cat's LibDB.
However, some difficulties crop up:

- variadic functions.  I realize I can't call them anyway, and I don't
  need to (they are just for primitive error reporting).  But there are
  pointers to variadic functions in some structures, and I need c2hs to
  parse them and correctly calculate offsets.

- lots of FunPtrs.  The whole API is defined as structures with FunPtrs
  inside.  c2hs will happily create get hooks for them, but won't
  generate the foreign import "dynamic" declarations.

- defines.  Am I right in assuming that c2hs does not recognize
  #define'd constant and so cannot reflect them in Haskell?

I'm willing to dive into the code and fix this, I just want to make sure
I don't (clumsily) duplicate any effort.  As for the FunPtrs inside
structs, I'm thinking of a new hook that combines a get hook and a fun
(or call) hook.  Does anyone have a better idea?

Manchmal stehe ich nachts auf und installier's mir einfach...
	-- H0arry @ IRC 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org//pipermail/c2hs/attachments/20060423/1bb1a25e/attachment.bin

More information about the C2hs mailing list