[C2hs] Matching defined types (lookupDftMarshIn "CH" [DefinedET gcry_cipher_hd_t h; "CH"])

Einar Karttunen ekarttun at cs.helsinki.fi
Sat Sep 2 07:24:13 EDT 2006


I have a library that defines handles which are pointers
as something like
typedef void* ch_t;

Wrapping with C2HS I can do:
{#pointer ch_t as CH #}

But when I try to use it like:
{#fun ch_close {`CH'} -> `()' #}

C2HS complains:
  >>> Missing "in" marshaller!
  There is no default marshaller for this combination of Haskell and C type:
  Haskell type: CH
  C type      : (CH)

When looking at the internals it comes to a call like:
lookupDftMarshIn "CH" [DefinedET ch_t h; "CH"]

Why don't they match and what should be changed to make things work?

- Einar Karttunen

More information about the C2hs mailing list