[Coco] curses! Sucess!

Willard Goosey goosey at virgo.sdc.org
Sat Aug 15 19:23:24 EDT 2009


OK, last year we had a big thing over the source for a Curses library
that was on RTSI.  

Turns out it was OSK source, rather than OS-9/6X09.

So, last night I finally sat down and hacked at it some, replacing the
OSK SCF status scructs with the OS-9 versions, and actually got it to
compile!

(OSK's SCF status tables seem to be VERY deeply nested.  Ouch!)

There were also a couple of macro calls that c_prep19 didn't like.  I
split them off into seperate lines, which made both the compiler and
my aesthetic sense happier.

The only other change I had to make was that the the compiler didn't
like comparing the return value of tgetent() to a (char *)1  so, after
reading some about termcap, changed it to check for > 0  

You gotta love K&R C -- tgetent() returns -1 on file error, 0 for
"can't find entry", and, to quote the man page, "some other value" on
sucess. ;-)

And of course, getting the code to compile doesn't actually mean it'll
work.  I'll have to hack up some test code.

Of course, it requires the Kreider Clib (for the OSK-style _ss_* and
_gs_* functions), termcap (the LII termcap library does work, doesn't
it?  I've never really tested it), and cgfx7 (for getenv).

But we might actually have a working curses library!

Willard
-- 
Willard Goosey  goosey at sdc.org
Socorro, New Mexico, USA
I search my heart and find Cimmeria, land of Darkness and the Night.
  -- R.E. Howard



More information about the Coco mailing list