avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] snprintf, but no vsnprintf? Or "crosstalk" between st


From: Joerg Wunsch
Subject: Re: [avr-libc-dev] snprintf, but no vsnprintf? Or "crosstalk" between streams.
Date: Tue, 11 Nov 2003 23:56:56 +0100
User-agent: Mutt/1.2.5i

As Mike Panetta wrote:

> Hopefully this message is on topic...

It certainly is.

>  I origionally posted it to the
> avr list at avr1.org.

I'd consider that less suited.  Maybe you just formally ``withdraw'' it
there (following up to yourself) so to avoid a forked discussion in both
lists?

> > Update on this message.  Since I tried to send this yesterday, I have
> > tried implementing the functions using the fdevopen and vfprintf(_P)
> > interfaces, with pretty good success.

That seems to be the wrong way to me.  This should be handled by
adding the required library stub, that effectively calls vfprintf()
then.  It seems I've (merely accidentally, not on purpose) forgotten
about a few members of the printf() family when I originally
implemented most of stdio.  Ted Roth recently added another couple of
functions there.  All the printf() family members wrap in some way
around vfprintf(), where the s*printf() functions use an internal flag
to tell vfprintf() that output goes to a buffer and not to a stream.
The wrapper needs to setup an internal struct __file for it which is
only used on a temporary (automatic) variable.

I can perhaps write that myself by tomorrow night if you want.

> > ... when I use my printf function to print to the display, it
> > also prints to the serial port

Hmm, that is of course not supposed to happen.

-- 
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]