[Haskell-cafe] handles and foreign C functions

Bulat Ziganshin bulat.ziganshin at gmail.com
Wed Dec 3 11:26:39 EST 2008


Hello Andrea,

Wednesday, December 3, 2008, 7:23:20 PM, you wrote:

either some error in the code (i neevr used this feature) or stdout
may be defile by a macro. can you try to define function for it:

FILE *out() {return stdout;}


> On Wed, Dec 03, 2008 at 07:08:00PM +0300, Bulat Ziganshin wrote:
>> Hello Andrea,
>> 
>> Wednesday, December 3, 2008, 5:09:21 PM, you wrote:
>> 
>> > How can I pass to printStuff a stdout FILE pointer?
>> 
>> afair, "&stdout" syntax used to import variables. it was discussed
>> just a day or two ago :)


> you mean this, I think:

> foreign import ccall unsafe "&stdout" c_stdout :: Ptr CFile

> (my fault with the cut&paste of the previous message).

> This is causing the segmentation fault I was talking about.

> Thanks,
> Andrea
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe


-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-Cafe mailing list