Re: [Haskell-cafe] Seeking advice on best practices with FFI

2008-05-09 Thread Bulat Ziganshin
Hello PJ, Saturday, May 10, 2008, 1:45:29 AM, you wrote: > Q: Does that look ok? Is the db <- newCString leaking ? yes. use withCString instead > void GetStringValues( char* s1, char* s2); if this functions fills s1 and s2, use alloca and peekCString one example of (rather generic) wrapper

[Haskell-cafe] Seeking advice on best practices with FFI

2008-05-09 Thread PJ Durai
Hello, I am trying to write FFI wrappers for a dynamic library in windows. I would like to get some help in how to go about doing things. For example for this C function, the import and wrapper I came up with are listed below. -- STATUS LNPUBLIC NSFDbOpen (char far *PathName, DBHANDLE far *rethD