scope of header files

Ian Lynagh igloo at earth.li
Wed Mar 5 21:39:35 EST 2008


On Thu, Mar 06, 2008 at 02:18:08AM +0000, Duncan Coutts wrote:
> 
> foreign import ccall unsafe "curses.h & ACS_UARROW"
>   acs_uarrow :: Ptr ChType
> 
> #define ACS_UARROW      NCURSES_ACS('-') /* arrow pointing up */

You ought to use a C wrapper around these sorts of things. If you're
lucky, the API docs will tell you which values and functions might be
macros, e.g.
    http://www.opengroup.org/onlinepubs/007908799/xcurses/curses.h.html
is clear about what is (or might be) what.

I can't remember if it's been discussed before, but I think it might be
a good idea for the FFI to be able to create these C stubs itself, if
you give a certain keyword - or perhaps even by default as it's the
safe thing to do, at the expense of performance.


Thanks
Ian



More information about the Glasgow-haskell-users mailing list