Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!ames!ptsfa!hoptoad!academ!uhnix1!sugar!peter From: peter@sugar.UUCP (Peter da Silva) Newsgroups: comp.lang.c Subject: Re: Distinguished pointers (was Re: Weird syscall returns) Message-ID: <452@sugar.UUCP> Date: Sat, 1-Aug-87 11:05:36 EDT Article-I.D.: sugar.452 Posted: Sat Aug 1 11:05:36 1987 Date-Received: Thu, 6-Aug-87 07:18:44 EDT References: <1158@copper.TEK.COM> <6858@auspyr.UUCP> <17171@cca.CCA.COM> <274@nuchat.UUCP> Organization: Sugar Land UNIX - Houston, TX Lines: 37 Summary: OS9 is broken? > Now we find ourselves on OS9, where the compiler says that '\n' and > '\r' are both 13. (They thoughtfully provide '\l' == 11). Now the > switch doesn't work, even though all it needs is to be collapsed. While there's nothing inherently wrong with having non linefeed newlines, the 'C' compiler should deal with it in such a way as not to break existing code. MS-DOS uses CR/LF as the newline, which is broken, but at least the fix is handled by the I/O library... which allows normal text-oriented stuff to work. Of course this breaks other stuff (fseek on text files... it needn't, but it does). Suggestion: lie and say '\r' is LF. Suggestion: give up and accept that if your file formats differ you're going to have to use #ifdefs. It least it's not like RSX where lines are variable length records with a word length and a bunch of byte data. PS: seek is handled badly by a number of compilers and libraries on non UNIX systems. The UNIX manual states that on some systems offsets are magic cookies, and that the only reliable way to get an offset in these systems is to read to that point, yet. Some libraries don't include seek, because they would have to use magic cookies. Some libraries require 'C' programs to access unblocked files only. One that I know of physically copies a file to an unblocked file when you open it in 'C', so you can seek. An Atari-800 'C' compiler implements 'note()' and 'point()' with identical semantics to ftell() and fseek(), because "you can't seek to a random location in the file"... which is true but irrelevant. I wish these people would RTFM. -- -- Peter da Silva `-_-' ...!seismo!soma!uhnix1!sugar!peter (I said, NO PHOTOS!)