Mercurial > pidgin.yaz
changeset 398:59d97cd251ff
[gaim-migrate @ 408]
this better work
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Mon, 12 Jun 2000 13:59:03 +0000 |
parents | 0b5ecac8aa54 |
children | 98bbfae58fa2 |
files | plugins/ChangeLog plugins/HOWTO plugins/error.c |
diffstat | 3 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/ChangeLog Mon Jun 12 13:56:58 2000 +0000 +++ b/plugins/ChangeLog Mon Jun 12 13:59:03 2000 +0000 @@ -9,10 +9,10 @@ plugins do not have to be recompiled in order for them to still work. The big thing to note is that gaim_plugin_init no longer returns void, - but int. If it returns 1, gaim interprets this as there being no + but int. If it returns 0+, gaim interprets this as there being no error, and continues with loading as normal. (This should be backwards- - compatible: returning 1 is the equivalent of returning void.) If it - returns a number other than 1, there was an error loading detected by + compatible: returning 0/1 is the equivalent of returning void.) If it + returns a number less than 0, there was an error loading detected by the plugin. At that point, gaim will try to clean things up by removing any callbacks that have been added by the plugin. It will then try to call the plugin's gaim_plugin_error function, if there is one. The
--- a/plugins/HOWTO Mon Jun 12 13:56:58 2000 +0000 +++ b/plugins/HOWTO Mon Jun 12 13:59:03 2000 +0000 @@ -28,10 +28,9 @@ needed for connecting to signals and things. It's a good idea to remember it somehow. -gaim_plugin_init should return an int. If the int it returns is anything other -than 1, it is interpreted as an error, and gaim_plugin_error is called. See -the ChangeLog file in this directory for more details, and error.c for an -example. +gaim_plugin_init should return an int. If the int returned is less than 0, it +is interpreted as an error, and gaim_plugin_error is called. See the ChangeLog +file in this directory for more details, and error.c for an example. You can basically do anything you want in the plugin. You can make function calls, change public widgets, display new widgets, things like that. But the
--- a/plugins/error.c Mon Jun 12 13:56:58 2000 +0000 +++ b/plugins/error.c Mon Jun 12 13:59:03 2000 +0000 @@ -11,6 +11,7 @@ srand(time(NULL)); error = rand() % 3; + error -= 2; /* there's a 1 in 3 chance there *won't* be an error :) */ return error; } @@ -25,10 +26,10 @@ * we just have to deal with what the error was (as defined by us) * and do any other clean-up stuff we need to do. */ switch (error) { - case 0: + case -1: do_error_dialog("I'm calling the error myself", "MY BAD"); return NULL; - case 2: + case -2: return "Internal plugin error: exiting."; } /* we should never get here */