Newsgroups: comp.sys.next
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usenet
From: Garance_Drosehn@mts.rpi.edu
Subject: Re: C Programming questions
Message-ID: <n!fgrbj@rpi.edu>
Nntp-Posting-Host: gilead.its.rpi.edu
Reply-To: gad@eclipse.its.rpi.edu
Organization: Rensselaer Polytechnic Institute
References: <h4+gjkn@rpi.edu> <1466@toaster.SFSU.EDU> <jwright.670841680@cfht.hawaii.edu> <71369@brunix.UUCP> <jwright.671358522@cfht.hawaii.edu>
Date: 11 Apr 91 16:30:48 GMT
Lines: 39

In article <jwright.671358522@cfht.hawaii.edu> 
            jwright@cfht.hawaii.edu (Jim Wright) writes:
>rca@cs.brown.edu (Ronald C.F. Antony) writes:
> jwright@cfht.hawaii.edu (Jim Wright) writes:
jim1> [no mention of return value for fprintf in digital librarian]
>
ron1> For UNIX questions look in the MAN PAGES, and NOT in the NeXT
ron1> Developer Docs.
ron1> If you are interested further in this topic, have a look at the
ron1> vprintf, vfprintf and vsprintf functions and their MAN PAGE entry.
>
jim2>I have the unix man pages included in digital librarian.  Isn't this
jim2>the default?  So yes, thank you, I did RTFM.
>
jim2>Still no answer as to what NeXT thinks the return value is.

As the guy who started this question (even though I'm not in the above
exchange), thanks to Ron for pointing me in the right direction.  I still would
prefer that all C functions on the NeXT followed the ANSI C standard definition
for them, of course, but at least there was an answer buried in the man pages.

And for Ron: the man page for fprintf doesn't give the answer, but if you use
the digital librarian to search the man pages for "fprintf" you'll also get a
match on a "stdio" man page.  That explains the return values.  What it says
is:
      An integer constant EOF (-1) is returned upon end-of-file or
      error by integer functions [in the STDIO set] that deal with
      streams.

Of course, that doesn't mean the functions are required to return zero if there
is no error.  Not sure how much code would depend on the "EOF or nothing" (so
to speak :-) return value for fprintf & friends (especially since the ANSI
standard defines a different return value), but I imagine some code might.

Sigh.  Just proves the old adage, I guess: "The nice thing about standards is
that there are so many to choose from"...

Garance_Drosehn@mts.rpi.edu
  = gad@eclipse.its.rpi.edu for Next-Mail
