[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r2680 - in Extractor: . src/include src/main
From: |
grothoff |
Subject: |
[GNUnet-SVN] r2680 - in Extractor: . src/include src/main |
Date: |
Fri, 28 Apr 2006 15:41:56 -0700 (PDT) |
Author: grothoff
Date: 2006-04-28 15:41:47 -0700 (Fri, 28 Apr 2006)
New Revision: 2680
Modified:
Extractor/ChangeLog
Extractor/configure.ac
Extractor/src/include/platform.h
Extractor/src/main/extract.c
Extractor/src/main/extractor.c
Log:
towards fixing Mantis 1056 (GNUnet bug)
Modified: Extractor/ChangeLog
===================================================================
--- Extractor/ChangeLog 2006-04-28 19:24:35 UTC (rev 2679)
+++ Extractor/ChangeLog 2006-04-28 22:41:47 UTC (rev 2680)
@@ -1,3 +1,11 @@
+Fri Apr 28 16:18:26 PDT 2006
+ Fixing some i18n issues. Specifically, EXTRACTOR_getKeywordTypeAsString
+ will now never return the translated version of the keyword type
+ (before, it *sometimes* returned the translated version, depending on
+ the default gettext domain and translation availability). If
translation
+ is desired, clients should use 'dgettext("libextractor", ret-value)' to
+ translate the returned value.
+
Wed Apr 26 12:20:00 PDT 2006
Some improvements for OpenBSD portability.
Modified: Extractor/configure.ac
===================================================================
--- Extractor/configure.ac 2006-04-28 19:24:35 UTC (rev 2679)
+++ Extractor/configure.ac 2006-04-28 22:41:47 UTC (rev 2680)
@@ -34,37 +34,44 @@
AC_DEFINE(LINUX,1,[This is a Linux system])
AC_DEFINE_UNQUOTED(LINUX,1,[This is a LINUX system])
AM_CONDITIONAL(HAVE_GNU_LD, true)
+ AM_CONDITIONAL(SOMEBSD, false)
XTRA_CPPLIBS=-lstdc++
;;
freebsd*)
AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
AC_CHECK_LIB(c_r, pthread_create)
AM_CONDITIONAL(HAVE_GNU_LD, true)
+ AM_CONDITIONAL(SOMEBSD, true)
;;
openbsd*)
AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
AC_CHECK_LIB(c_r, pthread_create)
AM_CONDITIONAL(HAVE_GNU_LD, true)
+ AM_CONDITIONAL(SOMEBSD, true)
;;
netbsd*)
AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
AC_CHECK_LIB(c_r, pthread_create)
AM_CONDITIONAL(HAVE_GNU_LD, true)
+ AM_CONDITIONAL(SOMEBSD, true)
;;
*solaris*)
AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system])
AC_CHECK_LIB(resolv, res_init)
XTRA_CPPLIBS=-lstdc++
AM_CONDITIONAL(HAVE_GNU_LD, false)
+ AM_CONDITIONAL(SOMEBSD, false)
CFLAGS="-D_POSIX_PTHREAD_SEMANTICS $CFLAGS"
;;
darwin*)
AC_DEFINE_UNQUOTED(DARWIN,1,[This is a Darwin system])
AM_CONDITIONAL(HAVE_GNU_LD, false)
+ AM_CONDITIONAL(SOMEBSD, false)
;;
cygwin*)
AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a CYGWIN system])
LDFLAGS="$LDFLAGS -no-undefined"
+ AM_CONDITIONAL(SOMEBSD, false)
AM_CONDITIONAL(HAVE_GNU_LD, false)
;;
mingw*)
@@ -75,12 +82,14 @@
AC_CHECK_LIB(plibc, plibc_init,,[AC_MSG_ERROR([libextractor requires
PlibC])])
LDFLAGS="$LDFLAGS -no-undefined -Wl,--export-all-symbols"
AM_CONDITIONAL(HAVE_GNU_LD, true)
+ AM_CONDITIONAL(SOMEBSD, false)
;;
*)
AC_MSG_RESULT(Unrecognised OS $host_os)
AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS])
AC_MSG_RESULT(otheros)
AM_CONDITIONAL(HAVE_GNU_LD, false)
+ AM_CONDITIONAL(SOMEBSD, false)
;;
esac
@@ -112,6 +121,7 @@
AM_CONDITIONAL(CYGWIN, test "$build_os" = "cygwin")
AM_CONDITIONAL(MINGW, test "$build_os" = "mingw32")
+
# use '-fno-strict-aliasing', but only if the compiler can take it
if gcc -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1;
then
Modified: Extractor/src/include/platform.h
===================================================================
--- Extractor/src/include/platform.h 2006-04-28 19:24:35 UTC (rev 2679)
+++ Extractor/src/include/platform.h 2006-04-28 22:41:47 UTC (rev 2680)
@@ -30,7 +30,7 @@
#include "config.h"
#include "gettext.h"
-#define _(a) dgettext("libextractor", a)
+#define _(a) dgettext(PACKAGE, a)
#include "plibc.h"
Modified: Extractor/src/main/extract.c
===================================================================
--- Extractor/src/main/extract.c 2006-04-28 19:24:35 UTC (rev 2679)
+++ Extractor/src/main/extract.c 2006-04-28 22:41:47 UTC (rev 2680)
@@ -196,7 +196,7 @@
if (keywords->keywordType == EXTRACTOR_THUMBNAIL_DATA) {
fprintf (handle,
_("%s - (binary)\n"),
- EXTRACTOR_getKeywordTypeAsString(keywords->keywordType));
+ _(EXTRACTOR_getKeywordTypeAsString(keywords->keywordType)));
} else {
if (NULL == EXTRACTOR_getKeywordTypeAsString(keywords->keywordType)) {
if (verbose == YES) {
@@ -207,7 +207,7 @@
} else if (print[keywords->keywordType] == YES)
fprintf (handle,
"%s - %s\n",
- EXTRACTOR_getKeywordTypeAsString(keywords->keywordType),
+ _(EXTRACTOR_getKeywordTypeAsString(keywords->keywordType)),
keyword);
}
free(keyword);
@@ -463,7 +463,8 @@
case 'L':
i = 0;
while (NULL != EXTRACTOR_getKeywordTypeAsString (i))
- printf ("%s\n", EXTRACTOR_getKeywordTypeAsString (i++));
+ printf ("%s\n",
+ _(EXTRACTOR_getKeywordTypeAsString (i++)));
return 0;
case 'n':
nodefault = YES;
@@ -485,7 +486,9 @@
i = 0;
while (NULL != EXTRACTOR_getKeywordTypeAsString (i))
{
- if (0 == strcmp (optarg, EXTRACTOR_getKeywordTypeAsString (i)))
+ if ( (0 == strcmp (optarg, EXTRACTOR_getKeywordTypeAsString (i)))
||
+ (0 == strcmp (optarg, _(EXTRACTOR_getKeywordTypeAsString
(i)))) )
+
{
print[i] = YES;
break;
@@ -517,7 +520,8 @@
i = 0;
while (NULL != EXTRACTOR_getKeywordTypeAsString (i))
{
- if (0 == strcmp (optarg, EXTRACTOR_getKeywordTypeAsString (i)))
+ if ( (0 == strcmp (optarg, EXTRACTOR_getKeywordTypeAsString (i)))
||
+ (0 == strcmp (optarg, _(EXTRACTOR_getKeywordTypeAsString
(i)))) )
{
print[i] = NO;
break;
Modified: Extractor/src/main/extractor.c
===================================================================
--- Extractor/src/main/extractor.c 2006-04-28 19:24:35 UTC (rev 2679)
+++ Extractor/src/main/extractor.c 2006-04-28 22:41:47 UTC (rev 2680)
@@ -358,7 +358,7 @@
EXTRACTOR_getKeywordTypeAsString(const EXTRACTOR_KeywordType type)
{
if ((type >= 0) && (type < HIGHEST_TYPE_NUMBER))
- return gettext(keywordTypes[type]);
+ return keywordTypes[type];
else
return NULL;
}
@@ -1135,7 +1135,7 @@
if (keywords->keywordType == EXTRACTOR_THUMBNAIL_DATA) {
fprintf(handle,
_("%s - (binary)\n"),
- gettext(keywordTypes[keywords->keywordType]));
+ _(keywordTypes[keywords->keywordType]));
} else {
if (keywords->keywordType >= HIGHEST_TYPE_NUMBER)
fprintf(handle,
@@ -1144,7 +1144,7 @@
else
fprintf(handle,
"%s - %s\n",
- gettext(keywordTypes[keywords->keywordType]),
+ _(keywordTypes[keywords->keywordType]),
buf);
}
free(buf);
@@ -1212,14 +1212,15 @@
EXTRACTOR_KeywordList * keywords)
{
char * result = NULL;
- if ( type == NULL )
- return result;
- while (keywords != NULL )
- {
- if ( !strcmp(gettext(keywordTypes[keywords->keywordType]), type) )
- result = keywords->keyword;
- keywords = keywords->next;
- }
+
+ if (type == NULL)
+ return NULL;
+ while (keywords != NULL) {
+ if ( (0 == strcmp(_(keywordTypes[keywords->keywordType]), type)) ||
+ (0 == strcmp(keywordTypes[keywords->keywordType], type) ) )
+ result = keywords->keyword;
+ keywords = keywords->next;
+ }
return result;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r2680 - in Extractor: . src/include src/main,
grothoff <=