[sldev] Alternate sscanf (was: Issue for tonight's meeting VWR-729)
Alissa Sabre
alissa_sabre at yahoo.co.jp
Mon Mar 17 09:59:32 PDT 2008
Ahhhhh, silly me!
> don't call stdio scanning and
> formatting routines for these operations
> This would not need to be a full replacement
> for *printf/*scanf,
> David Gay's strtod()
Argent, you are right! We only need strtod(). Full sscanf()
functionality is not needed for the purpose.
THEN, we already have that particular function available in glib (glib
is a lower layer library of GTK.) It is g_ascii_strtod(). It works
just as the standard strtod() function as if it is invoked under the C
locale, ignoring the current locale settings. This is what exactly we
need.
This finding made me consider that the best solution to this issue is
to rewrite SL viewer source code using glib's locale independent
functions, and run the SL viewer entirely under the user's locale. It
should hopefully eliminate the needs for paired setlocale calls to
save/restore locale.
I will try it on this weekend and report back here for your comments.
Alissa Sabre
--------------------------------------
Easy + Joy + Powerful = Yahoo! Bookmarks x Toolbar
http://pr.mail.yahoo.co.jp/toolbar/
More information about the SLDev
mailing list