Re: C90 fpeek

Liste des GroupesRevenir à cl c 
Sujet : Re: C90 fpeek
De : mutazilah (at) *nospam* gmail.com (Paul Edwards)
Groupes : comp.lang.c
Date : 24. Jan 2025, 06:41:39
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vmv96o$23d5m$1@dont-email.me>
References : 1 2
User-Agent : Microsoft Outlook Express 6.00.2800.1106
"Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message
news:87plkc6bgm.fsf@nosuchdomain.example.com...
"Paul Edwards" <mutazilah@gmail.com> writes:
[...]
With the benefit of hindsight, is there any reason why fpeek
couldn't have been added to C90, with implementations
being allowed with just a macro that returns some sort of
"unsupported"?
>
If fpeek (or similar) makes sense, can someone suggest an
appropriate interface?
[...]
>
It would help to know what "fpeek" is supposed to do.  There no such
function in any edition of the C standard or in any implementation
that I'm aware of.

fpeek would tell you whether there are any characters available
to be read, on a bidirectional data stream, opened with r+b or
whatever.

For an ordinary disk file, it wouldn't necessarily do anything,
and just return with "unknown" or whatever, for the application
to decide what to do.

But for a serial port/modem connected to a BBS, the infrastructure
would likely already know if there are characters sitting at the COM
port (or some corresponding buffer), so it would be in a position to
confirm/deny the presence of pending characters to be read.

It also occurred to me that games could use this, fpeek of stdin to
see if a key has been pressed.

Apologies for not making this clearer in the original post.

BFN. Paul.



Date Sujet#  Auteur
24 Jan 25 * C90 fpeek18Paul Edwards
24 Jan 25 +* Re: C90 fpeek16Keith Thompson
24 Jan 25 i+* Re: C90 fpeek3Paul Edwards
24 Jan 25 ii`* Re: C90 fpeek2Kaz Kylheku
24 Jan 25 ii `- Re: C90 fpeek1Paul Edwards
24 Jan 25 i+* Re: C90 fpeek3James Kuyper
24 Jan 25 ii`* Re: C90 fpeek2Michael S
26 Jan 25 ii `- Re: C90 fpeek1Lawrence D'Oliveiro
24 Jan 25 i`* Re: C90 fpeek9Kaz Kylheku
24 Jan 25 i +* Re: C90 fpeek4Chris M. Thomasson
25 Jan 25 i i+* Re: C90 fpeek2Kaz Kylheku
25 Jan 25 i ii`- Re: C90 fpeek1Chris M. Thomasson
26 Jan 25 i i`- Re: C90 fpeek1Lawrence D'Oliveiro
25 Jan 25 i +* Re: C90 fpeek3Paul Edwards
26 Jan 25 i i`* Re: C90 fpeek2Lawrence D'Oliveiro
27 Jan 25 i i `- Re: C90 fpeek1Paul Edwards
25 Jan 25 i `- Re: C90 fpeek1Kaz Kylheku
24 Jan 25 `- Re: C90 fpeek1Kaz Kylheku

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal