From 62da7abf083ca1f9305f66c5f9f0683267a01e65 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Mon, 11 Nov 2013 17:41:31 +0100 Subject: Support LibGuess 1.1 --- VERSION | 2 +- configure.in | 3 ++- engines/libguess.c | 24 +++++++++++++++++++++++- 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 #include +#include "../config.h" #include -#include + +#ifdef HAVE_LIBGUESS_LIBGUESS_H +# include +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 +#endif /* HAVE_LIBGUESS_LIBGUESS_H */ #define UTF8_ID 0 #define UTF16_ID 1 -- cgit v1.2.3