From: Hans U. N. <gp...@n-...> - 2005-05-04 13:49:19
|
Lutz M=C3=BCller <lu...@us...> writes: > On Tue, 2005-05-03 at 13:03 +0200, Hans Ulrich Niedermann wrote: >> > I don't like the static variable in exif_init_gettext at all. Is >>=20 >> (Note for reference: "static" means "global" here.) >>=20 >> Why don't you like it? > > They are evil in combination with threads. glibc does proper locking, so > let's glibc take care of that. Sounds good :-) >> > "bindtextdomain" that expensive that we can't call it in every function >> > that returns strings? >>=20 >> IMHO, yes. It has to search the filesystem for files. > > As far as I can see in glibc/intl/bindtextdom.c, it first checks if the > value changed. Then a simple wrapper function without any variable checks will do. > Anyways, everything the frontend needs to know in order to get proper > translation is GETTEXT_PACKAGE and LOCALEDIR. What about creating a > libexif/exif-config.h file with those variables? > > /*=20 > * You need to call bindtextdomain & friends first=20 > * with those variables if you would like to=20 > * get proper translations. > */=20 > #define EXIF_GETTEXT_PACKAGE "libexif-12" > #define EXIF_GETTEXT_LOCALEDIR "/some/path" > > /* Name, version... */ > #define EXIF_PACKAGE_NAME "..." > #define EXIF_PACKAGE_VERSION "..." Bad idea. What if any of these values changes from one library version to another? You would have to recompile (relink doesn't help here) all applications. Uli |