This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Streams and STDIO internals quandry ...
- To: help-gcc at gnu dot org
- Subject: Re: Streams and STDIO internals quandry ...
- From: A-Du-ReaNOGI at EsperNOGO dot Com (Art Du Rea: NoGargbageIn:NoGarbageOut)
- Date: Fri, 03 Sep 1999 00:35:01 GMT
- Newsgroups: gnu.gcc.help
- References: <37ce0d28.45372236@news>
- Xref: wodc7nx0 gnu.gcc.help:831
A-Du-ReaNOGI@EsperNOGO.Com (Art Du Rea: NoGargbageIn:NoGarbageOut) wrote:
>I'm trying to implement a basic STDIO system for Motorola DSP Evaluation boards using an
>RS-232 com port on the EVM board talking to HyperTerminal on a Com port on a PC. Motorola
>provides a version of GNU C tailored to their DSPs. They do NOT provide any primitive
>send/receive functions for the STDIO system.
>
>I have made a lot of progress ... all the code is written and I am in the middle of
>debugging it. I am now in stdin, in particular the "fread" function. From the Motorola
>source code, there doesn't appear to be any way for the "console terminal" to pass an
>"End-of-file" to the fread function if a terminator (Enter = Carriage Return) is reached
>before the provided buffer is filled. This results in extra reads in my system.
I solved the problem ... I modified the Motorola provided "read.c" interface to accept an
IOEOF status word during the Status Check receive call and load it directly into the flag
word in the stdin stream/file header. That's where fread.c looks for it.
All the best, and ENJOY!
Art Du Rea
Knoxville, Tennessee, USA
(Remove NOGI:NOGO for direct e-mail)