| 606 init_plugin(PurplePlugin *plugin) |
606 init_plugin(PurplePlugin *plugin) |
| 607 { |
607 { |
| 608 loader_info.exts = g_list_append(loader_info.exts, "pl"); |
608 loader_info.exts = g_list_append(loader_info.exts, "pl"); |
| 609 } |
609 } |
| 610 |
610 |
| |
611 #ifdef __SUNPRO_C |
| |
612 #pragma init (my_init) |
| |
613 #else |
| |
614 void __attribute__ ((constructor)) my_init(void); |
| |
615 #endif |
| |
616 |
| |
617 void |
| |
618 my_init(void) |
| |
619 { |
| |
620 /* Mostly evil hack... puts perl.so's symbols in the global table but |
| |
621 * does not create a circular dependency because g_module_open will |
| |
622 * only open the library once. */ |
| |
623 /* Do we need to keep track of the returned GModule here so that we |
| |
624 * can g_module_close it when this plugin gets unloaded? |
| |
625 * At the moment I don't think this plugin can ever get unloaded but |
| |
626 * in case that becomes possible this wants to get noted. */ |
| |
627 g_module_open("perl.so", 0); |
| |
628 } |
| |
629 |
| 611 PURPLE_INIT_PLUGIN(perl, init_plugin, info) |
630 PURPLE_INIT_PLUGIN(perl, init_plugin, info) |