Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: stdin/stdout



In message <email@hidden>, Steve Chec
koway writes:
>Okay, upon further investigation, I've discovered that the tests are
>only meant to be run by the developers of flex (and that most if not
>all of the errors stem from failing to include <stdint.h>). As for the
>assigning to stdin and stdout, I removed those sections entirely since
>before doing that dup2 was being called to set the file descriptor and
>I believe that that is sufficient (correct?).

I think it works, but it's hardly officially sanctioned.

>I suppose the only question that remains is why stdin and friends are
>defined as they are rather than as FILE*s.

They are FILE*'s. The standard IO streams are defined to be expressions
of type FILE*, which they are; they are not defined to be objects. This
is why the standard provides freopen(). Yes, some of the Unixy standards
are extending this, but I have not seen much in the way of legitimate reasons
to do this instead of using freopen(). (There are some, but they're so
inherently unportable that it hardly matters.)

-s
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: stdin/stdout (From: Steve Checkoway <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.