Mon, 03 Feb 2014 22:40:31 +0530
Swap @title and @short_description roles
| 5205 | 1 | /* |
| 15884 | 2 | * purple |
| 5205 | 3 | * |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
4 | * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org> |
| 5205 | 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify | |
| 7 | * it under the terms of the GNU General Public License as published by | |
| 8 | * the Free Software Foundation; either version 2 of the License, or | |
| 9 | * (at your option) any later version. | |
| 10 | * | |
| 11 | * This program is distributed in the hope that it will be useful, | |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 | * GNU General Public License for more details. | |
| 15 | * | |
| 16 | * You should have received a copy of the GNU General Public License | |
| 17 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16786
diff
changeset
|
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 5205 | 19 | */ |
|
6235
8293e7d4c050
[gaim-migrate @ 6728]
Mark Doliner <markdoliner@pidgin.im>
parents:
6100
diff
changeset
|
20 | #ifdef HAVE_CONFIG_H |
|
8293e7d4c050
[gaim-migrate @ 6728]
Mark Doliner <markdoliner@pidgin.im>
parents:
6100
diff
changeset
|
21 | #include <config.h> |
| 8138 | 22 | # ifdef HAVE_LIMITS_H |
| 23 | # include <limits.h> | |
| 24 | # ifndef NAME_MAX | |
| 25 | # define NAME_MAX _POSIX_NAME_MAX | |
| 26 | # endif | |
| 27 | # endif | |
|
6235
8293e7d4c050
[gaim-migrate @ 6728]
Mark Doliner <markdoliner@pidgin.im>
parents:
6100
diff
changeset
|
28 | #endif |
|
8293e7d4c050
[gaim-migrate @ 6728]
Mark Doliner <markdoliner@pidgin.im>
parents:
6100
diff
changeset
|
29 | |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5775
diff
changeset
|
30 | #ifdef DEBUG |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5775
diff
changeset
|
31 | # undef DEBUG |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5775
diff
changeset
|
32 | #endif |
| 5205 | 33 | |
| 34 | #undef PACKAGE | |
| 35 | ||
| 36 | #define group perl_group | |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5775
diff
changeset
|
37 | |
| 5205 | 38 | #ifdef _WIN32 |
| 39 | /* This took me an age to figure out.. without this __declspec(dllimport) | |
| 40 | * will be ignored. | |
| 41 | */ | |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5775
diff
changeset
|
42 | # define HASATTRIBUTE |
| 5205 | 43 | #endif |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5775
diff
changeset
|
44 | |
| 5205 | 45 | #include <EXTERN.h> |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5775
diff
changeset
|
46 | |
| 5205 | 47 | #ifndef _SEM_SEMUN_UNDEFINED |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5775
diff
changeset
|
48 | # define HAS_UNION_SEMUN |
| 5205 | 49 | #endif |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5775
diff
changeset
|
50 | |
| 5205 | 51 | #include <perl.h> |
| 52 | #include <XSUB.h> | |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5775
diff
changeset
|
53 | |
| 5205 | 54 | #ifndef _WIN32 |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5775
diff
changeset
|
55 | # include <sys/mman.h> |
| 5205 | 56 | #endif |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5775
diff
changeset
|
57 | |
| 5205 | 58 | #undef PACKAGE |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5775
diff
changeset
|
59 | |
| 5205 | 60 | #ifndef _WIN32 |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5775
diff
changeset
|
61 | # include <dirent.h> |
| 5205 | 62 | #else |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5775
diff
changeset
|
63 | /* We're using perl's win32 port of this */ |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5775
diff
changeset
|
64 | # define dirent direct |
| 5205 | 65 | #endif |
| 66 | ||
| 67 | #undef group | |
| 68 | ||
| 69 | /* perl module support */ | |
|
23915
b62601fd6e7d
Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents:
20288
diff
changeset
|
70 | #ifdef _WIN32 |
|
b62601fd6e7d
Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents:
20288
diff
changeset
|
71 | EXTERN_C void boot_Win32CORE (pTHX_ CV* cv); |
|
b62601fd6e7d
Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents:
20288
diff
changeset
|
72 | #endif |
|
b62601fd6e7d
Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents:
20288
diff
changeset
|
73 | |
| 5205 | 74 | #ifdef OLD_PERL |
| 75 | extern void boot_DynaLoader _((CV * cv)); | |
| 76 | #else | |
| 77 | extern void boot_DynaLoader _((pTHX_ CV * cv)); /* perl is so wacky */ | |
| 78 | #endif | |
| 79 | ||
| 80 | #undef _ | |
| 81 | #ifdef DEBUG | |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5775
diff
changeset
|
82 | # undef DEBUG |
| 5205 | 83 | #endif |
| 84 | #ifdef _WIN32 | |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5775
diff
changeset
|
85 | # undef pipe |
| 5205 | 86 | #endif |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5775
diff
changeset
|
87 | |
|
6575
fdb1928afdf9
[gaim-migrate @ 7097]
Herman Bloggs <herman@bluedigits.com>
parents:
6549
diff
changeset
|
88 | #ifdef _WIN32 |
|
fdb1928afdf9
[gaim-migrate @ 7097]
Herman Bloggs <herman@bluedigits.com>
parents:
6549
diff
changeset
|
89 | #define _WIN32DEP_H_ |
|
fdb1928afdf9
[gaim-migrate @ 7097]
Herman Bloggs <herman@bluedigits.com>
parents:
6549
diff
changeset
|
90 | #endif |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5775
diff
changeset
|
91 | #include "internal.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5775
diff
changeset
|
92 | #include "debug.h" |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
93 | #include "plugin.h" |
|
6531
3fca41d7b411
[gaim-migrate @ 7048]
Christian Hammond <chipx86@chipx86.com>
parents:
6527
diff
changeset
|
94 | #include "signals.h" |
| 9943 | 95 | #include "version.h" |
| 5205 | 96 | |
|
6526
c6c3f10519ab
[gaim-migrate @ 7043]
Christian Hammond <chipx86@chipx86.com>
parents:
6525
diff
changeset
|
97 | #include "perl-common.h" |
|
6522
e7d94240fc71
[gaim-migrate @ 7039]
Christian Hammond <chipx86@chipx86.com>
parents:
6520
diff
changeset
|
98 | #include "perl-handlers.h" |
|
e7d94240fc71
[gaim-migrate @ 7039]
Christian Hammond <chipx86@chipx86.com>
parents:
6520
diff
changeset
|
99 | |
|
16529
1d0da9270ff9
This is mostly moving Purple::GtkUI:: -> Pidgin:: which has the side effect of
Etan Reisner <deryni@pidgin.im>
parents:
16528
diff
changeset
|
100 | #include <gmodule.h> |
|
1d0da9270ff9
This is mostly moving Purple::GtkUI:: -> Pidgin:: which has the side effect of
Etan Reisner <deryni@pidgin.im>
parents:
16528
diff
changeset
|
101 | |
| 5205 | 102 | #define PERL_PLUGIN_ID "core-perl" |
| 103 | ||
| 12872 | 104 | PerlInterpreter *my_perl = NULL; |
| 105 | ||
|
33906
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
106 | struct _PurplePerlInfoStrings |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
107 | { |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
108 | char *name; |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
109 | char *id; |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
110 | char *homepage; |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
111 | char *author; |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
112 | char *summary; |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
113 | char *description; |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
114 | char *version; |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
115 | }; |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
116 | |
| 15884 | 117 | static PurplePluginUiInfo ui_info = |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
118 | { |
| 15884 | 119 | purple_perl_get_plugin_frame, |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
120 | NULL, |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
121 | |
|
16786
65c04c7e5c8a
Add padding to structs as necessary to silence compiler warnings
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16750
diff
changeset
|
122 | /* Padding */ |
|
65c04c7e5c8a
Add padding to structs as necessary to silence compiler warnings
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16750
diff
changeset
|
123 | NULL, |
|
65c04c7e5c8a
Add padding to structs as necessary to silence compiler warnings
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16750
diff
changeset
|
124 | NULL, |
|
65c04c7e5c8a
Add padding to structs as necessary to silence compiler warnings
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16750
diff
changeset
|
125 | NULL, |
|
65c04c7e5c8a
Add padding to structs as necessary to silence compiler warnings
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16750
diff
changeset
|
126 | NULL |
| 12872 | 127 | }; |
| 5205 | 128 | |
| 15884 | 129 | #ifdef PURPLE_GTKPERL |
| 130 | static PurpleGtkPluginUiInfo gtk_ui_info = | |
| 12872 | 131 | { |
| 15884 | 132 | purple_perl_gtk_get_plugin_frame, |
| 12872 | 133 | 0 /* page_num (Reserved) */ |
| 134 | }; | |
|
14426
8d4f164c4979
[gaim-migrate @ 17070]
Daniel Atallah <datallah@pidgin.im>
parents:
14254
diff
changeset
|
135 | #endif |
| 5205 | 136 | |
|
33906
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
137 | static void perl_infostrings_free(PurplePerlInfoStrings *info_strings) |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
138 | { |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
139 | if (info_strings == NULL) |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
140 | return; |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
141 | |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
142 | g_free(info_strings->name); |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
143 | g_free(info_strings->id); |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
144 | g_free(info_strings->homepage); |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
145 | g_free(info_strings->author); |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
146 | g_free(info_strings->summary); |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
147 | g_free(info_strings->description); |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
148 | g_free(info_strings->version); |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
149 | g_free(info_strings); |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
150 | } |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
151 | |
| 5205 | 152 | static void |
| 153 | #ifdef OLD_PERL | |
| 154 | xs_init() | |
| 155 | #else | |
| 156 | xs_init(pTHX) | |
| 157 | #endif | |
| 158 | { | |
| 159 | char *file = __FILE__; | |
|
27584
134e07aa6f64
Install the Purple and Pidgin perl modules under $libdir instead of in perl's
Etan Reisner <deryni@pidgin.im>
parents:
24241
diff
changeset
|
160 | GList *search_paths = purple_plugins_get_search_paths(); |
|
23915
b62601fd6e7d
Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents:
20288
diff
changeset
|
161 | dXSUB_SYS; |
| 5205 | 162 | |
| 12873 | 163 | /* This one allows dynamic loading of perl modules in perl scripts by |
| 164 | * the 'use perlmod;' construction */ | |
|
6636
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
165 | newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); |
|
23915
b62601fd6e7d
Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents:
20288
diff
changeset
|
166 | #ifdef _WIN32 |
|
b62601fd6e7d
Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents:
20288
diff
changeset
|
167 | newXS("Win32CORE::bootstrap", boot_Win32CORE, file); |
|
b62601fd6e7d
Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents:
20288
diff
changeset
|
168 | #endif |
|
27584
134e07aa6f64
Install the Purple and Pidgin perl modules under $libdir instead of in perl's
Etan Reisner <deryni@pidgin.im>
parents:
24241
diff
changeset
|
169 | |
|
134e07aa6f64
Install the Purple and Pidgin perl modules under $libdir instead of in perl's
Etan Reisner <deryni@pidgin.im>
parents:
24241
diff
changeset
|
170 | while (search_paths != NULL) { |
|
134e07aa6f64
Install the Purple and Pidgin perl modules under $libdir instead of in perl's
Etan Reisner <deryni@pidgin.im>
parents:
24241
diff
changeset
|
171 | gchar *uselib; |
|
134e07aa6f64
Install the Purple and Pidgin perl modules under $libdir instead of in perl's
Etan Reisner <deryni@pidgin.im>
parents:
24241
diff
changeset
|
172 | const gchar *search_path = search_paths->data; |
|
134e07aa6f64
Install the Purple and Pidgin perl modules under $libdir instead of in perl's
Etan Reisner <deryni@pidgin.im>
parents:
24241
diff
changeset
|
173 | search_paths = g_list_next(search_paths); |
|
134e07aa6f64
Install the Purple and Pidgin perl modules under $libdir instead of in perl's
Etan Reisner <deryni@pidgin.im>
parents:
24241
diff
changeset
|
174 | |
|
27664
f237942129f0
This seems to work better on Windows, what with the spaces in the path and the
Etan Reisner <deryni@pidgin.im>
parents:
27584
diff
changeset
|
175 | uselib = g_strdup_printf("unshift @INC, q(%s%sperl);", |
|
f237942129f0
This seems to work better on Windows, what with the spaces in the path and the
Etan Reisner <deryni@pidgin.im>
parents:
27584
diff
changeset
|
176 | search_path, G_DIR_SEPARATOR_S); |
|
27584
134e07aa6f64
Install the Purple and Pidgin perl modules under $libdir instead of in perl's
Etan Reisner <deryni@pidgin.im>
parents:
24241
diff
changeset
|
177 | eval_pv(uselib, TRUE); |
|
134e07aa6f64
Install the Purple and Pidgin perl modules under $libdir instead of in perl's
Etan Reisner <deryni@pidgin.im>
parents:
24241
diff
changeset
|
178 | g_free(uselib); |
|
134e07aa6f64
Install the Purple and Pidgin perl modules under $libdir instead of in perl's
Etan Reisner <deryni@pidgin.im>
parents:
24241
diff
changeset
|
179 | } |
| 5205 | 180 | } |
| 181 | ||
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
182 | static void |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
183 | perl_init(void) |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
184 | { |
| 12873 | 185 | /* changed the name of the variable from load_file to perl_definitions |
| 186 | * since now it does much more than defining the load_file sub. | |
| 187 | * Moreover, deplaced the initialisation to the xs_init function. | |
| 188 | * (TheHobbit) */ | |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
189 | char *perl_args[] = { "", "-e", "0", "-w" }; |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
190 | char perl_definitions[] = |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
191 | { |
| 12873 | 192 | /* We use to function one to load a file the other to execute |
| 193 | * the string obtained from the first and holding the file | |
| 194 | * contents. This allows to have a really local $/ without | |
| 195 | * introducing temp variables to hold the old value. Just a | |
| 196 | * question of style:) */ | |
| 15884 | 197 | "package Purple::PerlLoader;" |
|
6636
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
198 | "use Symbol;" |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
199 | |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
200 | "sub load_file {" |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
201 | "my $f_name=shift;" |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
202 | "local $/=undef;" |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
203 | "open FH,$f_name or return \"__FAILED__\";" |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
204 | "$_=<FH>;" |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
205 | "close FH;" |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
206 | "return $_;" |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
207 | "}" |
|
6636
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
208 | |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
209 | "sub destroy_package {" |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
210 | "eval { $_[0]->UNLOAD() if $_[0]->can('UNLOAD'); };" |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
211 | "Symbol::delete_package($_[0]);" |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
212 | "}" |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
213 | |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
214 | "sub load_n_eval {" |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
215 | "my ($f_name, $package) = @_;" |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
216 | "destroy_package($package);" |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
217 | "my $strin=load_file($f_name);" |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
218 | "return 2 if($strin eq \"__FAILED__\");" |
|
6636
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
219 | "my $eval = qq{package $package; $strin;};" |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
220 | |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
221 | "{" |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
222 | " eval $eval;" |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
223 | "}" |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
224 | |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
225 | "if($@) {" |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
226 | /*" #something went wrong\n"*/ |
|
6636
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
227 | "die(\"Errors loading file $f_name: $@\");" |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
228 | "}" |
|
6636
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
229 | |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
230 | "return 0;" |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
231 | "}" |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
232 | }; |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
233 | |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
234 | my_perl = perl_alloc(); |
| 12871 | 235 | PERL_SET_CONTEXT(my_perl); |
| 11290 | 236 | PL_perl_destruct_level = 1; |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
237 | perl_construct(my_perl); |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
238 | #ifdef DEBUG |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
239 | perl_parse(my_perl, xs_init, 4, perl_args, NULL); |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
240 | #else |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
241 | perl_parse(my_perl, xs_init, 3, perl_args, NULL); |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
242 | #endif |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
243 | #ifdef HAVE_PERL_EVAL_PV |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
244 | eval_pv(perl_definitions, TRUE); |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
245 | #else |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
246 | perl_eval_pv(perl_definitions, TRUE); /* deprecated */ |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
247 | #endif |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
248 | perl_run(my_perl); |
| 5205 | 249 | } |
| 250 | ||
| 251 | static void | |
| 252 | perl_end(void) | |
| 253 | { | |
|
6520
5386692555c9
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
254 | if (my_perl == NULL) |
|
5386692555c9
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
255 | return; |
| 12871 | 256 | |
| 11290 | 257 | PL_perl_destruct_level = 1; |
| 12873 | 258 | PERL_SET_CONTEXT(my_perl); |
|
6520
5386692555c9
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
259 | perl_eval_pv( |
|
5386692555c9
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
260 | "foreach my $lib (@DynaLoader::dl_modules) {" |
| 15884 | 261 | "if ($lib =~ /^Purple\\b/) {" |
|
6520
5386692555c9
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
262 | "$lib .= '::deinit();';" |
|
5386692555c9
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
263 | "eval $lib;" |
|
5386692555c9
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
264 | "}" |
|
5386692555c9
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
265 | "}", |
|
5386692555c9
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
266 | TRUE); |
|
5386692555c9
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
267 | |
| 11290 | 268 | PL_perl_destruct_level = 1; |
| 12871 | 269 | PERL_SET_CONTEXT(my_perl); |
|
6520
5386692555c9
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
270 | perl_destruct(my_perl); |
|
5386692555c9
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
271 | perl_free(my_perl); |
|
5386692555c9
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
272 | my_perl = NULL; |
| 5205 | 273 | } |
| 274 | ||
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
275 | void |
| 15884 | 276 | purple_perl_callXS(void (*subaddr)(pTHX_ CV *cv), CV *cv, SV **mark) |
| 5205 | 277 | { |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
278 | dSP; |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
279 | |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
280 | PUSHMARK(mark); |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
281 | (*subaddr)(aTHX_ cv); |
| 5205 | 282 | |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
283 | PUTBACK; |
| 5205 | 284 | } |
| 285 | ||
| 286 | static gboolean | |
| 15884 | 287 | probe_perl_plugin(PurplePlugin *plugin) |
| 5205 | 288 | { |
| 12871 | 289 | |
|
23915
b62601fd6e7d
Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents:
20288
diff
changeset
|
290 | char *args[] = {"", plugin->path }; |
|
b62601fd6e7d
Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents:
20288
diff
changeset
|
291 | char **argv = args; |
|
23932
806fd6e850ed
Add error handling for visiblity to why Perl plugins fail to load.
Daniel Atallah <datallah@pidgin.im>
parents:
23930
diff
changeset
|
292 | int argc = 2, ret; |
|
23915
b62601fd6e7d
Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents:
20288
diff
changeset
|
293 | PerlInterpreter *prober; |
| 5205 | 294 | gboolean status = TRUE; |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
295 | HV *plugin_info; |
|
23915
b62601fd6e7d
Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents:
20288
diff
changeset
|
296 | |
|
b62601fd6e7d
Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents:
20288
diff
changeset
|
297 | PERL_SYS_INIT(&argc, &argv); |
|
b62601fd6e7d
Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents:
20288
diff
changeset
|
298 | |
|
b62601fd6e7d
Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents:
20288
diff
changeset
|
299 | /* XXX This would be much faster if we didn't create a new |
|
b62601fd6e7d
Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents:
20288
diff
changeset
|
300 | * PerlInterpreter every time we probe a plugin */ |
|
b62601fd6e7d
Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents:
20288
diff
changeset
|
301 | prober = perl_alloc(); |
|
b62601fd6e7d
Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents:
20288
diff
changeset
|
302 | |
| 12871 | 303 | PERL_SET_CONTEXT(prober); |
|
23915
b62601fd6e7d
Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents:
20288
diff
changeset
|
304 | |
| 11290 | 305 | PL_perl_destruct_level = 1; |
| 5205 | 306 | perl_construct(prober); |
| 11290 | 307 | |
|
23917
8555374207d8
Fix output redirection for perl plugins on win32.
Daniel Atallah <datallah@pidgin.im>
parents:
23915
diff
changeset
|
308 | /* Fix IO redirection to match where pidgin's is going. |
|
8555374207d8
Fix output redirection for perl plugins on win32.
Daniel Atallah <datallah@pidgin.im>
parents:
23915
diff
changeset
|
309 | * Without this, we lose stdout/stderr unless we redirect to a file */ |
|
8555374207d8
Fix output redirection for perl plugins on win32.
Daniel Atallah <datallah@pidgin.im>
parents:
23915
diff
changeset
|
310 | #ifdef _WIN32 |
|
8555374207d8
Fix output redirection for perl plugins on win32.
Daniel Atallah <datallah@pidgin.im>
parents:
23915
diff
changeset
|
311 | { |
|
8555374207d8
Fix output redirection for perl plugins on win32.
Daniel Atallah <datallah@pidgin.im>
parents:
23915
diff
changeset
|
312 | PerlIO* newprlIO = PerlIO_open("CONOUT$", "w"); |
|
8555374207d8
Fix output redirection for perl plugins on win32.
Daniel Atallah <datallah@pidgin.im>
parents:
23915
diff
changeset
|
313 | if (newprlIO) { |
|
8555374207d8
Fix output redirection for perl plugins on win32.
Daniel Atallah <datallah@pidgin.im>
parents:
23915
diff
changeset
|
314 | int stdout_fd = PerlIO_fileno(PerlIO_stdout()); |
|
8555374207d8
Fix output redirection for perl plugins on win32.
Daniel Atallah <datallah@pidgin.im>
parents:
23915
diff
changeset
|
315 | int stderr_fd = PerlIO_fileno(PerlIO_stderr()); |
|
8555374207d8
Fix output redirection for perl plugins on win32.
Daniel Atallah <datallah@pidgin.im>
parents:
23915
diff
changeset
|
316 | PerlIO_close(PerlIO_stdout()); |
|
8555374207d8
Fix output redirection for perl plugins on win32.
Daniel Atallah <datallah@pidgin.im>
parents:
23915
diff
changeset
|
317 | PerlIO_close(PerlIO_stderr()); |
|
8555374207d8
Fix output redirection for perl plugins on win32.
Daniel Atallah <datallah@pidgin.im>
parents:
23915
diff
changeset
|
318 | PerlLIO_dup2(PerlIO_fileno(newprlIO), stdout_fd); |
|
8555374207d8
Fix output redirection for perl plugins on win32.
Daniel Atallah <datallah@pidgin.im>
parents:
23915
diff
changeset
|
319 | PerlLIO_dup2(PerlIO_fileno(newprlIO), stderr_fd); |
|
8555374207d8
Fix output redirection for perl plugins on win32.
Daniel Atallah <datallah@pidgin.im>
parents:
23915
diff
changeset
|
320 | |
|
8555374207d8
Fix output redirection for perl plugins on win32.
Daniel Atallah <datallah@pidgin.im>
parents:
23915
diff
changeset
|
321 | PerlIO_close(newprlIO); |
|
8555374207d8
Fix output redirection for perl plugins on win32.
Daniel Atallah <datallah@pidgin.im>
parents:
23915
diff
changeset
|
322 | } |
|
8555374207d8
Fix output redirection for perl plugins on win32.
Daniel Atallah <datallah@pidgin.im>
parents:
23915
diff
changeset
|
323 | } |
|
8555374207d8
Fix output redirection for perl plugins on win32.
Daniel Atallah <datallah@pidgin.im>
parents:
23915
diff
changeset
|
324 | #endif |
|
8555374207d8
Fix output redirection for perl plugins on win32.
Daniel Atallah <datallah@pidgin.im>
parents:
23915
diff
changeset
|
325 | |
|
23932
806fd6e850ed
Add error handling for visiblity to why Perl plugins fail to load.
Daniel Atallah <datallah@pidgin.im>
parents:
23930
diff
changeset
|
326 | ret = perl_parse(prober, xs_init, argc, argv, NULL); |
|
806fd6e850ed
Add error handling for visiblity to why Perl plugins fail to load.
Daniel Atallah <datallah@pidgin.im>
parents:
23930
diff
changeset
|
327 | |
|
806fd6e850ed
Add error handling for visiblity to why Perl plugins fail to load.
Daniel Atallah <datallah@pidgin.im>
parents:
23930
diff
changeset
|
328 | if (ret != 0) { |
|
806fd6e850ed
Add error handling for visiblity to why Perl plugins fail to load.
Daniel Atallah <datallah@pidgin.im>
parents:
23930
diff
changeset
|
329 | const char * errmsg = "Unknown error"; |
|
806fd6e850ed
Add error handling for visiblity to why Perl plugins fail to load.
Daniel Atallah <datallah@pidgin.im>
parents:
23930
diff
changeset
|
330 | if (SvTRUE(ERRSV)) |
|
23980
a38cbb35eecf
Some cleanup and a couple leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
23932
diff
changeset
|
331 | errmsg = SvPVutf8_nolen(ERRSV); |
|
23932
806fd6e850ed
Add error handling for visiblity to why Perl plugins fail to load.
Daniel Atallah <datallah@pidgin.im>
parents:
23930
diff
changeset
|
332 | purple_debug_error("perl", "Unable to parse plugin %s (%d:%s)\n", |
|
806fd6e850ed
Add error handling for visiblity to why Perl plugins fail to load.
Daniel Atallah <datallah@pidgin.im>
parents:
23930
diff
changeset
|
333 | plugin->path, ret, errmsg); |
|
23980
a38cbb35eecf
Some cleanup and a couple leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
23932
diff
changeset
|
334 | status = FALSE; |
|
23932
806fd6e850ed
Add error handling for visiblity to why Perl plugins fail to load.
Daniel Atallah <datallah@pidgin.im>
parents:
23930
diff
changeset
|
335 | goto cleanup; |
|
806fd6e850ed
Add error handling for visiblity to why Perl plugins fail to load.
Daniel Atallah <datallah@pidgin.im>
parents:
23930
diff
changeset
|
336 | } |
| 11290 | 337 | |
|
23932
806fd6e850ed
Add error handling for visiblity to why Perl plugins fail to load.
Daniel Atallah <datallah@pidgin.im>
parents:
23930
diff
changeset
|
338 | ret = perl_run(prober); |
|
806fd6e850ed
Add error handling for visiblity to why Perl plugins fail to load.
Daniel Atallah <datallah@pidgin.im>
parents:
23930
diff
changeset
|
339 | |
|
806fd6e850ed
Add error handling for visiblity to why Perl plugins fail to load.
Daniel Atallah <datallah@pidgin.im>
parents:
23930
diff
changeset
|
340 | if (ret != 0) { |
|
806fd6e850ed
Add error handling for visiblity to why Perl plugins fail to load.
Daniel Atallah <datallah@pidgin.im>
parents:
23930
diff
changeset
|
341 | const char * errmsg = "Unknown error"; |
|
806fd6e850ed
Add error handling for visiblity to why Perl plugins fail to load.
Daniel Atallah <datallah@pidgin.im>
parents:
23930
diff
changeset
|
342 | if (SvTRUE(ERRSV)) |
|
23980
a38cbb35eecf
Some cleanup and a couple leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
23932
diff
changeset
|
343 | errmsg = SvPVutf8_nolen(ERRSV); |
|
23932
806fd6e850ed
Add error handling for visiblity to why Perl plugins fail to load.
Daniel Atallah <datallah@pidgin.im>
parents:
23930
diff
changeset
|
344 | purple_debug_error("perl", "Unable to run perl interpreter on plugin %s (%d:%s)\n", |
|
806fd6e850ed
Add error handling for visiblity to why Perl plugins fail to load.
Daniel Atallah <datallah@pidgin.im>
parents:
23930
diff
changeset
|
345 | plugin->path, ret, errmsg); |
|
23980
a38cbb35eecf
Some cleanup and a couple leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
23932
diff
changeset
|
346 | status = FALSE; |
|
23932
806fd6e850ed
Add error handling for visiblity to why Perl plugins fail to load.
Daniel Atallah <datallah@pidgin.im>
parents:
23930
diff
changeset
|
347 | goto cleanup; |
|
806fd6e850ed
Add error handling for visiblity to why Perl plugins fail to load.
Daniel Atallah <datallah@pidgin.im>
parents:
23930
diff
changeset
|
348 | } |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
349 | |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
350 | plugin_info = perl_get_hv("PLUGIN_INFO", FALSE); |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
351 | |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
352 | if (plugin_info == NULL) |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
353 | status = FALSE; |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
354 | else if (!hv_exists(plugin_info, "perl_api_version", |
| 12871 | 355 | strlen("perl_api_version")) || |
| 356 | !hv_exists(plugin_info, "name", strlen("name")) || | |
| 357 | !hv_exists(plugin_info, "load", strlen("load"))) { | |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
358 | /* Not a valid plugin. */ |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
359 | |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
360 | status = FALSE; |
| 12871 | 361 | } else { |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
362 | SV **key; |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
363 | int perl_api_ver; |
| 5205 | 364 | |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
365 | key = hv_fetch(plugin_info, "perl_api_version", |
| 12873 | 366 | strlen("perl_api_version"), 0); |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
367 | |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
368 | perl_api_ver = SvIV(*key); |
| 5205 | 369 | |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
370 | if (perl_api_ver != 2) |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
371 | status = FALSE; |
| 12871 | 372 | else { |
| 15884 | 373 | PurplePluginInfo *info; |
| 374 | PurplePerlScript *gps; | |
|
6636
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
375 | char *basename; |
| 5205 | 376 | |
| 15884 | 377 | info = g_new0(PurplePluginInfo, 1); |
| 378 | gps = g_new0(PurplePerlScript, 1); | |
|
33906
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
379 | gps->info_strings = g_new0(PurplePerlInfoStrings, 1); |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
380 | |
| 15884 | 381 | info->magic = PURPLE_PLUGIN_MAGIC; |
| 382 | info->major_version = PURPLE_MAJOR_VERSION; | |
| 383 | info->minor_version = PURPLE_MINOR_VERSION; | |
| 384 | info->type = PURPLE_PLUGIN_STANDARD; | |
| 5205 | 385 | |
| 386 | info->dependencies = g_list_append(info->dependencies, | |
| 12871 | 387 | PERL_PLUGIN_ID); |
| 5205 | 388 | |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
389 | gps->plugin = plugin; |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
390 | |
|
6636
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
391 | basename = g_path_get_basename(plugin->path); |
| 15884 | 392 | purple_perl_normalize_script_name(basename); |
| 393 | gps->package = g_strdup_printf("Purple::Script::%s", | |
| 12871 | 394 | basename); |
|
6636
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
395 | g_free(basename); |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
396 | |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
397 | /* We know this one exists. */ |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
398 | key = hv_fetch(plugin_info, "name", strlen("name"), 0); |
|
33906
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
399 | info->name = gps->info_strings->name = g_strdup(SvPVutf8_nolen(*key)); |
| 12984 | 400 | /* Set id here in case we don't find one later. */ |
|
33906
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
401 | info->id = gps->info_strings->id = g_strdup(info->name); |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
402 | |
| 15884 | 403 | #ifdef PURPLE_GTKPERL |
| 12871 | 404 | if ((key = hv_fetch(plugin_info, "GTK_UI", |
| 405 | strlen("GTK_UI"), 0))) | |
| 15884 | 406 | info->ui_requirement = PURPLE_GTK_PLUGIN_TYPE; |
| 14434 | 407 | #endif |
| 11170 | 408 | |
| 12871 | 409 | if ((key = hv_fetch(plugin_info, "url", |
| 410 | strlen("url"), 0))) | |
|
33906
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
411 | info->homepage = gps->info_strings->homepage = g_strdup(SvPVutf8_nolen(*key)); |
| 12873 | 412 | |
| 12871 | 413 | if ((key = hv_fetch(plugin_info, "author", |
| 414 | strlen("author"), 0))) | |
|
33906
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
415 | info->author = gps->info_strings->author = g_strdup(SvPVutf8_nolen(*key)); |
| 5205 | 416 | |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
417 | if ((key = hv_fetch(plugin_info, "summary", |
| 12871 | 418 | strlen("summary"), 0))) |
|
33906
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
419 | info->summary = gps->info_strings->summary = g_strdup(SvPVutf8_nolen(*key)); |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
420 | |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
421 | if ((key = hv_fetch(plugin_info, "description", |
| 12871 | 422 | strlen("description"), 0))) |
|
33906
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
423 | info->description = gps->info_strings->description = g_strdup(SvPVutf8_nolen(*key)); |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
424 | |
| 12871 | 425 | if ((key = hv_fetch(plugin_info, "version", |
| 426 | strlen("version"), 0))) | |
|
33906
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
427 | info->version = gps->info_strings->version = g_strdup(SvPVutf8_nolen(*key)); |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
428 | |
| 12984 | 429 | /* We know this one exists. */ |
| 430 | key = hv_fetch(plugin_info, "load", strlen("load"), 0); | |
| 431 | gps->load_sub = g_strdup_printf("%s::%s", gps->package, | |
|
23980
a38cbb35eecf
Some cleanup and a couple leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
23932
diff
changeset
|
432 | SvPVutf8_nolen(*key)); |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
433 | |
| 12871 | 434 | if ((key = hv_fetch(plugin_info, "unload", |
| 435 | strlen("unload"), 0))) | |
| 436 | gps->unload_sub = g_strdup_printf("%s::%s", | |
| 437 | gps->package, | |
|
23980
a38cbb35eecf
Some cleanup and a couple leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
23932
diff
changeset
|
438 | SvPVutf8_nolen(*key)); |
| 5205 | 439 | |
| 12984 | 440 | if ((key = hv_fetch(plugin_info, "id", |
| 441 | strlen("id"), 0))) { | |
|
33906
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
442 | g_free(gps->info_strings->id); |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
443 | info->id = gps->info_strings->id = g_strdup_printf("perl-%s", |
|
23980
a38cbb35eecf
Some cleanup and a couple leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
23932
diff
changeset
|
444 | SvPVutf8_nolen(*key)); |
| 12984 | 445 | } |
| 446 | ||
| 12871 | 447 | /********************************************************/ |
| 448 | /* Only one of the next two options should be present */ | |
| 449 | /* */ | |
| 15884 | 450 | /* prefs_info - Uses non-GUI (read GTK) purple API calls */ |
| 451 | /* and creates a PurplePluginPrefInfo type. */ | |
| 12871 | 452 | /* */ |
| 453 | /* gtk_prefs_info - Requires gtk2-perl be installed by */ | |
| 12873 | 454 | /* the user and he must create a */ |
| 455 | /* GtkWidget the user and he must */ | |
| 456 | /* create a GtkWidget representing the */ | |
| 457 | /* plugin preferences page. */ | |
| 12871 | 458 | /********************************************************/ |
| 459 | if ((key = hv_fetch(plugin_info, "prefs_info", | |
| 460 | strlen("prefs_info"), 0))) { | |
| 461 | /* key now is the name of the Perl sub that | |
| 462 | * will create a frame for us */ | |
| 12872 | 463 | gps->prefs_sub = g_strdup_printf("%s::%s", |
| 464 | gps->package, | |
|
23980
a38cbb35eecf
Some cleanup and a couple leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
23932
diff
changeset
|
465 | SvPVutf8_nolen(*key)); |
| 12872 | 466 | info->prefs_info = &ui_info; |
| 11123 | 467 | } |
| 12890 | 468 | |
| 15884 | 469 | #ifdef PURPLE_GTKPERL |
| 12871 | 470 | if ((key = hv_fetch(plugin_info, "gtk_prefs_info", |
| 471 | strlen("gtk_prefs_info"), 0))) { | |
| 472 | /* key now is the name of the Perl sub that | |
| 473 | * will create a frame for us */ | |
| 12872 | 474 | gps->gtk_prefs_sub = g_strdup_printf("%s::%s", |
| 475 | gps->package, | |
|
23980
a38cbb35eecf
Some cleanup and a couple leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
23932
diff
changeset
|
476 | SvPVutf8_nolen(*key)); |
| 12872 | 477 | info->ui_info = >k_ui_info; |
| 11170 | 478 | } |
|
14426
8d4f164c4979
[gaim-migrate @ 17070]
Daniel Atallah <datallah@pidgin.im>
parents:
14254
diff
changeset
|
479 | #endif |
| 11170 | 480 | |
| 12988 | 481 | if ((key = hv_fetch(plugin_info, "plugin_action_sub", |
| 482 | strlen("plugin_action_sub"), 0))) { | |
| 483 | gps->plugin_action_sub = g_strdup_printf("%s::%s", | |
| 484 | gps->package, | |
|
23980
a38cbb35eecf
Some cleanup and a couple leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
23932
diff
changeset
|
485 | SvPVutf8_nolen(*key)); |
| 15884 | 486 | info->actions = purple_perl_plugin_actions; |
| 11170 | 487 | } |
| 11123 | 488 | |
| 5205 | 489 | plugin->info = info; |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
490 | info->extra_info = gps; |
| 5205 | 491 | |
| 15884 | 492 | status = purple_plugin_register(plugin); |
| 5205 | 493 | } |
| 494 | } | |
| 12871 | 495 | |
|
23932
806fd6e850ed
Add error handling for visiblity to why Perl plugins fail to load.
Daniel Atallah <datallah@pidgin.im>
parents:
23930
diff
changeset
|
496 | cleanup: |
| 11290 | 497 | PL_perl_destruct_level = 1; |
| 12871 | 498 | PERL_SET_CONTEXT(prober); |
| 5205 | 499 | perl_destruct(prober); |
| 500 | perl_free(prober); | |
| 501 | return status; | |
| 502 | } | |
| 503 | ||
| 504 | static gboolean | |
| 15884 | 505 | load_perl_plugin(PurplePlugin *plugin) |
| 5205 | 506 | { |
| 15884 | 507 | PurplePerlScript *gps = (PurplePerlScript *)plugin->info->extra_info; |
|
24241
e6fc766f3e91
Return FALSE when a perl plugin cannot be loaded.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23980
diff
changeset
|
508 | gboolean loaded = TRUE; |
|
6636
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
509 | char *atmp[3] = { plugin->path, NULL, NULL }; |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
510 | |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
511 | if (gps == NULL || gps->load_sub == NULL) |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
512 | return FALSE; |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
513 | |
| 15884 | 514 | purple_debug(PURPLE_DEBUG_INFO, "perl", "Loading perl script\n"); |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
515 | |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
516 | if (my_perl == NULL) |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
517 | perl_init(); |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
518 | |
|
6636
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
519 | plugin->handle = gps; |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
520 | |
|
6636
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
521 | atmp[1] = gps->package; |
| 12871 | 522 | |
| 523 | PERL_SET_CONTEXT(my_perl); | |
| 15884 | 524 | execute_perl("Purple::PerlLoader::load_n_eval", 2, atmp); |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
525 | |
|
6536
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
526 | { |
|
11318
13fa1d5134f3
[gaim-migrate @ 13521]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11290
diff
changeset
|
527 | dSP; |
| 11290 | 528 | PERL_SET_CONTEXT(my_perl); |
|
11318
13fa1d5134f3
[gaim-migrate @ 13521]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11290
diff
changeset
|
529 | SPAGAIN; |
|
6536
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
530 | ENTER; |
|
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
531 | SAVETMPS; |
|
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
532 | PUSHMARK(sp); |
| 15884 | 533 | XPUSHs(sv_2mortal(purple_perl_bless_object(plugin, |
| 534 | "Purple::Plugin"))); | |
|
6536
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
535 | PUTBACK; |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
536 | |
|
6536
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
537 | perl_call_pv(gps->load_sub, G_EVAL | G_SCALAR); |
|
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
538 | SPAGAIN; |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
539 | |
|
6536
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
540 | if (SvTRUE(ERRSV)) { |
| 15884 | 541 | purple_debug(PURPLE_DEBUG_ERROR, "perl", |
| 12871 | 542 | "Perl function %s exited abnormally: %s\n", |
|
23980
a38cbb35eecf
Some cleanup and a couple leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
23932
diff
changeset
|
543 | gps->load_sub, SvPVutf8_nolen(ERRSV)); |
|
24241
e6fc766f3e91
Return FALSE when a perl plugin cannot be loaded.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23980
diff
changeset
|
544 | loaded = FALSE; |
|
6536
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
545 | } |
|
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
546 | |
|
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
547 | PUTBACK; |
|
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
548 | FREETMPS; |
|
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
549 | LEAVE; |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
550 | } |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
551 | |
|
24241
e6fc766f3e91
Return FALSE when a perl plugin cannot be loaded.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23980
diff
changeset
|
552 | return loaded; |
| 5205 | 553 | } |
| 554 | ||
|
6636
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
555 | static void |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
556 | destroy_package(const char *package) |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
557 | { |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
558 | dSP; |
|
11318
13fa1d5134f3
[gaim-migrate @ 13521]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11290
diff
changeset
|
559 | PERL_SET_CONTEXT(my_perl); |
|
13fa1d5134f3
[gaim-migrate @ 13521]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11290
diff
changeset
|
560 | SPAGAIN; |
|
6636
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
561 | |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
562 | ENTER; |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
563 | SAVETMPS; |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
564 | |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
565 | PUSHMARK(SP); |
|
23980
a38cbb35eecf
Some cleanup and a couple leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
23932
diff
changeset
|
566 | XPUSHs(sv_2mortal(newSVpv(package, 0))); |
|
6636
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
567 | PUTBACK; |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
568 | |
| 15884 | 569 | perl_call_pv("Purple::PerlLoader::destroy_package", |
| 12871 | 570 | G_VOID | G_EVAL | G_DISCARD); |
|
6636
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
571 | |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
572 | SPAGAIN; |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
573 | |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
574 | PUTBACK; |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
575 | FREETMPS; |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
576 | LEAVE; |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
577 | } |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
578 | |
| 5205 | 579 | static gboolean |
| 15884 | 580 | unload_perl_plugin(PurplePlugin *plugin) |
| 5205 | 581 | { |
| 15884 | 582 | PurplePerlScript *gps = (PurplePerlScript *)plugin->info->extra_info; |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
583 | |
|
9578
d02c3d247fb7
[gaim-migrate @ 10421]
Christian Hammond <chipx86@chipx86.com>
parents:
8993
diff
changeset
|
584 | if (gps == NULL) |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
585 | return FALSE; |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
586 | |
| 15884 | 587 | purple_debug(PURPLE_DEBUG_INFO, "perl", "Unloading perl script\n"); |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
588 | |
| 12871 | 589 | if (gps->unload_sub != NULL) { |
|
6536
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
590 | dSP; |
|
11318
13fa1d5134f3
[gaim-migrate @ 13521]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11290
diff
changeset
|
591 | PERL_SET_CONTEXT(my_perl); |
|
13fa1d5134f3
[gaim-migrate @ 13521]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11290
diff
changeset
|
592 | SPAGAIN; |
|
6536
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
593 | ENTER; |
|
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
594 | SAVETMPS; |
|
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
595 | PUSHMARK(sp); |
| 15884 | 596 | XPUSHs(sv_2mortal(purple_perl_bless_object(plugin, |
| 597 | "Purple::Plugin"))); | |
|
6536
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
598 | PUTBACK; |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
599 | |
|
6536
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
600 | perl_call_pv(gps->unload_sub, G_EVAL | G_SCALAR); |
|
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
601 | SPAGAIN; |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
602 | |
|
6536
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
603 | if (SvTRUE(ERRSV)) { |
| 15884 | 604 | purple_debug(PURPLE_DEBUG_ERROR, "perl", |
| 12871 | 605 | "Perl function %s exited abnormally: %s\n", |
|
23980
a38cbb35eecf
Some cleanup and a couple leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
23932
diff
changeset
|
606 | gps->unload_sub, SvPVutf8_nolen(ERRSV)); |
|
6536
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
607 | } |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
608 | |
|
6536
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
609 | PUTBACK; |
|
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
610 | FREETMPS; |
|
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
611 | LEAVE; |
|
b91ae5d45371
[gaim-migrate @ 7053]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
612 | } |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
613 | |
| 15884 | 614 | purple_perl_cmd_clear_for_plugin(plugin); |
| 615 | purple_perl_signal_clear_for_plugin(plugin); | |
| 616 | purple_perl_timeout_clear_for_plugin(plugin); | |
|
23930
c1c3d7cab338
Add support to the Perl plugin loader for listing for pref changes.
Daniel Atallah <datallah@pidgin.im>
parents:
23917
diff
changeset
|
617 | purple_perl_pref_cb_clear_for_plugin(plugin); |
| 5205 | 618 | |
|
6636
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
619 | destroy_package(gps->package); |
|
e906c663da5c
[gaim-migrate @ 7161]
Christian Hammond <chipx86@chipx86.com>
parents:
6575
diff
changeset
|
620 | |
| 5205 | 621 | return TRUE; |
| 622 | } | |
| 623 | ||
| 624 | static void | |
| 15884 | 625 | destroy_perl_plugin(PurplePlugin *plugin) |
| 5205 | 626 | { |
| 12873 | 627 | if (plugin->info != NULL) { |
| 15884 | 628 | PurplePerlScript *gps; |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
629 | |
| 15884 | 630 | gps = (PurplePerlScript *)plugin->info->extra_info; |
| 12871 | 631 | if (gps != NULL) { |
|
33906
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
632 | perl_infostrings_free(gps->info_strings); |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
633 | gps->info_strings = NULL; |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
28642
diff
changeset
|
634 | |
|
23980
a38cbb35eecf
Some cleanup and a couple leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
23932
diff
changeset
|
635 | g_free(gps->package); |
| 12871 | 636 | g_free(gps->load_sub); |
| 637 | g_free(gps->unload_sub); | |
| 12872 | 638 | g_free(gps->prefs_sub); |
| 15884 | 639 | #ifdef PURPLE_GTKPERL |
| 12872 | 640 | g_free(gps->gtk_prefs_sub); |
|
14426
8d4f164c4979
[gaim-migrate @ 17070]
Daniel Atallah <datallah@pidgin.im>
parents:
14254
diff
changeset
|
641 | #endif |
|
23980
a38cbb35eecf
Some cleanup and a couple leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
23932
diff
changeset
|
642 | g_free(gps->plugin_action_sub); |
|
6508
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
643 | g_free(gps); |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
644 | plugin->info->extra_info = NULL; |
|
57d1df1ca3a0
[gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
645 | } |
|
28642
b23df5d1387e
Leak fix for perl plugins.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27664
diff
changeset
|
646 | |
|
b23df5d1387e
Leak fix for perl plugins.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27664
diff
changeset
|
647 | g_free(plugin->info); |
|
b23df5d1387e
Leak fix for perl plugins.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27664
diff
changeset
|
648 | plugin->info = NULL; |
| 5205 | 649 | } |
| 650 | } | |
| 651 | ||
| 652 | static gboolean | |
| 15884 | 653 | plugin_load(PurplePlugin *plugin) |
| 11033 | 654 | { |
| 655 | return TRUE; | |
| 656 | } | |
| 657 | ||
| 658 | static gboolean | |
| 15884 | 659 | plugin_unload(PurplePlugin *plugin) |
| 5205 | 660 | { |
| 661 | perl_end(); | |
| 662 | ||
| 663 | return TRUE; | |
| 664 | } | |
| 665 | ||
| 15884 | 666 | static PurplePluginLoaderInfo loader_info = |
| 5205 | 667 | { |
| 668 | NULL, /**< exts */ | |
| 669 | probe_perl_plugin, /**< probe */ | |
| 670 | load_perl_plugin, /**< load */ | |
| 671 | unload_perl_plugin, /**< unload */ | |
|
16750
a568944eee52
Updating the loaders since I missed them since I'm not building any of them right now
Gary Kramlich <grim@reaperworld.com>
parents:
16529
diff
changeset
|
672 | destroy_perl_plugin, /**< destroy */ |
|
23915
b62601fd6e7d
Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents:
20288
diff
changeset
|
673 | |
|
16750
a568944eee52
Updating the loaders since I missed them since I'm not building any of them right now
Gary Kramlich <grim@reaperworld.com>
parents:
16529
diff
changeset
|
674 | /* padding */ |
|
a568944eee52
Updating the loaders since I missed them since I'm not building any of them right now
Gary Kramlich <grim@reaperworld.com>
parents:
16529
diff
changeset
|
675 | NULL, |
|
a568944eee52
Updating the loaders since I missed them since I'm not building any of them right now
Gary Kramlich <grim@reaperworld.com>
parents:
16529
diff
changeset
|
676 | NULL, |
|
a568944eee52
Updating the loaders since I missed them since I'm not building any of them right now
Gary Kramlich <grim@reaperworld.com>
parents:
16529
diff
changeset
|
677 | NULL, |
|
a568944eee52
Updating the loaders since I missed them since I'm not building any of them right now
Gary Kramlich <grim@reaperworld.com>
parents:
16529
diff
changeset
|
678 | NULL |
| 5205 | 679 | }; |
| 680 | ||
| 15884 | 681 | static PurplePluginInfo info = |
| 5205 | 682 | { |
| 15884 | 683 | PURPLE_PLUGIN_MAGIC, |
| 684 | PURPLE_MAJOR_VERSION, | |
| 685 | PURPLE_MINOR_VERSION, | |
|
16529
1d0da9270ff9
This is mostly moving Purple::GtkUI:: -> Pidgin:: which has the side effect of
Etan Reisner <deryni@pidgin.im>
parents:
16528
diff
changeset
|
686 | PURPLE_PLUGIN_LOADER, /**< type */ |
| 5205 | 687 | NULL, /**< ui_requirement */ |
| 688 | 0, /**< flags */ | |
| 689 | NULL, /**< dependencies */ | |
|
16529
1d0da9270ff9
This is mostly moving Purple::GtkUI:: -> Pidgin:: which has the side effect of
Etan Reisner <deryni@pidgin.im>
parents:
16528
diff
changeset
|
690 | PURPLE_PRIORITY_DEFAULT, /**< priority */ |
| 5205 | 691 | |
| 692 | PERL_PLUGIN_ID, /**< id */ | |
| 693 | N_("Perl Plugin Loader"), /**< name */ | |
|
20288
5ca925a094e2
applied changes from 03b709ec2a153e7e82719df0ba4635108bb1d3c6
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19859
diff
changeset
|
694 | DISPLAY_VERSION, /**< version */ |
| 5205 | 695 | N_("Provides support for loading perl plugins."), /**< summary */ |
| 696 | N_("Provides support for loading perl plugins."), /**< description */ | |
| 697 | "Christian Hammond <chipx86@gnupdate.org>", /**< author */ | |
|
16529
1d0da9270ff9
This is mostly moving Purple::GtkUI:: -> Pidgin:: which has the side effect of
Etan Reisner <deryni@pidgin.im>
parents:
16528
diff
changeset
|
698 | PURPLE_WEBSITE, /**< homepage */ |
| 5205 | 699 | |
| 11033 | 700 | plugin_load, /**< load */ |
| 5205 | 701 | plugin_unload, /**< unload */ |
| 702 | NULL, /**< destroy */ | |
| 703 | ||
| 704 | NULL, /**< ui_info */ | |
| 8993 | 705 | &loader_info, /**< extra_info */ |
| 706 | NULL, | |
|
16750
a568944eee52
Updating the loaders since I missed them since I'm not building any of them right now
Gary Kramlich <grim@reaperworld.com>
parents:
16529
diff
changeset
|
707 | NULL, |
|
a568944eee52
Updating the loaders since I missed them since I'm not building any of them right now
Gary Kramlich <grim@reaperworld.com>
parents:
16529
diff
changeset
|
708 | |
|
a568944eee52
Updating the loaders since I missed them since I'm not building any of them right now
Gary Kramlich <grim@reaperworld.com>
parents:
16529
diff
changeset
|
709 | /* padding */ |
|
a568944eee52
Updating the loaders since I missed them since I'm not building any of them right now
Gary Kramlich <grim@reaperworld.com>
parents:
16529
diff
changeset
|
710 | NULL, |
|
a568944eee52
Updating the loaders since I missed them since I'm not building any of them right now
Gary Kramlich <grim@reaperworld.com>
parents:
16529
diff
changeset
|
711 | NULL, |
|
a568944eee52
Updating the loaders since I missed them since I'm not building any of them right now
Gary Kramlich <grim@reaperworld.com>
parents:
16529
diff
changeset
|
712 | NULL, |
| 8993 | 713 | NULL |
| 5205 | 714 | }; |
| 715 | ||
| 716 | static void | |
| 15884 | 717 | init_plugin(PurplePlugin *plugin) |
| 5205 | 718 | { |
| 719 | loader_info.exts = g_list_append(loader_info.exts, "pl"); | |
| 720 | } | |
| 721 | ||
|
16528
6cd4a90e0970
Kill the libpurpleperl hack library and move the init stuff to perl.so itself.
Etan Reisner <deryni@pidgin.im>
parents:
15884
diff
changeset
|
722 | #ifdef __SUNPRO_C |
|
6cd4a90e0970
Kill the libpurpleperl hack library and move the init stuff to perl.so itself.
Etan Reisner <deryni@pidgin.im>
parents:
15884
diff
changeset
|
723 | #pragma init (my_init) |
|
6cd4a90e0970
Kill the libpurpleperl hack library and move the init stuff to perl.so itself.
Etan Reisner <deryni@pidgin.im>
parents:
15884
diff
changeset
|
724 | #else |
|
6cd4a90e0970
Kill the libpurpleperl hack library and move the init stuff to perl.so itself.
Etan Reisner <deryni@pidgin.im>
parents:
15884
diff
changeset
|
725 | void __attribute__ ((constructor)) my_init(void); |
|
6cd4a90e0970
Kill the libpurpleperl hack library and move the init stuff to perl.so itself.
Etan Reisner <deryni@pidgin.im>
parents:
15884
diff
changeset
|
726 | #endif |
|
6cd4a90e0970
Kill the libpurpleperl hack library and move the init stuff to perl.so itself.
Etan Reisner <deryni@pidgin.im>
parents:
15884
diff
changeset
|
727 | |
|
6cd4a90e0970
Kill the libpurpleperl hack library and move the init stuff to perl.so itself.
Etan Reisner <deryni@pidgin.im>
parents:
15884
diff
changeset
|
728 | void |
|
6cd4a90e0970
Kill the libpurpleperl hack library and move the init stuff to perl.so itself.
Etan Reisner <deryni@pidgin.im>
parents:
15884
diff
changeset
|
729 | my_init(void) |
|
6cd4a90e0970
Kill the libpurpleperl hack library and move the init stuff to perl.so itself.
Etan Reisner <deryni@pidgin.im>
parents:
15884
diff
changeset
|
730 | { |
|
6cd4a90e0970
Kill the libpurpleperl hack library and move the init stuff to perl.so itself.
Etan Reisner <deryni@pidgin.im>
parents:
15884
diff
changeset
|
731 | /* Mostly evil hack... puts perl.so's symbols in the global table but |
|
6cd4a90e0970
Kill the libpurpleperl hack library and move the init stuff to perl.so itself.
Etan Reisner <deryni@pidgin.im>
parents:
15884
diff
changeset
|
732 | * does not create a circular dependency because g_module_open will |
|
6cd4a90e0970
Kill the libpurpleperl hack library and move the init stuff to perl.so itself.
Etan Reisner <deryni@pidgin.im>
parents:
15884
diff
changeset
|
733 | * only open the library once. */ |
|
6cd4a90e0970
Kill the libpurpleperl hack library and move the init stuff to perl.so itself.
Etan Reisner <deryni@pidgin.im>
parents:
15884
diff
changeset
|
734 | /* Do we need to keep track of the returned GModule here so that we |
|
6cd4a90e0970
Kill the libpurpleperl hack library and move the init stuff to perl.so itself.
Etan Reisner <deryni@pidgin.im>
parents:
15884
diff
changeset
|
735 | * can g_module_close it when this plugin gets unloaded? |
|
6cd4a90e0970
Kill the libpurpleperl hack library and move the init stuff to perl.so itself.
Etan Reisner <deryni@pidgin.im>
parents:
15884
diff
changeset
|
736 | * At the moment I don't think this plugin can ever get unloaded but |
|
6cd4a90e0970
Kill the libpurpleperl hack library and move the init stuff to perl.so itself.
Etan Reisner <deryni@pidgin.im>
parents:
15884
diff
changeset
|
737 | * in case that becomes possible this wants to get noted. */ |
|
6cd4a90e0970
Kill the libpurpleperl hack library and move the init stuff to perl.so itself.
Etan Reisner <deryni@pidgin.im>
parents:
15884
diff
changeset
|
738 | g_module_open("perl.so", 0); |
|
6cd4a90e0970
Kill the libpurpleperl hack library and move the init stuff to perl.so itself.
Etan Reisner <deryni@pidgin.im>
parents:
15884
diff
changeset
|
739 | } |
|
6cd4a90e0970
Kill the libpurpleperl hack library and move the init stuff to perl.so itself.
Etan Reisner <deryni@pidgin.im>
parents:
15884
diff
changeset
|
740 | |
| 15884 | 741 | PURPLE_INIT_PLUGIN(perl, init_plugin, info) |