comparison libgaim/plugin.c @ 14833:2b369cd04576

[gaim-migrate @ 17600] I think "not loadable" is a vastly superior way to report plugins that cannot be loaded. "unloadable" could easily be misinterpreted to mean it was loaded and can be now removed (we actually use this meaning too!). committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 28 Oct 2006 14:24:10 +0000
parents 828ef7b19b59
children 8a0c3cb93de8
comparison
equal deleted inserted replaced
14832:828ef7b19b59 14833:2b369cd04576
278 } 278 }
279 279
280 if (error == NULL || !*error) 280 if (error == NULL || !*error)
281 { 281 {
282 plugin->error = g_strdup(_("Unknown error")); 282 plugin->error = g_strdup(_("Unknown error"));
283 gaim_debug_error("plugins", "%s is unloadable: Unknown error\n", 283 gaim_debug_error("plugins", "%s is not loadable: Unknown error\n",
284 plugin->path); 284 plugin->path);
285 } 285 }
286 else 286 else
287 { 287 {
288 plugin->error = g_strdup(error); 288 plugin->error = g_strdup(error);
289 gaim_debug_error("plugins", "%s is unloadable: %s\n", 289 gaim_debug_error("plugins", "%s is not loadable: %s\n",
290 plugin->path, plugin->error); 290 plugin->path, plugin->error);
291 } 291 }
292 #if GLIB_CHECK_VERSION(2,3,3) 292 #if GLIB_CHECK_VERSION(2,3,3)
293 plugin->handle = g_module_open(filename, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL); 293 plugin->handle = g_module_open(filename, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
294 #else 294 #else
380 GaimPluginType type; 380 GaimPluginType type;
381 char *ui_requirement; 381 char *ui_requirement;
382 unsigned long flags; 382 unsigned long flags;
383 GList *dependencies; 383 GList *dependencies;
384 GaimPluginPriority priority; 384 GaimPluginPriority priority;
385 385
386 char *id; 386 char *id;
387 char *name; 387 char *name;
388 char *version; 388 char *version;
389 char *summary; 389 char *summary;
390 char *description; 390 char *description;
431 plugin->info->actions = info2->actions; 431 plugin->info->actions = info2->actions;
432 432
433 433
434 plugin->error = g_strdup_printf(_("Plugin magic mismatch %d (need %d)"), 434 plugin->error = g_strdup_printf(_("Plugin magic mismatch %d (need %d)"),
435 plugin->info->magic, GAIM_PLUGIN_MAGIC); 435 plugin->info->magic, GAIM_PLUGIN_MAGIC);
436 gaim_debug_error("plugins", "%s is unloadable: Plugin magic mismatch %d (need %d)\n", 436 gaim_debug_error("plugins", "%s is not loadable: Plugin magic mismatch %d (need %d)\n",
437 plugin->path, plugin->info->magic, GAIM_PLUGIN_MAGIC); 437 plugin->path, plugin->info->magic, GAIM_PLUGIN_MAGIC);
438 plugin->unloadable = TRUE; 438 plugin->unloadable = TRUE;
439 return plugin; 439 return plugin;
440 } 440 }
441 441
442 gaim_debug_error("plugins", "%s is unloadable: Plugin magic mismatch %d (need %d)\n", 442 gaim_debug_error("plugins", "%s is not loadable: Plugin magic mismatch %d (need %d)\n",
443 plugin->path, plugin->info->magic, GAIM_PLUGIN_MAGIC); 443 plugin->path, plugin->info->magic, GAIM_PLUGIN_MAGIC);
444 gaim_plugin_destroy(plugin); 444 gaim_plugin_destroy(plugin);
445 return NULL; 445 return NULL;
446 } 446 }
447 447
449 plugin->info->minor_version > GAIM_MINOR_VERSION) 449 plugin->info->minor_version > GAIM_MINOR_VERSION)
450 { 450 {
451 plugin->error = g_strdup_printf(_("ABI version mismatch %d.%d.x (need %d.%d.x)"), 451 plugin->error = g_strdup_printf(_("ABI version mismatch %d.%d.x (need %d.%d.x)"),
452 plugin->info->major_version, plugin->info->minor_version, 452 plugin->info->major_version, plugin->info->minor_version,
453 GAIM_MAJOR_VERSION, GAIM_MINOR_VERSION); 453 GAIM_MAJOR_VERSION, GAIM_MINOR_VERSION);
454 gaim_debug_error("plugins", "%s is unloadable: ABI version mismatch %d.%d.x (need %d.%d.x)\n", 454 gaim_debug_error("plugins", "%s is not loadable: ABI version mismatch %d.%d.x (need %d.%d.x)\n",
455 plugin->path, plugin->info->major_version, plugin->info->minor_version, 455 plugin->path, plugin->info->major_version, plugin->info->minor_version,
456 GAIM_MAJOR_VERSION, GAIM_MINOR_VERSION); 456 GAIM_MAJOR_VERSION, GAIM_MINOR_VERSION);
457 plugin->unloadable = TRUE; 457 plugin->unloadable = TRUE;
458 return plugin; 458 return plugin;
459 } 459 }
464 if ((GAIM_PLUGIN_PROTOCOL_INFO(plugin)->list_icon == NULL) || 464 if ((GAIM_PLUGIN_PROTOCOL_INFO(plugin)->list_icon == NULL) ||
465 (GAIM_PLUGIN_PROTOCOL_INFO(plugin)->login == NULL) || 465 (GAIM_PLUGIN_PROTOCOL_INFO(plugin)->login == NULL) ||
466 (GAIM_PLUGIN_PROTOCOL_INFO(plugin)->close == NULL)) 466 (GAIM_PLUGIN_PROTOCOL_INFO(plugin)->close == NULL))
467 { 467 {
468 plugin->error = g_strdup(_("Plugin does not implement all required functions")); 468 plugin->error = g_strdup(_("Plugin does not implement all required functions"));
469 gaim_debug_error("plugins", "%s is unloadable: Plugin does not implement all required functions\n", 469 gaim_debug_error("plugins", "%s is not loadable: Plugin does not implement all required functions\n",
470 plugin->path); 470 plugin->path);
471 plugin->unloadable = TRUE; 471 plugin->unloadable = TRUE;
472 return plugin; 472 return plugin;
473 } 473 }
474 474
1375 1375
1376 loader_info = GAIM_PLUGIN_LOADER_INFO(plugin); 1376 loader_info = GAIM_PLUGIN_LOADER_INFO(plugin);
1377 1377
1378 if (loader_info == NULL) 1378 if (loader_info == NULL)
1379 { 1379 {
1380 gaim_debug_error("plugins", "%s is unloadable\n", 1380 gaim_debug_error("plugins", "%s is not loadable, loader plugin missing loader_info\n",
1381 plugin->path); 1381 plugin->path);
1382 return FALSE; 1382 return FALSE;
1383 } 1383 }
1384 } 1384 }
1385 else if (plugin->info->type == GAIM_PLUGIN_PROTOCOL) 1385 else if (plugin->info->type == GAIM_PLUGIN_PROTOCOL)
1388 1388
1389 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(plugin); 1389 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(plugin);
1390 1390
1391 if (prpl_info == NULL) 1391 if (prpl_info == NULL)
1392 { 1392 {
1393 gaim_debug_error("plugins", "%s is unloadable\n", 1393 gaim_debug_error("plugins", "%s is not loadable, protocol plugin missing prpl_info\n",
1394 plugin->path); 1394 plugin->path);
1395 return FALSE; 1395 return FALSE;
1396 } 1396 }
1397 } 1397 }
1398 1398