From: <lu...@us...> - 2003-05-05 21:13:47
|
Update of /cvsroot/libexif/exif/exif In directory sc8-pr-cvs1:/tmp/cvs-serv32318/exif Modified Files: Makefile.am actions.c main.c Added Files: exif-i18n.c exif-i18n.h Log Message: 2003-05-05 Lutz Mueller <lu...@us...> * exif/exif-i18n.[c,h]: New. Suggested by Gernot Jander <ge...@bi...>. --- NEW FILE: exif-i18n.c --- #include <config.h> #include "exif-i18n.h" #include <iconv.h> #include <string.h> #undef MIN #define MIN(a, b) (((a) < (b)) ? (a) : (b)) const char * exif_i18n_convert_utf8_to_lat1 (const char *in) { static iconv_t tr = 0; unsigned int t = (in ? strlen (in) : 0); static char buf[2048]; unsigned int buf_size = sizeof (buf); char *out = buf; if (!in) return NULL; memset (buf, 0, sizeof (buf)); if (!tr) tr = iconv_open ("ISO-8859-1", "UTF-8"); iconv (tr, (char **) &in, &t, (char **) &out, &buf_size); return buf; } --- NEW FILE: exif-i18n.h --- (This appears to be a binary file; contents omitted.) Index: Makefile.am =================================================================== RCS file: /cvsroot/libexif/exif/exif/Makefile.am,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Makefile.am 15 Nov 2002 21:32:20 -0000 1.12 +++ Makefile.am 5 May 2003 21:13:44 -0000 1.13 @@ -9,6 +9,7 @@ exif_SOURCES = \ actions.h actions.c \ + exif-i18n.h exif-i18n.c \ main.c \ utils.h utils.c exif_LDADD = \ Index: actions.c =================================================================== RCS file: /cvsroot/libexif/exif/exif/actions.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- actions.c 15 Dec 2002 11:39:13 -0000 1.12 +++ actions.c 5 May 2003 21:13:44 -0000 1.13 @@ -20,6 +20,7 @@ #include "config.h" #include "actions.h" +#include "exif-i18n.h" #include <stdio.h> #include <stdlib.h> @@ -27,25 +28,6 @@ #include <libexif/exif-ifd.h> -#ifdef ENABLE_NLS -# include <libintl.h> -# undef _ -# define _(String) dgettext (PACKAGE, String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define textdomain(String) (String) -# define gettext(String) (String) -# define dgettext(Domain,Message) (Message) -# define dcgettext(Domain,Message,Type) (Message) -# define bindtextdomain(Domain,Directory) (Domain) -# define _(String) (String) -# define N_(String) (String) -#endif - #define ENTRY_FOUND " * " #define ENTRY_NOT_FOUND " - " @@ -67,7 +49,7 @@ name = exif_tag_get_title (tag); if (!name) continue; - fprintf (stdout, " 0x%04x %-29.29s", tag, name); + fprintf (stdout, " 0x%04x %-29.29s", tag, C(name)); for (i = 0; i < EXIF_IFD_COUNT; i++) if (exif_content_get_entry (ed->ifd[i], tag)) printf (ENTRY_FOUND); @@ -107,19 +89,19 @@ #endif static void -show_entry (ExifEntry *entry, void *data) +show_entry (ExifEntry *e, void *data) { unsigned char *ids = data; if (*ids) - fprintf (stdout, "0x%04x", entry->tag); + fprintf (stdout, "0x%04x", e->tag); else - fprintf (stdout, "%-20.20s", exif_tag_get_title (entry->tag)); + fprintf (stdout, "%-20.20s", C(exif_tag_get_title (e->tag))); printf ("|"); if (*ids) - fprintf (stdout, "%-72.72s", exif_entry_get_value (entry)); + fprintf (stdout, "%-72.72s", C(exif_entry_get_value (e))); else - fprintf (stdout, "%-58.58s", exif_entry_get_value (entry)); + fprintf (stdout, "%-58.58s", C(exif_entry_get_value (e))); fputc ('\n', stdout); } Index: main.c =================================================================== RCS file: /cvsroot/libexif/exif/exif/main.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- main.c 11 Feb 2003 06:47:02 -0000 1.34 +++ main.c 5 May 2003 21:13:44 -0000 1.35 @@ -18,7 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#include "config.h" +#include <config.h> #include <errno.h> #include <stdlib.h> @@ -36,27 +36,9 @@ #include "libjpeg/jpeg-data.h" #include "actions.h" +#include "exif-i18n.h" #include "utils.h" -#ifdef ENABLE_NLS -# include <libintl.h> -# undef _ -# define _(String) dgettext (PACKAGE, String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define textdomain(String) (String) -# define gettext(String) (String) -# define dgettext(Domain,Message) (Message) -# define dcgettext(Domain,Message,Type) (Message) -# define bindtextdomain(Domain,Directory) (Domain) -# define _(String) (String) -# define N_(String) (String) -#endif - #ifdef HAVE_LOCAL_H # include <locale.h> #endif @@ -70,8 +52,8 @@ show_entry (ExifEntry *entry, const char *caption) { printf (_("EXIF entry '%s' (0x%x, '%s') exists in IFD '%s':"), - exif_tag_get_title (entry->tag), entry->tag, - exif_tag_get_name (entry->tag), caption); + C(exif_tag_get_title (entry->tag)), entry->tag, + C(exif_tag_get_name (entry->tag)), caption); printf ("\n"); exif_entry_dump(entry, 0); @@ -83,8 +65,8 @@ show_note_entry (MNoteData *note, MNoteTag tag) { printf (_("MakerNote entry '%s' (0x%x, '%s'):"), - mnote_tag_get_title (note, tag), tag, - mnote_tag_get_name (note, tag)); + C(mnote_tag_get_title (note, tag)), tag, + C(mnote_tag_get_name (note, tag))); printf ("\n"); mnote_data_dump_entry(note, tag, 0); @@ -278,9 +260,9 @@ return (1); } printf (_("Tag '%s' (0x%04x, '%s'): %s"), - exif_tag_get_title (eo.tag), eo.tag, - exif_tag_get_name (eo.tag), - exif_tag_get_description (eo.tag)); + C(exif_tag_get_title (eo.tag)), eo.tag, + C(exif_tag_get_name (eo.tag)), + C(exif_tag_get_description (eo.tag))); printf ("\n"); return (0); } |