hsc: Passing -1 as CString/Ptr a?
Marcin 'Qrczak' Kowalczyk
qrczak@knm.org.pl
Thu, 22 Nov 2001 18:32:51 +0000 (UTC)
Thu, 22 Nov 2001 13:57:32 +0100, Volker Stolz <vs@foldr.org> pisze:
> Hi, I want to invoke the C-function 'dlsym', which has three
> possible options for a parameter of type (void*):
>
> - NULL
> - void* to a string, i.e. CString in Haskell
> - RTLD_NEXT = (void *)(-1)
You can obtain the value from an embedded C function.
foreign import unsafe rtldNext :: Ptr a
#def inline void *rtldNext (void) {return RTLD_NEXT;}
--
__("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
\__/
^^
QRCZAK