comparison src/buddy.c @ 391:be408b41c172

[gaim-migrate @ 401] Plugins got updated. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 12 Jun 2000 11:30:05 +0000
parents fd3cc0a28d5d
children d6f02d7f78d8
comparison
equal deleted inserted replaced
390:0890c6250e7e 391:be408b41c172
25 #ifdef USE_APPLET 25 #ifdef USE_APPLET
26 #include <gnome.h> 26 #include <gnome.h>
27 #include <applet-widget.h> 27 #include <applet-widget.h>
28 #include "gnome_applet_mgr.h" 28 #include "gnome_applet_mgr.h"
29 #endif /* USE_APPLET */ 29 #endif /* USE_APPLET */
30 #ifdef GAIM_PLUGINS
31 #include <dlfcn.h>
32 #endif /* GAIM_PLUGINS */
30 #include <string.h> 33 #include <string.h>
31 #include <stdio.h> 34 #include <stdio.h>
32 #include <stdlib.h> 35 #include <stdlib.h>
33 #include <math.h> 36 #include <math.h>
34 #include <time.h> 37 #include <time.h>
1067 1070
1068 1071
1069 1072
1070 void do_quit() 1073 void do_quit()
1071 { 1074 {
1075 #ifdef GAIM_PLUGINS
1076 GList *c;
1077 struct gaim_callback *g;
1078 struct gaim_plugin *p;
1079 void (*function)(void *);
1080 void (*gaim_plugin_remove)();
1081 char *error;
1082
1083 /* first we tell those who have requested it we're quitting */
1084 c = callbacks;
1085 while (c) {
1086 g = (struct gaim_callback *)c->data;
1087 if (g->event == event_quit && g->function != NULL) {
1088 function = g->function;
1089 (*function)(g->data);
1090 }
1091 c = c->next;
1092 }
1093
1094 /* then we remove everyone in a mass suicide */
1095 c = plugins;
1096 while (c) {
1097 p = (struct gaim_plugin *)c->data;
1098 gaim_plugin_remove = dlsym(p->handle, "gaim_plugin_remove");
1099 if ((error = (char *)dlerror()) == NULL)
1100 (*gaim_plugin_remove)();
1101 /* we don't need to worry about removing callbacks since
1102 * there won't be any more chance to call them back :) */
1103 dlclose(p->handle);
1104 g_free(p->filename); /* why do i bother? */
1105 g_free(p);
1106 }
1107 #endif
1108
1072 exit(0); 1109 exit(0);
1073 } 1110 }
1074 1111
1075 void add_buddy_callback(GtkWidget *widget, void *dummy) 1112 void add_buddy_callback(GtkWidget *widget, void *dummy)
1076 { 1113 {