Mercurial > pidgin
comparison plugins/error.c @ 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 | b1d5c6ab7b0d |
| children | ece2d1543b20 |
comparison
equal
deleted
inserted
replaced
| 397:0b5ecac8aa54 | 398:59d97cd251ff |
|---|---|
| 9 | 9 |
| 10 /* so here, we load any callbacks, do the normal stuff */ | 10 /* so here, we load any callbacks, do the normal stuff */ |
| 11 | 11 |
| 12 srand(time(NULL)); | 12 srand(time(NULL)); |
| 13 error = rand() % 3; | 13 error = rand() % 3; |
| 14 error -= 2; | |
| 14 /* there's a 1 in 3 chance there *won't* be an error :) */ | 15 /* there's a 1 in 3 chance there *won't* be an error :) */ |
| 15 return error; | 16 return error; |
| 16 } | 17 } |
| 17 | 18 |
| 18 void gaim_plugin_remove() { | 19 void gaim_plugin_remove() { |
| 23 char *gaim_plugin_error(int error) { | 24 char *gaim_plugin_error(int error) { |
| 24 /* by the time we've gotten here, all our callbacks are removed. | 25 /* by the time we've gotten here, all our callbacks are removed. |
| 25 * we just have to deal with what the error was (as defined by us) | 26 * we just have to deal with what the error was (as defined by us) |
| 26 * and do any other clean-up stuff we need to do. */ | 27 * and do any other clean-up stuff we need to do. */ |
| 27 switch (error) { | 28 switch (error) { |
| 28 case 0: | 29 case -1: |
| 29 do_error_dialog("I'm calling the error myself", "MY BAD"); | 30 do_error_dialog("I'm calling the error myself", "MY BAD"); |
| 30 return NULL; | 31 return NULL; |
| 31 case 2: | 32 case -2: |
| 32 return "Internal plugin error: exiting."; | 33 return "Internal plugin error: exiting."; |
| 33 } | 34 } |
| 34 /* we should never get here */ | 35 /* we should never get here */ |
| 35 return NULL; | 36 return NULL; |
| 36 } | 37 } |
