[Coco] Curses, foiled again!
Gene Heskett
gene.heskett at verizon.net
Sat Aug 18 01:44:43 EDT 2007
On Saturday 18 August 2007, Willard Goosey wrote:
>>From: "Paul Fitch" <pfitchjr at bellsouth.net>
>>Date: Fri, 17 Aug 2007 06:34:04 -0400
>>
>>
>>I've got c-prep---19 installed. I'll do the #IFNDEF first.
>
>OK, that's good.
>
>>I still suspect the curses.c file is currupted somehow, someway
>
>Looking it over, I did find one more problem: Both curses.c and
>curses.h end without a final newline.
>
>This is a problem for OS-9 because the readln system call, used to
>read ASCII type files, won't return anything unless it finds a
>newline. If it finds the end of file without a newline, it simply
>returns the eof. :-(
>
>This means that curses.c effectively ends without a #endif to match
>the #ifdef MAIN... and curses.h doesn't actually define wscroll(). :-(
>
>OK, since this sort of thing is a major pain to fix in OS-9, I've put
>a new version of the archive up on
>http://www.sdc.org/~goosey/os9/curses.lzh
>with the eol problem fixed.
>
>This isn't actually a bug in OS-9. It's documented, after all. ;-)
>The OS was carefully written this way. Really, this only shows up
>with text files imported from other machines with sloppier
>conventions.
>
>Which is really making me wonder about this curses package. Except
>for the newlines, which are proper OS-9 cr's, it doesn't look like an
>OS-9 source file. I wonder if that Waggoner d00d was using a cross
>compiler on a Mac or Amiga?
>
>Either that, or I'm wondering if some versions of lha don't hack off
>terminating newlines.
>
>>because when I run the C Beutifier like this --> cb <curses.c
>>
>>>curses.cb it crashes the emulator. The ident on CB shows a good
>>
>>CRC.
>
>Can't help you there, never used it.
Me neither Willard, never heard of it till now. But, I wonder if it
was "imported" from some other platform, and needs re-compiled for the coco's
cr=eol where nearly everyone else uses an lf or a cr-lf combo?
Another program that is partially mine that's out there can sometimes find
such oddities as the missing cr on the end of a file, sort of accidentally
since its real job is to check the punctuation and nesting syntax of a c src
file.
That is 'cntx' I think the coco version is cntx_5.lzh, located at
<ftp://www.rtsi.com/OS9/OS9_6X09/PROG>
I've taken that and built it on the amiga and on this linux box, even fed
quite a bit of the linux kernel through it one night looking for the sort of
thing its good at, miss-matched () etc.
It has two modes, just cntx filename will give you a yea/nay on the file, or a
cntx -v filename will give you a line by line check so you can see where the
error is if the first run says its foobared.
Maybe it will help?
--
Cheers, Gene
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
You have an unusual understanding of the problems of human relationships.
More information about the Coco
mailing list