comparison plugins/perl/perl.c @ 12984:d1e6890ed062

[gaim-migrate @ 15337] Perl plugins now have ids. Not having them was causing crashes with the dependent plugin unloading stuff. Some fixes to that code in a minute. committer: Tailor Script <tailor@pidgin.im>
author Etan Reisner <pidgin@unreliablesource.net>
date Sun, 22 Jan 2006 05:17:38 +0000
parents e0629444c455
children b457aa723bab
comparison
equal deleted inserted replaced
12983:92ae94619e2c 12984:d1e6890ed062
297 g_free(basename); 297 g_free(basename);
298 298
299 /* We know this one exists. */ 299 /* We know this one exists. */
300 key = hv_fetch(plugin_info, "name", strlen("name"), 0); 300 key = hv_fetch(plugin_info, "name", strlen("name"), 0);
301 info->name = g_strdup(SvPV(*key, len)); 301 info->name = g_strdup(SvPV(*key, len));
302 /* Set id here in case we don't find one later. */
303 info->id = g_strdup(SvPV(*key, len));
302 304
303 if ((key = hv_fetch(plugin_info, "GTK_UI", 305 if ((key = hv_fetch(plugin_info, "GTK_UI",
304 strlen("GTK_UI"), 0))) 306 strlen("GTK_UI"), 0)))
305 info->ui_requirement = GAIM_GTK_PLUGIN_TYPE; 307 info->ui_requirement = GAIM_GTK_PLUGIN_TYPE;
306 308
322 324
323 if ((key = hv_fetch(plugin_info, "version", 325 if ((key = hv_fetch(plugin_info, "version",
324 strlen("version"), 0))) 326 strlen("version"), 0)))
325 info->version = g_strdup(SvPV(*key, len)); 327 info->version = g_strdup(SvPV(*key, len));
326 328
327 if ((key = hv_fetch(plugin_info, "load", 329 /* We know this one exists. */
328 strlen("load"), 0))) 330 key = hv_fetch(plugin_info, "load", strlen("load"), 0);
329 gps->load_sub = g_strdup_printf("%s::%s", 331 gps->load_sub = g_strdup_printf("%s::%s", gps->package,
330 gps->package, 332 SvPV(*key, len));
331 SvPV(*key, len));
332 333
333 if ((key = hv_fetch(plugin_info, "unload", 334 if ((key = hv_fetch(plugin_info, "unload",
334 strlen("unload"), 0))) 335 strlen("unload"), 0)))
335 gps->unload_sub = g_strdup_printf("%s::%s", 336 gps->unload_sub = g_strdup_printf("%s::%s",
336 gps->package, 337 gps->package,
337 SvPV(*key, len)); 338 SvPV(*key, len));
339
340 if ((key = hv_fetch(plugin_info, "id",
341 strlen("id"), 0))) {
342 g_free(info->id);
343 info->id = g_strdup_printf("perl-%s",
344 SvPV(*key, len));
345 }
338 346
339 /********************************************************/ 347 /********************************************************/
340 /* Only one of the next two options should be present */ 348 /* Only one of the next two options should be present */
341 /* */ 349 /* */
342 /* prefs_info - Uses non-GUI (read GTK) gaim API calls */ 350 /* prefs_info - Uses non-GUI (read GTK) gaim API calls */