I’m trying to map a C library to Haskell using capi
instead of ccall
if possible. I’m having problems with these types in C though:
typedef struct {
char _[24];
}* AsapoConsumerHandle;
If I map this as type AsapoConsumerHandle = Ptr ()
(because you’re not supposed to inspect the pointer anyways), as such:
type AsapoConsumerHandle = Ptr ()
foreign import capi "asapo/consumer_c.h asapo_create_consumer" asapo_create_consumer :: IO AsapoConsumerHandle
Then capi
complains:
note: expected ‘struct <anonymous> **’ but argument is of type ‘void **’
67 | AsapoErrorHandle* error);
But I’m not sure how to map this anonymous struct capi
compatible.