Mercurial > pidgin.yaz
comparison src/module.c @ 3717:988485669631
[gaim-migrate @ 3850]
Warning fixes and WIN32 ifdef removals
committer: Tailor Script <tailor@pidgin.im>
author | Herman Bloggs <hermanator12002@yahoo.com> |
---|---|
date | Wed, 16 Oct 2002 19:57:03 +0000 |
parents | 9682c0e022c6 |
children | b359aab1c576 |
comparison
equal
deleted
inserted
replaced
3716:d7e83b4db191 | 3717:988485669631 |
---|---|
88 | 88 |
89 void gaim_probe_plugins() { | 89 void gaim_probe_plugins() { |
90 GDir *dir; | 90 GDir *dir; |
91 const gchar *file; | 91 const gchar *file; |
92 gchar *path; | 92 gchar *path; |
93 struct gaim_plugin_description *plugdes; | 93 /*struct gaim_plugin_description *plugdes;*/ |
94 struct gaim_plugin *plug; | 94 struct gaim_plugin *plug; |
95 char *probedirs[3]; | 95 char *probedirs[3]; |
96 int l; | 96 int l; |
97 #if GAIM_PLUGINS | 97 #if GAIM_PLUGINS |
98 char *(*gaim_plugin_init)(GModule *); | 98 char *(*gaim_plugin_init)(GModule *); |
110 for (l=0; probedirs[l]; l++) { | 110 for (l=0; probedirs[l]; l++) { |
111 dir = g_dir_open(probedirs[l], 0, NULL); | 111 dir = g_dir_open(probedirs[l], 0, NULL); |
112 if (dir) { | 112 if (dir) { |
113 while ((file = g_dir_read_name(dir))) { | 113 while ((file = g_dir_read_name(dir))) { |
114 #ifdef GAIM_PLUGINS | 114 #ifdef GAIM_PLUGINS |
115 if (is_so_file(file, | 115 if (is_so_file((char*)file, |
116 #ifndef _WIN32 | 116 #ifndef _WIN32 |
117 ".so" | 117 ".so" |
118 #else | 118 #else |
119 ".dll" | 119 ".dll" |
120 #endif | 120 #endif |
166 probed_plugins = g_list_append(probed_plugins, plug); | 166 probed_plugins = g_list_append(probed_plugins, plug); |
167 g_module_close(handle); | 167 g_module_close(handle); |
168 } | 168 } |
169 #endif | 169 #endif |
170 #ifdef USE_PERL | 170 #ifdef USE_PERL |
171 if (is_so_file(file, ".pl")) { | 171 if (is_so_file((char*)file, ".pl")) { |
172 path = g_build_filename(probedirs[l], file, NULL); | 172 path = g_build_filename(probedirs[l], file, NULL); |
173 plug = probe_perl(path); | 173 plug = probe_perl(path); |
174 if (plug) | 174 if (plug) |
175 probed_plugins = g_list_append(probed_plugins, plug); | 175 probed_plugins = g_list_append(probed_plugins, plug); |
176 g_free(path); | 176 g_free(path); |
183 } | 183 } |
184 | 184 |
185 #ifdef GAIM_PLUGINS | 185 #ifdef GAIM_PLUGINS |
186 struct gaim_plugin *load_plugin(const char *filename) | 186 struct gaim_plugin *load_plugin(const char *filename) |
187 { | 187 { |
188 struct gaim_plugin *plug; | 188 struct gaim_plugin *plug=NULL; |
189 struct gaim_plugin_description *desc; | 189 struct gaim_plugin_description *desc; |
190 struct gaim_plugin_description *(*gaim_plugin_desc)(); | 190 struct gaim_plugin_description *(*gaim_plugin_desc)(); |
191 char *(*cfunc)(); | 191 char *(*cfunc)(); |
192 GList *c = plugins; | 192 /*GList *c = plugins;*/ |
193 GList *p = probed_plugins; | 193 GList *p = probed_plugins; |
194 char *(*gaim_plugin_init)(GModule *); | 194 char *(*gaim_plugin_init)(GModule *); |
195 char *error, *retval; | 195 char *error=NULL; |
196 char *retval; | |
196 gboolean newplug = FALSE; | 197 gboolean newplug = FALSE; |
197 | 198 |
198 if (!g_module_supported()) | 199 if (!g_module_supported()) |
199 return NULL; | 200 return NULL; |
200 if (!filename || !strlen(filename)) | 201 if (!filename || !strlen(filename)) |
201 return NULL; | 202 return NULL; |
202 | 203 |
203 #ifdef USE_PERL | 204 #ifdef USE_PERL |
204 if (is_so_file(filename, ".pl")) { | 205 if (is_so_file((char*)filename, ".pl")) { |
205 return perl_load_file(filename); | 206 /* perl_load_file is returning an int.. this should be fixed */ |
207 return (struct gaim_plugin *)perl_load_file((char*)filename); | |
206 } | 208 } |
207 #endif | 209 #endif |
208 | 210 |
209 while (filename && p) { | 211 while (filename && p) { |
210 plug = (struct gaim_plugin *)p->data; | 212 plug = (struct gaim_plugin *)p->data; |