Re: general c library question
- Posted by Ed Davis <ed_davis2 at yahoo.com> Jan 26, 2006
- 545 views
Chris Burch wrote: >In the c library > >#define NCURSES_ATTR_SHIFT 8 > >or > >#define NCURSES_BITS(mask,shift) ((mask) << ((shift) + NCURSES_ATTR_SHIFT)) >#define A_COLOR NCURSES_BITS(((1UL) << 8) - 1UL,0) > >How do I access NCURSES_ATTR_SHIFT, or A_COLOR. > >A_COLOR looks like a macro, whereas NCURSES_ATTR_SHIFT is obviously a >variable, but > >global constant >NAS = peek4u(define_c_var(ncurses_so, "NCURSES_ATTR_SHIFT")) > >gives me a machine level exception You can't access them from Euphoria, because they aren't there These are macros, and so at compile time, wherever NCURSES_ATTR_SHIFT is referenced, it simply becomes 8. A_COLOR becomes 0xff00 - I think So, you'll have to just define a constant in your code, and hope the ncurses code doesn't change By the way, I think it is cool that you're wrapped ncurses. Good job! Now that ncurses isn't really needed (what with the new version coming that doesn't included it), we can use a better () console library such as slang or better yet, TxWin - http://svn.netlabs.org/txwin - works in 32-bit DOS, Windows, and Linux. Made for Watcom too!