changeset 13190:60b863ecd89b

[gaim-migrate @ 15553] perl scripts can use signal priority now. Also it's always bothered me that the debug and signal stuff was just stuck at the bottom of Gaim.xs so I've moved them to their own files, committer: Tailor Script <tailor@pidgin.im>
author Etan Reisner <pidgin@unreliablesource.net>
date Wed, 08 Feb 2006 23:13:56 +0000
parents 7ff1d941f8e5
children a0dfbd5c3b03
files plugins/perl/common/Debug.xs plugins/perl/common/Gaim.xs plugins/perl/common/Makefile.mingw plugins/perl/common/Signal.xs plugins/perl/perl-handlers.c plugins/perl/perl-handlers.h
diffstat 6 files changed, 88 insertions(+), 63 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/perl/common/Debug.xs	Wed Feb 08 23:13:56 2006 +0000
@@ -0,0 +1,42 @@
+#include "module.h"
+
+MODULE = Gaim::Debug  PACKAGE = Gaim::Debug  PREFIX = gaim_debug_
+PROTOTYPES: ENABLE
+
+void
+gaim_debug(level, category, string)
+	Gaim::DebugLevel level
+	const char *category
+	const char *string
+
+void
+gaim_debug_misc(category, string)
+	const char *category
+	const char *string
+
+void
+gaim_debug_info(category, string)
+	const char *category
+	const char *string
+
+void
+gaim_debug_warning(category, string)
+	const char *category
+	const char *string
+
+void
+gaim_debug_error(category, string)
+	const char *category
+	const char *string
+
+void
+gaim_debug_fatal(category, string)
+	const char *category
+	const char *string
+
+void
+gaim_debug_set_enabled(enabled)
+	gboolean enabled
+
+gboolean
+gaim_debug_is_enabled()
--- a/plugins/perl/common/Gaim.xs	Wed Feb 08 22:15:46 2006 +0000
+++ b/plugins/perl/common/Gaim.xs	Wed Feb 08 23:13:56 2006 +0000
@@ -11,6 +11,7 @@
 GAIM_PERL_BOOT_PROTO(Cmd);
 GAIM_PERL_BOOT_PROTO(Connection);
 GAIM_PERL_BOOT_PROTO(Conversation);
+GAIM_PERL_BOOT_PROTO(Debug);
 GAIM_PERL_BOOT_PROTO(Xfer);
 GAIM_PERL_BOOT_PROTO(ImgStore);
 GAIM_PERL_BOOT_PROTO(Log);
@@ -27,6 +28,7 @@
 GAIM_PERL_BOOT_PROTO(Roomlist);
 GAIM_PERL_BOOT_PROTO(SSL);
 GAIM_PERL_BOOT_PROTO(SavedStatus);
+GAIM_PERL_BOOT_PROTO(Signal);
 GAIM_PERL_BOOT_PROTO(Sound);
 GAIM_PERL_BOOT_PROTO(Status);
 GAIM_PERL_BOOT_PROTO(Stringref);
@@ -47,6 +49,7 @@
 	GAIM_PERL_BOOT(Cmd);
 	GAIM_PERL_BOOT(Connection);
 	GAIM_PERL_BOOT(Conversation);
+	GAIM_PERL_BOOT(Debug);
 	GAIM_PERL_BOOT(Xfer);
 	GAIM_PERL_BOOT(ImgStore);
 	GAIM_PERL_BOOT(Log);
@@ -63,6 +66,7 @@
 	GAIM_PERL_BOOT(Roomlist);
 	GAIM_PERL_BOOT(SSL);
 	GAIM_PERL_BOOT(SavedStatus);
+	GAIM_PERL_BOOT(Signal);
 	GAIM_PERL_BOOT(Sound);
 	GAIM_PERL_BOOT(Status);
 	GAIM_PERL_BOOT(Stringref);
@@ -79,65 +83,6 @@
 	gaim_perl_timeout_add(plugin, seconds, callback, data);
 
 void
