changeset 797:c13e78ae0f86

[gaim-migrate @ 807] egassem gniggubed lufesu erom committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 30 Aug 2000 04:31:05 +0000
parents 4783a3b6859d
children 9dc39872e1f9
files src/gaim.h src/perl.c src/plugins.c
diffstat 3 files changed, 79 insertions(+), 75 deletions(-) [+]
line wrap: on
line diff
--- a/src/gaim.h	Wed Aug 30 03:49:00 2000 +0000
+++ b/src/gaim.h	Wed Aug 30 04:31:05 2000 +0000
@@ -401,7 +401,7 @@
 #define TYPE_SIGNOFF   4
 #define TYPE_KEEPALIVE 5
 
-#define REVISION "gaim:$Revision: 794 $"
+#define REVISION "gaim:$Revision: 807 $"
 #define FLAPON "FLAPON\r\n\r\n"
 
 #define ROAST "Tic/Toc"
@@ -748,6 +748,7 @@
 extern void gaim_signal_disconnect(void *, enum gaim_event, void *);
 extern void gaim_plugin_unload(void *);
 #endif
+extern char *event_name(enum gaim_event);
 extern void plugin_event(enum gaim_event, void *, void *, void *);
 
 /* Functions in prefs.c */
--- a/src/perl.c	Wed Aug 30 03:49:00 2000 +0000
+++ b/src/perl.c	Wed Aug 30 04:31:05 2000 +0000
@@ -445,79 +445,6 @@
 	serv_chat_send(c->id, what);
 }
 
-static char *event_name(enum gaim_event event)
-{
-	static char buf[128];
-	switch(event) {
-		case event_signon:
-			sprintf(buf, "event_signon");
-			break;
-		case event_signoff:
-			sprintf(buf, "event_signoff");
-			break;
-		case event_away:
-			sprintf(buf, "event_away");
-			break;
-		case event_back:
-			sprintf(buf, "event_back");
-			break;
-		case event_im_recv:
-			sprintf(buf, "event_im_recv");
-			break;
-		case event_im_send:
-			sprintf(buf, "event_im_send");
-			break;
-		case event_buddy_signon:
-			sprintf(buf, "event_buddy_signon");
-			break;
-		case event_buddy_signoff:
-			sprintf(buf, "event_buddy_signoff");
-			break;
-		case event_buddy_away:
-			sprintf(buf, "event_buddy_away");
-			break;
-		case event_buddy_back:
-			sprintf(buf, "event_buddy_back");
-			break;
-		case event_blist_update:
-			sprintf(buf, "event_blist_update");
-			break;
-		case event_chat_invited:
-			sprintf(buf, "event_chat_invited");
-			break;
-		case event_chat_join:
-			sprintf(buf, "event_chat_join");
-			break;
-		case event_chat_leave:
-			sprintf(buf, "event_chat_leave");
-			break;
-		case event_chat_buddy_join:
-			sprintf(buf, "event_chat_buddy_join");
-			break;
-		case event_chat_buddy_leave:
-			sprintf(buf, "event_chat_buddy_leave");
-			break;
-		case event_chat_recv:
-			sprintf(buf, "event_chat_recv");
-			break;
-		case event_chat_send:
-			sprintf(buf, "event_chat_send");
-			break;
-		case event_warned:
-			sprintf(buf, "event_warned");
-			break;
-		case event_error:
-			sprintf(buf, "event_error");
-			break;
-		case event_quit:
-			sprintf(buf, "event_quit");
-			break;
-		default:
-			sprintf(buf, "event_unknown");
-			break;
-	}
-}
-
 int perl_event(enum gaim_event event, char *args)
 {
 	GList *handler;
--- a/src/plugins.c	Wed Aug 30 03:49:00 2000 +0000
+++ b/src/plugins.c	Wed Aug 30 04:31:05 2000 +0000
@@ -535,9 +535,84 @@
 
 #endif /* GAIM_PLUGINS */
 
+char *event_name(enum gaim_event event)
+{
+	static char buf[128];
+	switch(event) {
+		case event_signon:
+			sprintf(buf, "event_signon");
+			break;
+		case event_signoff:
+			sprintf(buf, "event_signoff");
+			break;
+		case event_away:
+			sprintf(buf, "event_away");
+			break;
+		case event_back:
+			sprintf(buf, "event_back");
+			break;
+		case event_im_recv:
+			sprintf(buf, "event_im_recv");
+			break;
+		case event_im_send:
+			sprintf(buf, "event_im_send");
+			break;
+		case event_buddy_signon:
+			sprintf(buf, "event_buddy_signon");
+			break;
+		case event_buddy_signoff:
+			sprintf(buf, "event_buddy_signoff");
+			break;
+		case event_buddy_away:
+			sprintf(buf, "event_buddy_away");
+			break;
+		case event_buddy_back:
+			sprintf(buf, "event_buddy_back");
+			break;
+		case event_blist_update:
+			sprintf(buf, "event_blist_update");
+			break;
+		case event_chat_invited:
+			sprintf(buf, "event_chat_invited");
+			break;
+		case event_chat_join:
+			sprintf(buf, "event_chat_join");
+			break;
+		case event_chat_leave:
+			sprintf(buf, "event_chat_leave");
+			break;
+		case event_chat_buddy_join:
+			sprintf(buf, "event_chat_buddy_join");
+			break;
+		case event_chat_buddy_leave:
+			sprintf(buf, "event_chat_buddy_leave");
+			break;
+		case event_chat_recv:
+			sprintf(buf, "event_chat_recv");
+			break;
+		case event_chat_send:
+			sprintf(buf, "event_chat_send");
+			break;
+		case event_warned:
+			sprintf(buf, "event_warned");
+			break;
+		case event_error:
+			sprintf(buf, "event_error");
+			break;
+		case event_quit:
+			sprintf(buf, "event_quit");
+			break;
+		default:
+			sprintf(buf, "event_unknown");
+			break;
+	}
+	return buf;
+}
+
 void plugin_event(enum gaim_event event, void *arg1, void *arg2, void *arg3) {
 #ifdef USE_PERL
 	char buf[BUF_LONG];
+	char *tmp;
 #endif
 #ifdef GAIM_PLUGINS
 	GList *c = callbacks;
@@ -702,7 +777,8 @@
 		default:
 			break;
 	}
-	sprintf(debug_buff, "event %d: %s\n", event, buf);
+	tmp = event_name(event);
+	sprintf(debug_buff, "%s: %s\n", tmp, buf);
 	debug_print(debug_buff);
 	perl_event(event, buf);
 #endif