libpurple/plugins/perl/perl.c

branch
soc.2013.gobjectification.plugins
changeset 36765
19adace8b7a9
parent 36367
891eea799578
child 36926
d2c0c68a9816
equal deleted inserted replaced
36764:90151831111f 36765:19adace8b7a9
647 g_free(plugin->info); 647 g_free(plugin->info);
648 plugin->info = NULL; 648 plugin->info = NULL;
649 } 649 }
650 } 650 }
651 651
652 static gboolean
653 plugin_load(PurplePlugin *plugin)
654 {
655 return TRUE;
656 }
657
658 static gboolean
659 plugin_unload(PurplePlugin *plugin)
660 {
661 perl_end();
662
663 return TRUE;
664 }
665
666 static PurplePluginLoaderInfo loader_info = 652 static PurplePluginLoaderInfo loader_info =
667 { 653 {
668 NULL, /**< exts */
669 probe_perl_plugin, /**< probe */ 654 probe_perl_plugin, /**< probe */
670 load_perl_plugin, /**< load */ 655 load_perl_plugin, /**< load */
671 unload_perl_plugin, /**< unload */ 656 unload_perl_plugin, /**< unload */
672 destroy_perl_plugin, /**< destroy */ 657 destroy_perl_plugin, /**< destroy */
673
674 /* padding */
675 NULL,
676 NULL,
677 NULL,
678 NULL
679 }; 658 };
680 659
681 static PurplePluginInfo info = 660 static GPluginPluginInfo *
682 { 661 plugin_query(GError **error)
683 PURPLE_PLUGIN_MAGIC, 662 {
684 PURPLE_MAJOR_VERSION, 663 const gchar * const authors[] = {
685 PURPLE_MINOR_VERSION, 664 "Christian Hammond <chipx86@gnupdate.org>",
686 PURPLE_PLUGIN_LOADER, /**< type */ 665 NULL
687 NULL, /**< ui_requirement */ 666 };
688 0, /**< flags */ 667
689 NULL, /**< dependencies */ 668 return gplugin_plugin_info_new(
690 PURPLE_PRIORITY_DEFAULT, /**< priority */ 669 "id", PERL_PLUGIN_ID,
691 670 "name", N_("Perl Plugin Loader"),
692 PERL_PLUGIN_ID, /**< id */ 671 "version", DISPLAY_VERSION,
693 N_("Perl Plugin Loader"), /**< name */ 672 "category", N_("Loader"),
694 DISPLAY_VERSION, /**< version */ 673 "summary", N_("Provides support for loading perl plugins."),
695 N_("Provides support for loading perl plugins."), /**< summary */ 674 "description", N_("Provides support for loading perl plugins."),
696 N_("Provides support for loading perl plugins."), /**< description */ 675 "authors", authors,
697 "Christian Hammond <chipx86@gnupdate.org>", /**< author */ 676 "website", PURPLE_WEBSITE,
698 PURPLE_WEBSITE, /**< homepage */ 677 "abi-version", PURPLE_ABI_VERSION,
699 678 "internal", TRUE,
700 plugin_load, /**< load */ 679 "load-on-query", TRUE,
701 plugin_unload, /**< unload */ 680 NULL
702 NULL, /**< destroy */ 681 );
703 682 }
704 NULL, /**< ui_info */ 683
705 &loader_info, /**< extra_info */ 684 static gboolean
706 NULL, 685 plugin_load(PurplePlugin *plugin, GError **error)
707 NULL, 686 {
708 687 return TRUE;
709 /* padding */ 688 }
710 NULL, 689
711 NULL, 690 static gboolean
712 NULL, 691 plugin_unload(PurplePlugin *plugin, GError **error)
713 NULL 692 {
714 }; 693 perl_end();
694
695 return TRUE;
696 }
715 697
716 static void 698 static void
717 init_plugin(PurplePlugin *plugin) 699 init_plugin(PurplePlugin *plugin)
718 { 700 {
719 loader_info.exts = g_list_append(loader_info.exts, "pl"); 701 loader_info.exts = g_list_append(loader_info.exts, "pl");
736 * At the moment I don't think this plugin can ever get unloaded but 718 * At the moment I don't think this plugin can ever get unloaded but
737 * in case that becomes possible this wants to get noted. */ 719 * in case that becomes possible this wants to get noted. */
738 g_module_open("perl.so", 0); 720 g_module_open("perl.so", 0);
739 } 721 }
740 722
741 PURPLE_INIT_PLUGIN(perl, init_plugin, info) 723 PURPLE_PLUGIN_INIT(perl, plugin_query, plugin_load, plugin_unload);

mercurial