plugins/error.c

changeset 398
c426f81e75ce
parent 396
fbdaa6b9fb14
child 1047
783f8520d9a0
equal deleted inserted replaced
397:71164961a8bb 398:c426f81e75ce
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 }

mercurial