Path: utzoo!attcan!uunet!cs.utexas.edu!usc!brutus.cs.uiuc.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.sys.apple Subject: Re: HyperC Message-ID: <12201@smoke.BRL.MIL> Date: 21 Feb 90 15:00:18 GMT References: <11186.infoapple.net@pro-generic> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 29 In article <11186.infoapple.net@pro-generic> ericmcg@pro-generic.cts.com (Eric Mcgillicuddy) writes: >getchar(fp) is called getc(fp) and returns an INT, -1 if an error (not 255 I >think, although this may work since the flags are set on 8 bit values - it >would be machine specific though) >putchar(fp) is called putc(fp) - fp is the prodos file id (0-7). The person >who wrote this compiler hated to type more than Ritchie, so try reducing >letters on common C functions, you should find most of them. argc, argc are >called av, ac by this guy! >it stops when -1 is encountered. it should be $ffff, so any 8-bit ASCII value >is good, unless two deletes in a row. I'm not sure, try it. >I think you will find HyperC much closer to Ansi C than K&R, I don't claim to know specifics of HyperC, but it would help if you knew C. Standard C functions getchar() and putchar() have no arguments; getc() and putc() do, although if your description is correct then HyperC is abusing them since the standard requires FILE* arguments, not ProDOS file-ID ints. The value -1 returned by a function has nothing to do with flags being set. If HyperC extends the sign when returning an 8-bit input byte via getc(), then it is misimplemented since in that case one of the 256 possible byte values is indistinguishable from EOF (-1). Normally this would not be a problem, as getc() should not sign-extend. Two deletes in a row would give you two successive 0x7F (or maybe 0xFF) returns, not a single -1 return. argc and argv are not functions -- they're conventional names for the parameters of the main() function, but like all C parameters their names are not chosen by the implementation and can be chosen by the programmer. Finally, I doubt very much that HyperC resembles an implementation of ANSI X3.159-1989 more closely than it resembles an implementation of K&R 1st Edition Appendix A. From your description of putc() I wouldn't say it is very close to either one.