On 2005-01-28, Rene W. Olsen wrote:
Hello
As many of you know I'm porting libusb to os4.
The source code uses serverl functions like snprintf() and strerror(). I wantede to use clib2 but thats ad no-no from library code, then I turn to newlib but dident have the inclide files :(
Neither snprintf() nor strerror() should be problematic to call from library code I think. (?)
So here I'm what to do ? The only thing I can think of is to rip the source code from clib2 an include it in my lib but that not the best sulution IMHO.
Unless you need the full printf-style formatting with all bells and whistles, it should be relatively easy to reimplement snprintf but there is also the possibility of using exec.library/RawDoFmt() to do printf style formatting.
As for strerror(), you can always use a static array of char * for an initial non-localised version until a better alternative comes up if this is what is bugging you. It might well be that this is how clib2 implements strerror (I have not checked). Otherwise I don't think I can add very much on the localisation issuse since I have not examined the locale API to speak of.
-Peter aka. Archprogrammer
Reality is for people who cannot face ScienceFiction. Only lefthanded people are in their right minds.