summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2013-11-11 17:41:31 +0100
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2013-11-11 17:41:31 +0100
commit62da7abf083ca1f9305f66c5f9f0683267a01e65 (patch)
tree5f37e274d76f236249e54591160c1b46ef0c8724
parent77707bc1f75c237d1e4ecdab3fbf567a8d0ac3e8 (diff)
downloadlibrcc-62da7abf083ca1f9305f66c5f9f0683267a01e65.tar.gz
librcc-62da7abf083ca1f9305f66c5f9f0683267a01e65.tar.bz2
librcc-62da7abf083ca1f9305f66c5f9f0683267a01e65.tar.xz
librcc-62da7abf083ca1f9305f66c5f9f0683267a01e65.zip
Support LibGuess 1.1
-rw-r--r--VERSION2
-rw-r--r--configure.in3
-rw-r--r--engines/libguess.c24
3 files changed, 26 insertions, 3 deletions
diff --git a/VERSION b/VERSION
index 13dead7..c0be11a 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.2.10
+0.2.11CVS
diff --git a/configure.in b/configure.in
index 1a71607..32c0f10 100644
--- a/configure.in
+++ b/configure.in
@@ -239,13 +239,14 @@ if test "x$enable_force_dynamic_engines" != "xyes"; then
])])
fi
-AC_CHECK_HEADER(libguess.h, [AC_CHECK_LIB(guess, guess_jp, [
+AC_CHECK_HEADERS([libguess/libguess.h libguess.h], [AC_CHECK_LIB(guess, guess_jp, [
AC_DEFINE(HAVE_LIBGUESS,1,[Defines if libguess is available])
LIBGUESS_LIBS="-lguess"
LIBGUESS_INCLUDES=""
HAVE_LIBGUESS=yes
])])
+
AM_CONDITIONAL(HAVE_RCD, [ test "x$HAVE_RCD" = "xyes" ])
AM_CONDITIONAL(HAVE_ENCA, [ test "x$HAVE_ENCA" = "xyes" ])
AM_CONDITIONAL(HAVE_LIBGUESS, [ test "x$HAVE_LIBGUESS" = "xyes" ])
diff --git a/engines/libguess.c b/engines/libguess.c
index 18d2ca5..dd89ced 100644
--- a/engines/libguess.c
+++ b/engines/libguess.c
@@ -19,9 +19,31 @@
#include <stdio.h>
#include <string.h>
+#include "../config.h"
#include <librcc.h>
-#include <libguess.h>
+
+#ifdef HAVE_LIBGUESS_LIBGUESS_H
+# include <libguess/libguess.h>
+static const char *guess_jp(const char *buf, int buflen) {
+ return libguess_determine_encoding(buf, buflen, GUESS_REGION_JP);
+}
+
+static const char *guess_cn(const char *buf, int buflen) {
+ return libguess_determine_encoding(buf, buflen, GUESS_REGION_CN);
+}
+
+static const char *guess_tw(const char *buf, int buflen) {
+ return libguess_determine_encoding(buf, buflen, GUESS_REGION_TW);
+}
+
+static const char *guess_kr(const char *buf, int buflen) {
+ return libguess_determine_encoding(buf, buflen, GUESS_REGION_KR);
+}
+
+#else /* HAVE_LIBGUESS_H */
+# include <libguess.h>
+#endif /* HAVE_LIBGUESS_LIBGUESS_H */
#define UTF8_ID 0
#define UTF16_ID 1