comparison src/module.c @ 2662:b0c5770156e1

[gaim-migrate @ 2675] everything changed! not really. actually to be quite honest nothing changed. it's really bad that all of these files use prpl references. most of them shouldn't. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 02 Nov 2001 01:41:37 +0000
parents a83b4a5ffcd6
children cd23279122ed
comparison
equal deleted inserted replaced
2661:5e9a033f04fa 2662:b0c5770156e1
113 g_module_close(plug->handle); 113 g_module_close(plug->handle);
114 g_free(plug); 114 g_free(plug);
115 return NULL; 115 return NULL;
116 } 116 }
117 117
118 retval = (*gaim_plugin_init)(plug->handle); 118 retval = gaim_plugin_init(plug->handle);
119 debug_printf("loaded plugin returned %s\n", retval ? retval : "NULL"); 119 debug_printf("loaded plugin returned %s\n", retval ? retval : "NULL");
120 if (retval) { 120 if (retval) {
121 plugin_remove_callbacks(plug->handle); 121 plugin_remove_callbacks(plug->handle);
122 do_error_dialog(retval, _("Plugin Error")); 122 do_error_dialog(retval, _("Plugin Error"));
123 g_module_close(plug->handle); 123 g_module_close(plug->handle);
126 } 126 }
127 127
128 plugins = g_list_append(plugins, plug); 128 plugins = g_list_append(plugins, plug);
129 129
130 if (g_module_symbol(plug->handle, "name", (gpointer *)&cfunc)) { 130 if (g_module_symbol(plug->handle, "name", (gpointer *)&cfunc)) {
131 plug->name = (*cfunc)(); 131 plug->name = cfunc();
132 } else { 132 } else {
133 plug->name = NULL; 133 plug->name = NULL;
134 } 134 }
135 135
136 if (g_module_symbol(plug->handle, "description", (gpointer *)&cfunc)) 136 if (g_module_symbol(plug->handle, "description", (gpointer *)&cfunc))
137 plug->description = (*cfunc)(); 137 plug->description = cfunc();
138 else 138 else
139 plug->description = NULL; 139 plug->description = NULL;
140 140
141 save_prefs(); 141 save_prefs();
142 return plug; 142 return plug;
148 148
149 debug_printf("Unloading %s\n", g_module_name(p->handle)); 149 debug_printf("Unloading %s\n", g_module_name(p->handle));
150 150
151 /* Attempt to call the plugin's remove function (if there) */ 151 /* Attempt to call the plugin's remove function (if there) */
152 if (g_module_symbol(p->handle, "gaim_plugin_remove", (gpointer *)&gaim_plugin_remove)) 152 if (g_module_symbol(p->handle, "gaim_plugin_remove", (gpointer *)&gaim_plugin_remove))
153 (*gaim_plugin_remove)(); 153 gaim_plugin_remove();
154 154
155 plugin_remove_callbacks(p->handle); 155 plugin_remove_callbacks(p->handle);
156 156
157 plugins = g_list_remove(plugins, p); 157 plugins = g_list_remove(plugins, p);
158 g_free(p); 158 g_free(p);
188 return; 188 return;
189 189
190 debug_printf("Unloading %s\n", g_module_name(p->handle)); 190 debug_printf("Unloading %s\n", g_module_name(p->handle));
191 191
192 if (g_module_symbol(p->handle, "gaim_plugin_remove", (gpointer *)&gaim_plugin_remove)) 192 if (g_module_symbol(p->handle, "gaim_plugin_remove", (gpointer *)&gaim_plugin_remove))
193 (*gaim_plugin_remove)(); 193 gaim_plugin_remove();
194 plugin_remove_callbacks(p->handle); 194 plugin_remove_callbacks(p->handle);
195 plugins = g_list_remove(plugins, p); 195 plugins = g_list_remove(plugins, p);
196 g_free(p); 196 g_free(p);
197 /* XXX CUI need to tell UI what happened, but not like this */ 197 /* XXX CUI need to tell UI what happened, but not like this */
198 update_show_plugins(); 198 update_show_plugins();
489 489
490 /* no args */ 490 /* no args */
491 case event_blist_update: 491 case event_blist_update:
492 case event_quit: 492 case event_quit:
493 zero = g->function; 493 zero = g->function;
494 (*zero)(g->data); 494 zero(g->data);
495 break; 495 break;
496 496
497 /* one arg */ 497 /* one arg */
498 case event_signon: 498 case event_signon:
499 case event_signoff: 499 case event_signoff:
500 case event_new_conversation: 500 case event_new_conversation:
501 case event_error: 501 case event_error:
502 one = g->function; 502 one = g->function;
503 (*one)(arg1, g->data); 503 one(arg1, g->data);
504 break; 504 break;
505 505
506 /* two args */ 506 /* two args */
507 case event_buddy_signon: 507 case event_buddy_signon:
508 case event_buddy_signoff: 508 case event_buddy_signoff:
512 case event_buddy_unidle: 512 case event_buddy_unidle:
513 case event_chat_leave: 513 case event_chat_leave:
514 case event_set_info: 514 case event_set_info:
515 case event_draw_menu: 515 case event_draw_menu:
516 two = g->function; 516 two = g->function;
517 (*two)(arg1, arg2, g->data); 517 two(arg1, arg2, g->data);
518 break; 518 break;
519 519
520 /* three args */ 520 /* three args */
521 case event_im_send: 521 case event_im_send:
522 case event_im_displayed_sent: 522 case event_im_displayed_sent:
526 case event_chat_send: 526 case event_chat_send:
527 case event_away: 527 case event_away:
528 case event_back: 528 case event_back:
529 case event_warned: 529 case event_warned:
530 three = g->function; 530 three = g->function;
531 (*three)(arg1, arg2, arg3, g->data); 531 three(arg1, arg2, arg3, g->data);
532 break; 532 break;
533 533
534 /* four args */ 534 /* four args */
535 case event_im_recv: 535 case event_im_recv:
536 case event_chat_recv: 536 case event_chat_recv:
537 case event_im_displayed_rcvd: 537 case event_im_displayed_rcvd:
538 case event_chat_send_invite: 538 case event_chat_send_invite:
539 case event_chat_invited: 539 case event_chat_invited:
540 four = g->function; 540 four = g->function;
541 (*four)(arg1, arg2, arg3, arg4, g->data); 541 four(arg1, arg2, arg3, arg4, g->data);
542 break; 542 break;
543 543
544 default: 544 default:
545 debug_printf("unknown event %d\n", event); 545 debug_printf("unknown event %d\n", event);
546 break; 546 break;
565 void (*gaim_plugin_remove)(); 565 void (*gaim_plugin_remove)();
566 566
567 while (c) { 567 while (c) {
568 p = (struct gaim_plugin *)c->data; 568 p = (struct gaim_plugin *)c->data;
569 if (g_module_symbol(p->handle, "gaim_plugin_remove", (gpointer *)&gaim_plugin_remove)) 569 if (g_module_symbol(p->handle, "gaim_plugin_remove", (gpointer *)&gaim_plugin_remove))
570 (*gaim_plugin_remove)(); 570 gaim_plugin_remove();
571 g_free(p); 571 g_free(p);
572 c = c->next; 572 c = c->next;
573 } 573 }
574 } 574 }
575 #endif 575 #endif