plugins/error.c

changeset 1047
783f8520d9a0
parent 398
c426f81e75ce
child 3551
acce66c34dbd
--- a/plugins/error.c	Wed Nov 01 11:34:56 2000 +0000
+++ b/plugins/error.c	Wed Nov 01 22:30:36 2000 +0000
@@ -4,7 +4,9 @@
 #include <stdlib.h>
 #include <time.h>
 
-int gaim_plugin_init(void *handle) {
+char *gaim_plugin_error(int);
+
+char *gaim_plugin_init(GModule *handle) {
 	int error;
 
 	/* so here, we load any callbacks, do the normal stuff */
@@ -13,7 +15,7 @@
 	error = rand() % 3;
 	error -= 2;
 	/* there's a 1 in 3 chance there *won't* be an error :) */
-	return error;
+	return gaim_plugin_error(error);
 }
 
 void gaim_plugin_remove() {
@@ -27,13 +29,12 @@
 	 * and do any other clean-up stuff we need to do. */
 	switch (error) {
 	case -1:
-		do_error_dialog("I'm calling the error myself", "MY BAD");
-		return NULL;
+		return "MY BAD";
 	case -2:
 		return "Internal plugin error: exiting.";
+	default:
+		return NULL;
 	}
-	/* we should never get here */
-	return NULL;
 }
 
 char *name() {

mercurial