[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.c

FILE type

Dave \Crash\ Dummy

9/6/2011 6:30:00 PM

Hi,

Is there a reason why the FILE type (from stdio) is written uppercase ?
Is it related to its opaque nature ?

Thanks.
6 Answers

Jonathan Leffler

9/6/2011 9:40:00 PM

0

On 9/6/11 11:30 AM, yoxoman wrote:
> Is there a reason why the FILE type (from stdio) is written uppercase ?
> Is it related to its opaque nature ?

That was how it was first produced; the standard standardized the
prevailing practice.

--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2011.0612 -- http://dbi...

Keith Thompson

9/6/2011 9:40:00 PM

0

yoxoman <invalid@invalid.invalid> writes:
> Is there a reason why the FILE type (from stdio) is written uppercase ?
> Is it related to its opaque nature ?

Macros are conventionally written in all-caps.

I'm not sure of this, but it's possible that the FILE type was first
introduced when typedef had not yet been added to the language.
If so, the original definition might have been something like:

struct __file_info {
/* ... */
};
#define FILE struct __file_info

In modern C it has to be a typedef (there's no permission to define
it as a macro), but the name stuck.

Another distinct possibility is that whoever invented the name
just thought putting it in all-caps would be a good idea. The C
standard library is not noted for being 100% consistent.

--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.ne...
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"

pete

9/6/2011 10:50:00 PM

0

Keith Thompson wrote:
>
> yoxoman <invalid@invalid.invalid> writes:
> > Is there a reason why the FILE type
> > (from stdio) is written uppercase ?
> > Is it related to its opaque nature ?
>
> Macros are conventionally written in all-caps.

I think that C may be older than that convention.

Besides the many lower case macros in the C library,
there are also lower case macro examples in the standard
such as str() and xstr().

--
pete

DDD

9/7/2011 5:03:00 AM

0

On Sep 7, 6:49 am, pete <pfil...@mindspring.com> wrote:
> Keith Thompson wrote:
>
> > yoxoman <inva...@invalid.invalid> writes:
> > > Is there a reason why the FILE type
> > > (from stdio) is written uppercase ?
> > > Is it related to its opaque nature ?
>
> > Macros are conventionally written in all-caps.
>
> I think that C may be older than that convention.
>
> Besides the many lower case macros in the C library,
> there are also lower case macro examples in the standard
> such as str() and xstr().
>
> --
> pete

Maybe like @ as mail symbol. Why using @ but not other char

Nick Keighley

9/7/2011 10:13:00 AM

0

On Sep 7, 6:02 am, DDD <1983...@gmail.com> wrote:
> On Sep 7, 6:49 am, pete <pfil...@mindspring.com> wrote:
>
>
>
>
>
> > Keith Thompson wrote:
>
> > > yoxoman <inva...@invalid.invalid> writes:
> > > > Is there a reason why the FILE type
> > > > (from stdio) is written uppercase ?
> > > > Is it related to its opaque nature ?
>
> > > Macros are conventionally written in all-caps.
>
> > I think that C may be older than that convention.
>
> > Besides the many lower case macros in the C library,
> > there are also lower case macro examples in the standard
> > such as str() and xstr().
>
> Maybe like @ as mail symbol. Why using @ but not other char[?]

because it's prnounced "at"

nick keighley AT hotmail.com

The old JANET network used to put addresses before names (seems a
sensible order for a computer), X.400 is just... ik

gwowen

9/7/2011 12:25:00 PM

0

On Sep 7, 11:12 am, Nick Keighley <nick_keighley_nos...@hotmail.com>
wrote:

> The old JANET network used to put addresses before names (seems a
> sensible order for a computer),

As did UUCP bang paths, for essentially the same reason (users were
better at routing than systems)