1. calling a c library problem

Just for the hell of it, lets try renaming to see what happens! ( smile )


ChrisBurch2 wrote:
> 
> 
> Hi
> 
> What I'm trying to do : wrap ncurses
> ETA : long long way in the future - a very very long way
> Where I'm up to : initscr, endwin, nl, nonl, echo, noecho, cbreak, nocbreak
> The code :
> 
> }}}
<eucode>
> 
> include wrapper.ew  --the common wrapper for wrapping dlls etc
> include misc.e
> 
> global object VOID
> 
> 
> global atom ncurses_so, panel_so, menu_so
> if platform() = LINUX then
>         ncurses_so = link_dll("libncurses.so")
>         panel_so = link_dll("libpanel.so")
>         menu_so = link_dll("libmenu.so")
> else
>         puts(1, "This is a linux only lib")
>         abort (0)
> end if
> 
>
> -------------------------------------------------------------------------------
> --initialise ncurses
> integer xinitscr
> xinitscr = link_func(ncurses_so, "initscr", {}, C_INT)
> global function initscr()
>
> -------------------------------------------------------------------------------
> atom pointer        
>         pointer = c_func(xinitscr, {})
> return pointer
> end function
> 
> 
>
> -------------------------------------------------------------------------------
> --ends ncurses, returns to cooked mode
> integer xendwin
> xendwin = link_func(ncurses_so, "endwin", {}, C_INT)
> global procedure endwin()
>
> -------------------------------------------------------------------------------
> atom rv        
>         rv = c_func(xendwin, {})
> end procedure
> 
> </eucode>
{{{

> 
> Have also tried
> 
> }}}
<eucode>
>
> -------------------------------------------------------------------------------
> --ends ncurses, returns to cooked mode
> integer xendwin
> xendwin = link_proc(ncurses_so, "endwin", {})
> global procedure endwin()
>
> -------------------------------------------------------------------------------
> atom rv        
>         c_proc(xendwin, {})
> end procedure
> </eucode>
{{{

> 
> The problem : when I call endwin I get a machine level exception
> 
> ncurses docs defines endwin
> int endwin(void)
> 
> Any ideas?
> 
> Chris

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu