libpurple/plugins/perl/perl.c

changeset 27584
134e07aa6f64
parent 24241
e6fc766f3e91
child 27664
f237942129f0
equal deleted inserted replaced
27583:616b68fe423f 27584:134e07aa6f64
129 #else 129 #else
130 xs_init(pTHX) 130 xs_init(pTHX)
131 #endif 131 #endif
132 { 132 {
133 char *file = __FILE__; 133 char *file = __FILE__;
134 GList *search_paths = purple_plugins_get_search_paths();
134 dXSUB_SYS; 135 dXSUB_SYS;
135 136
136 /* This one allows dynamic loading of perl modules in perl scripts by 137 /* This one allows dynamic loading of perl modules in perl scripts by
137 * the 'use perlmod;' construction */ 138 * the 'use perlmod;' construction */
138 newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); 139 newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
139 #ifdef _WIN32 140 #ifdef _WIN32
140 newXS("Win32CORE::bootstrap", boot_Win32CORE, file); 141 newXS("Win32CORE::bootstrap", boot_Win32CORE, file);
141 #endif 142 #endif
143
144 while (search_paths != NULL) {
145 gchar *uselib;
146 const gchar *search_path = search_paths->data;
147 search_paths = g_list_next(search_paths);
148
149 uselib = g_strdup_printf("unshift @INC, \"%s%cperl\";",
150 search_path, G_DIR_SEPARATOR);
151 eval_pv(uselib, TRUE);
152 g_free(uselib);
153 }
142 } 154 }
143 155
144 static void 156 static void
145 perl_init(void) 157 perl_init(void)
146 { 158 {

mercurial