Re: help in the declaration in stdio.h
Re: help in the declaration in stdio.h
- Subject: Re: help in the declaration in stdio.h
- From: mm w <email@hidden>
- Date: Tue, 19 May 2009 13:26:08 -0700
_P means prototype, this is an old concern and in 2009, you should
not pay attention to K&R patch syntax
(ten year after the last major revision of the standard), this is a
bad idea to dig into BSD Lite/2 code,
prefer a modern BSD source that you can run on descent modern CPU, if
you are confused by
the "size of" you may remove other arch-dependency entries.
what was the trick:
# ifdef ANSI
#define PROTOTYPE(symbol) symbol
#else
#define PROTOTYPE(symbol) () // NIL for K&R
#endif
K&R prototype is an oxymoron.
Best,
On Mon, May 18, 2009 at 11:52 PM, Terry Lambert <email@hidden> wrote:
> Look at the BSD Lite/2 <sys/cdefs.h>.
>
> PS: You can't use the BSD Lite2 <stdio.h> with Mac OS X; things will
> seriously break.
>
> -- Terry
>
> On May 18, 2009, at 10:12 PM, alex alex wrote:
>>
>> hi,guy:
>>
>> Thanks for you answer and now whether the definition __P is a macro
>> definition or not? If yes, where it is declarated and what's the
>> declaration?
>>
>>
>> thanks!
>>
>> alex
>>
>> 2009-5-19
>>
>> > Date: Mon, 18 May 2009 21:10:12 -0700
>> > Subject: Re: help in the declaration in stdio.h
>> > From: email@hidden
>> > To: email@hidden
>> > CC: email@hidden
>> >
>> > This is a basic k&r function pointer declaration anyway not really the
>> > list to learn C (should be rewritten :-) ) look for websites C for
>> > dummies function pointer ecetera
>> >
>> > Cheers!
>> > On Monday, May 18, 2009, alex alex <email@hidden> wrote:
>> > >
>> > >
>> > >
>> > >
>> > >
>> > > hi:
>> > >
>> > > I have confused by the following declaration such as :
>> > >
>> > > /* operations */
>> > > void *_cookie; /* cookie passed to io functions */
>> > > int (*_close) __P((void *));
>> > > int (*_read) __P((void *, char *, int));
>> > > fpos_t (*_seek) __P((void *, fpos_t, int));
>> > > int (*_write) __P((void *, const char *, int));
>> > >
>> > > which are in stdio.h of bsd lite2 source code.
>> > >
>> > > I do not understand this kind of declaration.I will be very
>> > > approciate if anybody can answer me.
>> > >
>> > > Thanks!
>> > >
>> > > alex
>> > >
>> > > 2009-5-19
>> > >
>> > > Invite your mail contacts to join your friends list with Windows Live
>> > > Spaces. It's easy! Try it!
>> > >
>>
>> What can you do with the new Windows Live? Find out
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Darwin-kernel mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden