comparison src/plugins.c @ 1710:f42ce672c560

[gaim-migrate @ 1720] various fixes (for plugins especially), other updates. made WEBSITE macro so it's easy to change (not that i think it'll be changing again), updated some files to reflect that change. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 13 Apr 2001 10:50:33 +0000
parents 865a6ead3258
children 560b3117aedf
comparison
equal deleted inserted replaced
1709:11d0deb44a36 1710:f42ce672c560
134 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(plugin_dialog)); 134 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(plugin_dialog));
135 if (file_is_dir(file, plugin_dialog)) { 135 if (file_is_dir(file, plugin_dialog)) {
136 return; 136 return;
137 } 137 }
138 138
139 load_plugin(file); 139 if (file)
140 load_plugin(file);
140 141
141 if (plugin_dialog) 142 if (plugin_dialog)
142 gtk_widget_destroy(plugin_dialog); 143 gtk_widget_destroy(plugin_dialog);
143 plugin_dialog = NULL; 144 plugin_dialog = NULL;
144 } 145 }
152 char *error; 153 char *error;
153 char *retval; 154 char *retval;
154 155
155 if (!g_module_supported()) 156 if (!g_module_supported())
156 return; 157 return;
157 if (filename == NULL) 158 if (filename && !strlen(filename))
158 return; 159 return;
159 if (strlen(filename) == 0) 160
160 return; 161 while (filename && c) {
161
162 while (c) {
163 plug = (struct gaim_plugin *)c->data; 162 plug = (struct gaim_plugin *)c->data;
164 if (!strcmp(filename, g_module_name(plug->handle))) { 163 if (!strcmp(filename, g_module_name(plug->handle))) {
165 void (*gaim_plugin_remove)(); 164 void (*gaim_plugin_remove)();
166 if (g_module_symbol(plug->handle, "gaim_plugin_remove", 165 if (g_module_symbol(plug->handle, "gaim_plugin_remove",
167 (gpointer *)&gaim_plugin_remove)) 166 (gpointer *)&gaim_plugin_remove))
172 } else 171 } else
173 c = g_list_next(c); 172 c = g_list_next(c);
174 } 173 }
175 plug = g_malloc(sizeof *plug); 174 plug = g_malloc(sizeof *plug);
176 175
177 if (last_dir) 176 if (filename) {
178 g_free(last_dir); 177 if (last_dir)
179 last_dir = g_dirname(filename); 178 g_free(last_dir);
179 last_dir = g_dirname(filename);
180 }
180 181
181 debug_printf("Loading %s\n", filename); 182 debug_printf("Loading %s\n", filename);
182 plug->handle = g_module_open(filename, 0); 183 plug->handle = g_module_open(filename, 0);
183 if (!plug->handle) { 184 if (!plug->handle) {
184 error = (char *)g_module_error(); 185 error = (char *)g_module_error();
232 233
233 update_show_plugins(); 234 update_show_plugins();
234 save_prefs(); 235 save_prefs();
235 } 236 }
236 237
238 char *gaim_plugin_init(GModule *mod)
239 {
240 void (*asdf)(void *);
241 char *(*gem)();
242 g_module_symbol(mod, "do_stuff", (gpointer *)&asdf);
243 g_module_symbol(mod, "gem", (gpointer *)&gem);
244 asdf(gem);
245 return NULL;
246 }
247
237 void show_plugins(GtkWidget *w, gpointer data) 248 void show_plugins(GtkWidget *w, gpointer data)
238 { 249 {
239 /* most of this code was shamelessly stolen from prefs.c */ 250 /* most of this code was shamelessly stolen from prefs.c */
240 GtkWidget *page; 251 GtkWidget *page;
241 GtkWidget *topbox; 252 GtkWidget *topbox;