This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: ftstc implementation
- From: Suhas Chakravarty <suhas dot chakravarty at gmail dot com>
- To: "Carlos O'Donell" <carlos at systemhalted dot org>
- Cc: "libc-help at sourceware dot org" <libc-help at sourceware dot org>
- Date: Mon, 11 Aug 2014 11:14:50 +0530
- Subject: Re: ftstc implementation
- Authentication-results: sourceware.org; auth=none
- References: <CABKwiS_RQpKE6Q_SM9QS-bH-6wDEP+nOMhiEaU7h6hS7dJfs1w at mail dot gmail dot com> <CABKwiS8fc=Mx92i0tiO0O-PS-ahmfwqL6gK-_NsRrEht+51s1Q at mail dot gmail dot com> <CAE2sS1gr4w9uXzOfeFUW1tphGMyeJKMdqaQB6-rtonn1Vrk3Dw at mail dot gmail dot com>
Hi Carlos
Sorry about replying late. Yes, I am attempting port a stripped down
version of uboot to the GNU compiler toolchain. The comments in uboot
code imply that tstc() and ftstc() are used to test for the presence
of a character in stdin or a file, without actually reading it. For
now I have thought of implementing it as a getc() followed by
ungetc(). Do you think that's a good enough implementation?
Regards
Suhas
On Sat, Aug 9, 2014 at 8:28 PM, Carlos O'Donell <carlos@systemhalted.org> wrote:
> On Wed, Aug 6, 2014 at 2:26 PM, Suhas Chakravarty
> <suhas.chakravarty@gmail.com> wrote:
>> Is ftstc()'s implementation provided as part of libc? It tests for the
>> presence of a char in stdin/file.
>
> The ftstc() function is not provided by glibc.
>
> I'm not that familiar with these functions, but believe they are BSD
> extensions and that tstc() also exists, but is not implemented by
> glibc.
>
> Why do you ask? Are you porting software to GNU/Linux and finding that
> glibc doesn't provide these functions?
>
> Do you have a reference anywhere that explains what these functions do?
>
> Cheers,
> Carlos.