summary refs log tree commit diff stats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Makefile.am10
-rw-r--r--plugins/checksum/Makefile.am9
-rw-r--r--plugins/checksum/checksum.c29
-rw-r--r--plugins/fishlim/Makefile40
-rw-r--r--plugins/fishlim/Makefile.am9
-rw-r--r--plugins/fishlim/keystore.c4
-rw-r--r--plugins/fishlim/plugin_xchat.c6
7 files changed, 50 insertions, 57 deletions
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 4ac35bce..53c59bf9 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -25,5 +25,13 @@ if DO_DOAT
 doatdir = doat
 endif
 
+if DO_FISHLIM
+fishlimdir = fishlim
+endif
+
+if DO_CHECKSUM
+checksumdir = checksum
+endif
+
 #SUBDIRS = . $(pythondir) $(perldir) mailcheck xdcc
-SUBDIRS = . $(pythondir) $(perldir) $(tcldir) $(sasldir) $(doatdir)
+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]);
 	}
diff --git a/plugins/fishlim/Makefile b/plugins/fishlim/Makefile
deleted file mode 100644
index 3f0e93d2..00000000
--- a/plugins/fishlim/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-
-OURCFLAGS = -Wall -Wextra -Wno-unused-parameter -std=c99 -pedantic `pkg-config --cflags glib-2.0 libcrypto` -DG_DISABLE_DEPRECATED=1 -fPIC $(CFLAGS)
-#OURLINKFLAGS = `pkg-config --libs glib-2.0 libcrypto` -shared -fPIC -Wl,-z,defs $(CFLAGS) $(LDFLAGS)
-OURLINKFLAGS = `pkg-config --libs glib-2.0 libcrypto` $(CFLAGS) $(LDFLAGS)
-
-BASE_OBJECTS = irc.o fish.o keystore.o misc.o
-PLUGIN_OBJECTS = $(BASE_OBJECTS) plugin_xchat.o
-TEST_OBJECTS = $(BASE_OBJECTS) test.o
-
-all: fishlim.so test
-
-fish.o: fish.h keystore.h misc.h
-irc.o: irc.h
-keystore.o: keystore.h irc.h fish.h misc.h plugin_xchat.h
-misc.o: misc.h
-test.o: fish.h
-plugin_xchat.o: fish.h irc.h keystore.h plugin_xchat.h
-
-.c.o:
-	$(CC) $(OURCFLAGS) -c $< -o $@
-
-fishlim.so: $(PLUGIN_OBJECTS)
-	$(CC) -shared $(OURLINKFLAGS) $(PLUGIN_OBJECTS) -o $@
-
-test: $(TEST_OBJECTS)
-	$(CC) $(TEST_OBJECTS) -o $@ $(OURLINKFLAGS)
-
-
-.PHONY: all clean distclean install uninstall
-clean:
-	-$(RM) -f $(PLUGIN_OBJECTS) $(TEST_OBJECTS) fishlim.so test
-distclean: clean
-
-install: fishlim.so
-	install -d $(DESTDIR)/usr/lib/xchat/plugins/
-	install -m 644 fishlim.so $(DESTDIR)/usr/lib/xchat/plugins/
-uninstall:
-	rm $(DESTDIR)/usr/lib/xchat/plugins/fishlim.so
-
-
diff --git a/plugins/fishlim/Makefile.am b/plugins/fishlim/Makefile.am
new file mode 100644
index 00000000..951af6cd
--- /dev/null
+++ b/plugins/fishlim/Makefile.am
@@ -0,0 +1,9 @@
+EXTRA_DIST = INSTALL LICENSE README
+
+libdir = $(hexchatlibdir)/plugins
+
+lib_LTLIBRARIES = fishlim.la
+fishlim_la_SOURCES = fish.c irc.c keystore.c misc.c plugin_xchat.c
+fishlim_la_LDFLAGS = -avoid-version -module 
+fishlim_la_LIBADD = 
+INCLUDES = $(COMMON_CFLAGS) -I$(srcdir)/..
diff --git a/plugins/fishlim/keystore.c b/plugins/fishlim/keystore.c
index e628c289..0e211958 100644
--- a/plugins/fishlim/keystore.c
+++ b/plugins/fishlim/keystore.c
@@ -36,7 +36,7 @@ static char *keystore_password = NULL;
 
 
 /**
- * Opens the key store file: ~/.xchat2/blow.ini
+ * Opens the key store file: ~/.config/hexchat/plugin_fishlim.conf
  */
 static GKeyFile *getConfigFile() {
     gchar *filename = get_config_filename();
@@ -63,7 +63,7 @@ static const char *get_keystore_password() {
 
 
 /**
- * Gets a value for a nick/channel from blow.ini. Unlike
+ * Gets a value for a nick/channel from plugin_fishlim.conf. Unlike
  * g_key_file_get_string, this function is case insensitive.
  */
 static gchar *get_nick_value(GKeyFile *keyfile, const char *nick, const char *item) {
diff --git a/plugins/fishlim/plugin_xchat.c b/plugins/fishlim/plugin_xchat.c
index 5e261116..eb2784d3 100644
--- a/plugins/fishlim/plugin_xchat.c
+++ b/plugins/fishlim/plugin_xchat.c
@@ -27,11 +27,7 @@
 #include <string.h>
 
 // #pragma GCC visibility push(default)
-#ifdef _MSC_VER
 #include "xchat-plugin.h"
-#else
-#include <xchat/xchat-plugin.h>
-#endif
 #define XCHAT_MAX_WORDS 32
 // #pragma GCC visibility pop
 
@@ -56,7 +52,7 @@ static xchat_plugin *ph;
  * Returns the path to the key store file.
  */
 gchar *get_config_filename() {
-    return g_build_filename(xchat_get_info(ph, "xchatdirfs"), "blow.ini", NULL);
+    return g_build_filename(xchat_get_info(ph, "xchatdirfs"), "plugin_fishlim.conf", NULL);
 }
 
 /**