swprintf() and friends?

Jeff Johnston jjohnstn@redhat.com
Wed Nov 12 19:25:00 GMT 2008


Corinna Vinschen wrote:
> On Nov  3 16:26, Jeff Johnston wrote:
>   
>> For fwide support, I assume you mean two bits and yes, I believe two bits 
>> would work.  One bit would mean decided (0 = undecided) and this should 
>> take the free bit I mention above.  The __srefill_r and __sfvwrite_r 
>> functions could be modified to stamp a file as being narrow/wide and 
>> decided, if currently undecided (an extra argument would be needed to these 
>> functions to say which type of fn was calling).  If setting and the file is 
>> already undecided, then we must resolve any std stream first.  The decided 
>> orientation bit would be in _flags (0 = narrow, 1 = wide).
>>     
>
> On second reading... what do you mean by "resolve any std stream first"?
>
>   
The _REENT_SMALL platforms don't have space for the std FILEs allocated 
at start-up.  They have fake files
(first part of a real FILE structure which is smaller) and these fake 
files have the _flags and buffer fields enough to cause a function call 
to occur if using a macro like getc() or putc().  They will not have a 
_flags2 field.  The function call ends up resolving the fake std streams 
via the CHECK_INIT macro.

Anyway, my comment was unnecessary.  To get to the __srefill_r or 
__sfvwrite_r functions, the std streams have  to already be resolved at 
that point which means they will have a full FILE structure and the 
_flags2 field will exist for them at that point.

-- Jeff J.
> Corinna
>
>   



More information about the Newlib mailing list