Re: [AD] (v)sprintf vs (v)sNprintf

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Thu, Dec 12, 2002 at 04:07:47PM +0100, Eric Botcazou wrote:
> > We already have usnprintf, no? Can't we just make snprintf()
> > set the mode to ASCII and then call usnprintf()?
> 
> I think that doing so is dangerous, because we could change
> the encoding format while the user is using the string
> functions. Moreover set_uformat() is supposed to be called only
> once before allegro_init().

set_uformat being a global thing is convenient, but quite painful to
deal with when you want to do threaded things, or just the above. In
fact, set_uformat is predated by the chicken and egg problem which
was noted down long ago:

 http://glub.ehu.es/mlist/allegro_conductors/2001/5775.html

Maybe string functions need additional parameters to avoid such
encoding conversions, at the expense of complicating the api. In
fact, if the talk at Alleg5 continues and it's all split in smaller
libs, there's no way a global variable will satisfy Allegro itself,
addon libs and user code at the same time.



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/