diff options
Diffstat (limited to 'src/main/extractor_plugins.c')
-rw-r--r-- | src/main/extractor_plugins.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/main/extractor_plugins.c b/src/main/extractor_plugins.c index 290d511..444c051 100644 --- a/src/main/extractor_plugins.c +++ b/src/main/extractor_plugins.c | |||
@@ -120,6 +120,14 @@ get_symbol_with_prefix (void *lib_handle, | |||
120 | int | 120 | int |
121 | EXTRACTOR_plugin_load_ (struct EXTRACTOR_PluginList *plugin) | 121 | EXTRACTOR_plugin_load_ (struct EXTRACTOR_PluginList *plugin) |
122 | { | 122 | { |
123 | |||
124 | LOG ("In EXTRACTOR_plugin_load_"); | ||
125 | |||
126 | FILE *f; | ||
127 | f = fopen("debug.txt", "a+"); | ||
128 | fprintf(f, "EXTRACTOR_plugin_load_\n"); | ||
129 | fclose(f); | ||
130 | |||
123 | #if WINDOWS | 131 | #if WINDOWS |
124 | wchar_t wlibname[4097]; | 132 | wchar_t wlibname[4097]; |
125 | char llibname[4097]; | 133 | char llibname[4097]; |
@@ -137,6 +145,11 @@ EXTRACTOR_plugin_load_ (struct EXTRACTOR_PluginList *plugin) | |||
137 | plugin->flags = EXTRACTOR_OPTION_DISABLED; | 145 | plugin->flags = EXTRACTOR_OPTION_DISABLED; |
138 | return -1; | 146 | return -1; |
139 | } | 147 | } |
148 | |||
149 | LOG ("Loading plugin `%s' \n", plugin->short_libname); | ||
150 | lt_dlclose (plugin->libraryHandle); | ||
151 | |||
152 | |||
140 | lt_dladvise_init (&advise); | 153 | lt_dladvise_init (&advise); |
141 | lt_dladvise_ext (&advise); | 154 | lt_dladvise_ext (&advise); |
142 | lt_dladvise_local (&advise); | 155 | lt_dladvise_local (&advise); |
@@ -151,6 +164,11 @@ EXTRACTOR_plugin_load_ (struct EXTRACTOR_PluginList *plugin) | |||
151 | LOG ("Loading `%s' plugin failed: %s\n", | 164 | LOG ("Loading `%s' plugin failed: %s\n", |
152 | plugin->short_libname, | 165 | plugin->short_libname, |
153 | "can't convert plugin name to local encoding"); | 166 | "can't convert plugin name to local encoding"); |
167 | FILE *f; | ||
168 | f = fopen("debug.txt", "a+"); | ||
169 | fprintf(f, "Loading `%s' plugin failed!\n", | ||
170 | plugin->short_libname); | ||
171 | fclose(f); | ||
154 | free (plugin->libname); | 172 | free (plugin->libname); |
155 | plugin->libname = NULL; | 173 | plugin->libname = NULL; |
156 | plugin->flags = EXTRACTOR_OPTION_DISABLED; | 174 | plugin->flags = EXTRACTOR_OPTION_DISABLED; |
@@ -189,6 +207,15 @@ EXTRACTOR_plugin_load_ (struct EXTRACTOR_PluginList *plugin) | |||
189 | plugin->flags = EXTRACTOR_OPTION_DISABLED; | 207 | plugin->flags = EXTRACTOR_OPTION_DISABLED; |
190 | return -1; | 208 | return -1; |
191 | } | 209 | } |
210 | |||
211 | LOG ("Loaded plugin `%s' \n", plugin->short_libname); | ||
212 | |||
213 | |||
214 | f = fopen("debug.txt", "a+"); | ||
215 | fprintf(f, "Loaded plugin `%s' \n", plugin->short_libname); | ||
216 | fclose(f); | ||
217 | |||
218 | |||
192 | return 0; | 219 | return 0; |
193 | } | 220 | } |
194 | 221 | ||
@@ -211,6 +238,12 @@ EXTRACTOR_plugin_add (struct EXTRACTOR_PluginList *prev, | |||
211 | struct EXTRACTOR_PluginList *plugin; | 238 | struct EXTRACTOR_PluginList *plugin; |
212 | struct EXTRACTOR_PluginList *pos; | 239 | struct EXTRACTOR_PluginList *pos; |
213 | char *libname; | 240 | char *libname; |
241 | |||
242 | FILE *f; | ||
243 | f = fopen("debug.txt", "a+"); | ||
244 | fprintf(f, "EXTRACTOR_plugin_add\n"); | ||
245 | fclose(f); | ||
246 | |||
214 | 247 | ||
215 | for (pos = prev; NULL != pos; pos = pos->next) | 248 | for (pos = prev; NULL != pos; pos = pos->next) |
216 | if (0 == strcmp (pos->short_libname, library)) | 249 | if (0 == strcmp (pos->short_libname, library)) |
@@ -344,6 +377,9 @@ EXTRACTOR_plugin_remove (struct EXTRACTOR_PluginList *prev, | |||
344 | struct EXTRACTOR_PluginList *pos; | 377 | struct EXTRACTOR_PluginList *pos; |
345 | struct EXTRACTOR_PluginList *first; | 378 | struct EXTRACTOR_PluginList *first; |
346 | 379 | ||
380 | |||
381 | |||
382 | |||
347 | pos = prev; | 383 | pos = prev; |
348 | first = prev; | 384 | first = prev; |
349 | while ( (NULL != pos) && | 385 | while ( (NULL != pos) && |
@@ -358,6 +394,13 @@ EXTRACTOR_plugin_remove (struct EXTRACTOR_PluginList *prev, | |||
358 | library); | 394 | library); |
359 | return first; | 395 | return first; |
360 | } | 396 | } |
397 | |||
398 | FILE *f; | ||
399 | f = fopen("debug.txt", "a+"); | ||
400 | fprintf(f, "Closoing %s\n",pos->short_libname); | ||
401 | fclose(f); | ||
402 | |||
403 | |||
361 | /* found, close library */ | 404 | /* found, close library */ |
362 | if (first == pos) | 405 | if (first == pos) |
363 | first = pos->next; | 406 | first = pos->next; |