Hi,
I'm trying to write a program (in C) that calls a
function that is implemented in Haskell. The inputs
to the function is: a pointer to a buffer of unsigned
longs, the length of the input buffer, and a pointer
to a buffer of unsigned chars. The function is to
convert the buffer of unsigned longs into a [Word32],
then convert that list into [Word8] (there will be
some sort of processing on this list eventually) and
then copy it to the output buffer. I'm using
HaskellDirect to assist with this interface between C
and Haskell. The problem I'm seeing is that depending
on the size of the buffer, the program segmentation
faults. I don't see any obvious reason that this is
happening so I'm wondering if something isn't going
wrong during the compilation.
System info:
linux 2.2.12-20
gcc version: egcs-2.91.66
Attached are the source files and the compile output.
Also, is there a better way of passing a buffer
between C and Haskell? For instance, is there a way
to convert the buffer into a list automatically?
Thanks for your help,
T.J.
__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/
convert.tar.gz