-signal_connect(instance, signal, plugin, callback, data = 0)
-	void *instance
-	const char *signal
-	Gaim::Plugin plugin
-	SV *callback
-	SV *data
-CODE:
-	gaim_perl_signal_connect(plugin, instance, signal, callback, data);
-
-void
-signal_disconnect(instance, signal, plugin)
-	void *instance
-	const char *signal
-	Gaim::Plugin plugin
-CODE:
-	gaim_perl_signal_disconnect(plugin, instance, signal);
-
-void
-gaim_debug(level, category, string)
-	Gaim::DebugLevel level
-	const char *category
-	const char *string
-
-void
-debug_misc(category, string)
-	const char *category
-	const char *string
-CODE:
-	gaim_debug(GAIM_DEBUG_MISC, category, string);
-
-void
-debug_info(category, string)
-	const char *category
-	const char *string
-CODE:
-	gaim_debug(GAIM_DEBUG_INFO, category, string);
-
-void
-debug_warning(category, string)
-	const char *category
-	const char *string
-CODE:
-	gaim_debug(GAIM_DEBUG_WARNING, category, string);
-
-void
-debug_error(category, string)
-	const char *category
-	const char *string
-CODE:
-	gaim_debug(GAIM_DEBUG_ERROR, category, string);
-
-void
-debug_fatal(category, string)
-	const char *category
-	const char *string
-CODE:
-	gaim_debug(GAIM_DEBUG_FATAL, category, string);
-
-void
 deinit()
 CODE:
 	gaim_perl_timeout_clear();
--- a/plugins/perl/common/Makefile.mingw	Wed Feb 08 22:15:46 2006 +0000
+++ b/plugins/perl/common/Makefile.mingw	Wed Feb 08 23:13:56 2006 +0000
@@ -57,6 +57,7 @@
 				Cmds.xs \
 				Connection.xs \
 				Conversation.xs \
+				Debug.xs \
 				FT.xs \
 				Gaim.xs \
 				ImgStore.xs \
@@ -74,6 +75,7 @@
 				Roomlist.xs \
 				SSLConn.xs \
 				SavedStatuses.xs \
+				Signal.xs \
 				Server.xs \
 				Sound.xs \
 				Status.xs \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/perl/common/Signal.xs	Wed Feb 08 23:13:56 2006 +0000
@@ -0,0 +1,34 @@
+#include "module.h"
+#include "../perl-handlers.h"
+
+MODULE = Gaim::Signal  PACKAGE = Gaim::Signal  PREFIX = gaim_signal_
+PROTOTYPES: ENABLE
+
+void
+gaim_signal_connect_priority(instance, signal, plugin, callback, priority, data = 0)
+	void *instance
+	const char *signal
+	Gaim::Plugin plugin
+	SV *callback
+	int priority
+	SV *data
+CODE:
+	gaim_perl_signal_connect(plugin, instance, signal, callback, data, priority);
+
+void
+gaim_signal_connect(instance, signal, plugin, callback, data = 0)
+	void *instance
+	const char *signal
+	Gaim::Plugin plugin
+	SV *callback
+	SV *data
+CODE:
+	gaim_perl_signal_connect(plugin, instance, signal, callback, data, GAIM_SIGNAL_PRIORITY_DEFAULT);
+
+void
+gaim_signal_disconnect(instance, signal, plugin)
+	void *instance
+	const char *signal
+	Gaim::Plugin plugin
+CODE:
+	gaim_perl_signal_disconnect(plugin, instance, signal);
--- a/plugins/perl/perl-handlers.c	Wed Feb 08 22:15:46 2006 +0000
+++ b/plugins/perl/perl-handlers.c	Wed Feb 08 23:13:56 2006 +0000
@@ -424,7 +424,8 @@
 
 void
 gaim_perl_signal_connect(GaimPlugin *plugin, void *instance,
-                         const char *signal, SV *callback, SV *data)
+                         const char *signal, SV *callback, SV *data,
+                         int priority)
 {
 	GaimPerlSignalHandler *handler;
 
@@ -440,8 +441,9 @@
 
 	signal_handlers = g_list_append(signal_handlers, handler);
 
-	gaim_signal_connect_vargs(instance, signal, plugin,
-	                          GAIM_CALLBACK(perl_signal_cb), handler);
+	gaim_signal_connect_priority_vargs(instance, signal, plugin,
+	                                   GAIM_CALLBACK(perl_signal_cb),
+	                                   handler, priority);
 }
 
 void
--- a/plugins/perl/perl-handlers.h	Wed Feb 08 22:15:46 2006 +0000
+++ b/plugins/perl/perl-handlers.h	Wed Feb 08 23:13:56 2006 +0000
@@ -51,7 +51,7 @@
 
 void gaim_perl_signal_connect(GaimPlugin *plugin, void *instance,
                               const char *signal, SV *callback,
-                              SV *data);
+                              SV *data, int priority);
 void gaim_perl_signal_disconnect(GaimPlugin *plugin, void *instance,
                                  const char *signal);
 void gaim_perl_signal_clear_for_plugin(GaimPlugin *plugin);