Re: general c library question

new topic     » goto parent     » topic index » view thread      » older message » newer message

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 smile

These are macros, and so at compile time, wherever NCURSES_ATTR_SHIFT
is referenced, it simply becomes 8. A_COLOR becomes 0xff00 - I think
smile

So, you'll have to just define a constant in your code, and hope the
ncurses code doesn't change smile

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 (smile) 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!

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu