summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--configure.in89
-rw-r--r--plugins/Makefile.am6
-rw-r--r--plugins/checksum/Makefile.am9
-rw-r--r--plugins/checksum/checksum.c29
4 files changed, 97 insertions, 36 deletions
diff --git a/configure.in b/configure.in
index ec10b3bd..ac70dfea 100644
--- a/configure.in
+++ b/configure.in
@@ -129,9 +129,13 @@ AC_ARG_ENABLE(tcl,
 [  --enable-tcl[=PATH]       directory with Tcl config file: tclConfig.sh],
         tcl=$enableval, tcl=yes)
 
-AC_ARG_ENABLE(sasl,
-[  --disable-sasl          disable the SASL plugin],
-        sasl=$enableval, sasl=yes)
+AC_ARG_ENABLE(plugin,
+[  --disable-plugin        disable plugin support],
+        plugin=$enableval, plugin=yes)
+
+AC_ARG_ENABLE(checksum,
+[  --disable-checksum      disable the Checksum plugin],
+        checksum=$enableval, checksum=yes)
 
 AC_ARG_ENABLE(doat,
 [  --disable-doat          disable the Do At plugin],
@@ -141,9 +145,9 @@ AC_ARG_ENABLE(fishlim,
 [  --disable-fishlim       disable the FiSHLiM plugin],
         fishlim=$enableval, fishlim=yes)
 
-AC_ARG_ENABLE(plugin,
-[  --disable-plugin        disable plugin support],
-        plugin=$enableval, plugin=yes)
+AC_ARG_ENABLE(sasl,
+[  --disable-sasl          disable the SASL plugin],
+        sasl=$enableval, sasl=yes)
 
 AC_ARG_ENABLE(dbus,
 [  --disable-dbus          disable DBUS support],
@@ -496,17 +500,23 @@ if test "$plugin" = yes; then
 fi
 
 dnl *********************************************************************
-dnl ** SASL *************************************************************
+dnl ** Checksum *********************************************************
 dnl *********************************************************************
 
-if test "$sasl" != "no"; then
-	AC_MSG_CHECKING(for plugin interface used by SASL)
-	sasl=no
+if test "$checksum" != "no"; then
+	checksum=no
+	AC_MSG_CHECKING(for plugin interface used by Checksum)
 	if test "$plugin" = yes; then
-		sasl=yes
 		AC_MSG_RESULT([yes])
+		AC_MSG_CHECKING(for OpenSSL used by Checksum)
+		if test "$openssl" = yes; then
+			checksum=yes
+			AC_MSG_RESULT([yes])
+		else
+			AC_MSG_RESULT([OpenSSL cannot be found, use the --enable-openssl option])
+		fi
 	else
-		AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for SASL])
+		AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option])
 	fi
 fi
 
@@ -546,6 +556,21 @@ if test "$fishlim" != "no"; then
 	fi
 fi
 
+dnl *********************************************************************
+dnl ** SASL *************************************************************
+dnl *********************************************************************
+
+if test "$sasl" != "no"; then
+	AC_MSG_CHECKING(for plugin interface used by SASL)
+	sasl=no
+	if test "$plugin" = yes; then
+		sasl=yes
+		AC_MSG_RESULT([yes])
+	else
+		AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for SASL])
+	fi
+fi
+
 dnl #######################################################################
 dnl # Check for DBUS libraries
 dnl #######################################################################
@@ -638,10 +663,11 @@ AM_CONDITIONAL(DO_GTK, test "x$gtkfe" = "xyes")
 AM_CONDITIONAL(DO_PERL, test "x$perl" = "xyes")
 AM_CONDITIONAL(DO_PYTHON, test "x$python" = "xyes")
 AM_CONDITIONAL(DO_TCL, test "x$tcl" = "xyes")
-AM_CONDITIONAL(DO_SASL, test "x$sasl" = "xyes")
+AM_CONDITIONAL(DO_PLUGIN, test "x$plugin" = "xyes")
+AM_CONDITIONAL(DO_CHECKSUM, test "x$checksum" = "xyes")
 AM_CONDITIONAL(DO_DOAT, test "x$doat" = "xyes")
 AM_CONDITIONAL(DO_FISHLIM, test "x$fishlim" = "xyes")
-AM_CONDITIONAL(DO_PLUGIN, test "x$plugin" = "xyes")
+AM_CONDITIONAL(DO_SASL, test "x$sasl" = "xyes")
 AM_CONDITIONAL(USE_DBUS, test "x$dbus" = "xyes")
 AM_CONDITIONAL(DO_GCONF, test "x$GCONFTOOL" != "xno")
 
@@ -903,9 +929,10 @@ plugins/Makefile
 plugins/python/Makefile
 plugins/perl/Makefile
 plugins/tcl/Makefile
-plugins/sasl/Makefile
+plugins/checksum/Makefile
 plugins/doat/Makefile
 plugins/fishlim/Makefile
+plugins/sasl/Makefile
 intl/Makefile
 po/Makefile.in
 ])
@@ -913,23 +940,33 @@ po/Makefile.in
 echo
 echo HexChat $VERSION
 echo
-echo Building GTK+ Interface .... : $gtkfe
-echo Building TEXT Interface .... : $textfe
+echo GTK+ Interface ...... : $gtkfe
+echo Text Interface ...... : $textfe
 echo
-echo mmx tinting ......... : $mmx\	spelling .............. : $spell
-echo XShm tinting ........ : $shm\	plugin interface ...... : $plugin
+echo MMX tinting ......... : $mmx
+echo XShm tinting ........ : $shm
 if test "$xft" = no; then
-  echo text backend ........ : pango\	nls/gettext ........... : $USE_NLS
+  echo text backend ........ : pango
 else
-  echo text backend ........ : xft\	nls/gettext ........... : $USE_NLS
+  echo text backend ........ : xft
 fi
-echo openssl support ..... : $openssl\	ipv6 support .......... : $ipv6
-echo dbus support ........ : $dbus\	msproxy ntlm \(ISA\) .... : $have_ntlm
+echo openssl support ..... : $openssl
+echo dbus support ........ : $dbus
 echo libnotify support ... : $libnotify
+echo spelling ............ : $spell
+echo plugin interface .... : $plugin
+echo nls/gettext ......... : $USE_NLS
+echo ipv6 support ........ : $ipv6
+echo msproxy ntlm \(ISA\) .. : $have_ntlm
+echo
+echo Perl ................ : $perl
+echo Python .............. : $python
+echo Tcl ................. : $tcl
 echo
-echo Perl ................ : $perl\	SASL .................. : $sasl
-echo Python .............. : $python\	Do At ................. : $doat
-echo Tcl ................. : $tcl\	FiSHLiM ............... : $fishlim
+echo Checksum ............ : $checksum
+echo Do At ............... : $doat
+echo FiSHLiM ............. : $fishlim
+echo SASL ................ : $sasl
 echo
 echo The binary will be installed in $prefix/bin
 echo
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index c8c4a795..53c59bf9 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -29,5 +29,9 @@ if DO_FISHLIM
 fishlimdir = fishlim
 endif
 
+if DO_CHECKSUM
+checksumdir = checksum
+endif
+
 #SUBDIRS = . $(pythondir) $(perldir) mailcheck xdcc
-SUBDIRS = . $(pythondir) $(perldir) $(tcldir) $(sasldir) $(doatdir) $(fishlimdir)
+SUBDIRS = . $(pythondir) $(perldir) $(tcldir) $(sasldir) $(doatdir) $(fishlimdir) $(checksumdir)
diff --git a/plugins/checksum/Makefile.am b/plugins/checksum/Makefile.am
new file mode 100644
index 00000000..747d5de4
--- /dev/null
+++ b/plugins/checksum/Makefile.am
@@ -0,0 +1,9 @@
+EXTRA_DIST = INSTALL LICENSE README
+
+libdir = $(hexchatlibdir)/plugins
+
+lib_LTLIBRARIES = checksum.la
+checksum_la_SOURCES = checksum.c
+checksum_la_LDFLAGS = -avoid-version -module 
+checksum_la_LIBADD = 
+INCLUDES = $(COMMON_CFLAGS) -I$(srcdir)/..
diff --git a/plugins/checksum/checksum.c b/plugins/checksum/checksum.c
index 135764eb..f84eb243 100644
--- a/plugins/checksum/checksum.c
+++ b/plugins/checksum/checksum.c
@@ -22,28 +22,39 @@
 
 #include <stdio.h>
 #include <string.h>
+#include <stdlib.h>
 #include <malloc.h>
 #include <errno.h>
 #include <sys/types.h>
-#include <sys/stat.h>
 #include <openssl/sha.h>
+#include <glib.h>
 
-#include "xchat-plugin.h"
-
-#define BUFSIZE 32768
-#define DEFAULT_LIMIT 256									/* default size is 256 MiB */
-
+#ifdef WIN32
 #ifndef snprintf
 #define snprintf _snprintf
 #endif
 #ifndef stat64
 #define stat64 _stat64
 #endif
+#else
+/* for INT_MAX */
+#include <limits.h>
+#define __USE_LARGEFILE64
+#define _LARGEFILE_SOURCE
+#define _LARGEFILE64_SOURCE
+#endif
+
+#include <sys/stat.h>
+
+#include "xchat-plugin.h"
+
+#define BUFSIZE 32768
+#define DEFAULT_LIMIT 256									/* default size is 256 MiB */
 
 static xchat_plugin *ph;									/* plugin handle */
 static const char name[] = "Checksum";
 static const char desc[] = "Calculate checksum for DCC file transfers";
-static const char version[] = "3.0";
+static const char version[] = "3.1";
 
 /* Use of OpenSSL SHA256 interface: http://adamlamers.com/?p=5 */
 static void
@@ -217,11 +228,11 @@ dccoffer_cb (char *word[], void *userdata)
 static void
 checksum (char *word[], void *userdata)
 {
-	if (!stricmp ("GET", word[2]))
+	if (!g_ascii_strcasecmp ("GET", word[2]))
 	{
 		print_limit ();
 	}
-	else if (!stricmp ("SET", word[2]))
+	else if (!g_ascii_strcasecmp ("SET", word[2]))
 	{
 		set_limit (word[3]);
 	}