1 /*****************************************************************************
2 * modules.c : Built-in and plugin modules management functions
3 *****************************************************************************
4 * Copyright (C) 2001 VideoLAN
5 * $Id: modules.c,v 1.45 2001/12/10 04:53:11 sam Exp $
7 * Authors: Samuel Hocevar <sam@zoy.org>
8 * Ethan C. Baldridge <BaldridgeE@cadmus.com>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
23 *****************************************************************************/
26 /* Some faulty libcs have a broken struct dirent when _FILE_OFFSET_BITS
27 * is set to 64. Don't try to be cleverer. */
28 #ifdef _FILE_OFFSET_BITS
29 #undef _FILE_OFFSET_BITS
32 #include <stdlib.h> /* free(), strtol() */
33 #include <stdio.h> /* sprintf() */
34 #include <string.h> /* strdup() */
36 #if !defined( _MSC_VER )
40 #if defined(HAVE_DLFCN_H) /* Linux, BSD, Hurd */
41 # include <dlfcn.h> /* dlopen(), dlsym(), dlclose() */
42 # define HAVE_DYNAMIC_PLUGINS
43 #elif defined(HAVE_IMAGE_H) /* BeOS */
45 # define HAVE_DYNAMIC_PLUGINS
46 #elif defined(WIN32) && defined( __MINGW32__ )
47 # define HAVE_DYNAMIC_PLUGINS
49 # undef HAVE_DYNAMIC_PLUGINS
53 # include "beos_specific.h"
57 # include "darwin_specific.h"
68 #include "interface.h"
69 #include "intf_playlist.h"
71 #include "stream_control.h"
72 #include "input_ext-intf.h"
73 #include "input_ext-dec.h"
74 #include "input_ext-plugins.h"
77 #include "video_output.h"
79 #include "audio_output.h"
83 #ifdef HAVE_DYNAMIC_PLUGINS
84 # include "modules_core.h"
86 #include "modules_builtin.h"
87 #include "modules_export.h"
89 /*****************************************************************************
91 *****************************************************************************/
92 #ifdef HAVE_DYNAMIC_PLUGINS
93 static int AllocatePluginModule ( char * );
95 #ifdef ALLOCATE_ALL_BUILTINS
96 static int AllocateBuiltinModule( int ( * ) ( module_t * ),
97 int ( * ) ( module_t * ),
98 int ( * ) ( module_t * ) );
100 static int DeleteModule ( module_t * );
101 static int LockModule ( module_t * );
102 static int UnlockModule ( module_t * );
103 #ifdef HAVE_DYNAMIC_PLUGINS
104 static int HideModule ( module_t * );
105 static int CallSymbol ( module_t *, char * );
108 static module_symbols_t symbols;
110 /*****************************************************************************
111 * module_InitBank: create the module bank.
112 *****************************************************************************
113 * This function creates a module bank structure and fills it with the
114 * built-in modules, as well as all the plugin modules it can find.
115 *****************************************************************************/
116 void module_InitBank( void )
118 #ifdef HAVE_DYNAMIC_PLUGINS
119 static char * path[] = { ".", "plugins", PLUGIN_PATH, NULL, NULL };
121 char ** ppsz_path = path;
124 #if defined( SYS_BEOS ) || defined( SYS_DARWIN )
125 char * psz_vlcpath = system_GetProgramPath();
126 int i_vlclen = strlen( psz_vlcpath );
127 boolean_t b_notinroot;
130 struct dirent * file;
131 #endif /* HAVE_DYNAMIC_PLUGINS */
133 p_module_bank->first = NULL;
134 vlc_mutex_init( &p_module_bank->lock );
137 * Store the symbols to be exported
139 STORE_SYMBOLS( &symbols );
141 STORE_TRACE_SYMBOLS( &symbols );
145 * Check all the built-in modules
147 #ifdef ALLOCATE_ALL_BUILTINS
148 intf_WarnMsg( 2, "module: checking built-in modules" );
150 ALLOCATE_ALL_BUILTINS();
154 * Check all the plugin modules we can find
156 #ifdef HAVE_DYNAMIC_PLUGINS
157 intf_WarnMsg( 2, "module: checking plugin modules" );
159 for( ; *ppsz_path != NULL ; ppsz_path++ )
161 /* Store strlen(*ppsz_path) for later use. */
162 int i_dirlen = strlen( *ppsz_path );
164 #if defined( SYS_BEOS ) || defined( SYS_DARWIN )
166 /* Under BeOS, we need to add beos_GetProgramPath() to access
167 * files under the current directory */
168 if( ( i_dirlen > 1 ) && strncmp( *ppsz_path, "/", 1 ) )
170 i_dirlen += i_vlclen + 2;
173 psz_fullpath = malloc( i_dirlen );
174 if( psz_fullpath == NULL )
178 sprintf( psz_fullpath, "%s/%s", psz_vlcpath, *ppsz_path );
183 psz_fullpath = *ppsz_path;
186 intf_WarnMsgImm( 1, "module: browsing `%s'", psz_fullpath );
188 if( (dir = opendir( psz_fullpath )) )
190 /* Parse the directory and try to load all files it contains. */
191 while( (file = readdir( dir )) )
193 int i_filelen = strlen( file->d_name );
195 /* We only load files ending with ".so" */
197 && !strncmp( file->d_name + i_filelen - 3, ".so", 3 ) )
199 psz_file = malloc( i_dirlen + i_filelen + 2 );
200 if( psz_file == NULL )
204 sprintf( psz_file, "%s/%s", psz_fullpath, file->d_name );
206 /* We created a nice filename -- now we just try to load
207 * it as a plugin module. */
208 AllocatePluginModule( psz_file );
210 /* We don't care if the allocation succeeded */
215 /* Close the directory if successfully opened */
219 #if defined( SYS_BEOS ) || defined( SYS_DARWIN )
222 free( psz_fullpath );
226 #endif /* HAVE_DYNAMIC_PLUGINS */
228 intf_WarnMsg( 3, "module: module bank initialized" );
233 /*****************************************************************************
234 * module_EndBank: empty the module bank.
235 *****************************************************************************
236 * This function unloads all unused plugin modules and empties the module
237 * bank in case of success.
238 *****************************************************************************/
239 void module_EndBank( void )
243 while( p_module_bank->first != NULL )
245 if( DeleteModule( p_module_bank->first ) )
247 /* Module deletion failed */
248 intf_ErrMsg( "module error: `%s' can't be removed. trying harder.",
249 p_module_bank->first->psz_name );
251 /* We just free the module by hand. Niahahahahaha. */
252 p_next = p_module_bank->first->next;
253 free(p_module_bank->first);
254 p_module_bank->first = p_next;
258 /* Destroy the lock */
259 vlc_mutex_destroy( &p_module_bank->lock );
264 /*****************************************************************************
265 * module_ResetBank: reset the module bank.
266 *****************************************************************************
267 * This function resets the module bank by unloading all unused plugin
269 *****************************************************************************/
270 void module_ResetBank( void )
272 intf_ErrMsg( "FIXME: module_ResetBank unimplemented" );
276 /*****************************************************************************
277 * module_ManageBank: manage the module bank.
278 *****************************************************************************
279 * This function parses the module bank and hides modules that have been
280 * unused for a while.
281 *****************************************************************************/
282 void module_ManageBank( void )
284 #ifdef HAVE_DYNAMIC_PLUGINS
287 /* We take the global lock */
288 vlc_mutex_lock( &p_module_bank->lock );
290 /* Parse the module list to see if any modules need to be unloaded */
291 for( p_module = p_module_bank->first ;
293 p_module = p_module->next )
295 /* If the module is unused and if it is a plugin module... */
296 if( p_module->i_usage == 0 && !p_module->b_builtin )
298 if( p_module->i_unused_delay < MODULE_HIDE_DELAY )
300 p_module->i_unused_delay++;
304 intf_WarnMsg( 3, "module: hiding unused plugin module `%s'",
305 p_module->psz_name );
306 HideModule( p_module );
308 /* Break here, so that we only hide one module at a time */
314 /* We release the global lock */
315 vlc_mutex_unlock( &p_module_bank->lock );
316 #endif /* HAVE_DYNAMIC_PLUGINS */
321 /*****************************************************************************
322 * module_Need: return the best module function, given a capability list.
323 *****************************************************************************
324 * This function returns the module that best fits the asked capabilities.
325 *****************************************************************************/
326 module_t * module_Need( int i_capabilities, void *p_data )
329 module_t * p_bestmodule = NULL;
330 int i_score, i_totalscore, i_bestscore = 0;
333 /* We take the global lock */
334 vlc_mutex_lock( &p_module_bank->lock );
336 /* Parse the module list for capabilities and probe each of them */
337 for( p_module = p_module_bank->first ;
339 p_module = p_module->next )
341 /* Test that this module can do everything we need */
342 if( ( p_module->i_capabilities & i_capabilities ) == i_capabilities )
346 LockModule( p_module );
348 /* Parse all the requested capabilities and test them */
349 for( i_index = 0 ; (1 << i_index) <= i_capabilities ; i_index++ )
351 if( ( (1 << i_index) & i_capabilities ) )
353 i_score = ( (function_list_t *)p_module->p_functions)
354 [i_index].pf_probe( p_data );
358 i_totalscore += i_score;
366 intf_WarnMsg( 3, "module: %s has score %d",
367 p_module->psz_name, i_totalscore );
369 /* If the high score was broken, we have a new champion */
370 if( i_totalscore > i_bestscore )
372 /* Keep the current module locked, but release the previous */
373 if( p_bestmodule != NULL )
375 UnlockModule( p_bestmodule );
378 /* This is the new best module */
379 i_bestscore = i_totalscore;
380 p_bestmodule = p_module;
384 /* This module wasn't interesting, unlock it and forget it */
385 UnlockModule( p_module );
390 /* We can release the global lock, module refcount was incremented */
391 vlc_mutex_unlock( &p_module_bank->lock );
393 if( p_bestmodule != NULL )
395 intf_WarnMsg( 1, "module: locking module `%s'",
396 p_bestmodule->psz_name );
399 /* Don't forget that the module is still locked if bestmodule != NULL */
400 return( p_bestmodule );
403 /*****************************************************************************
404 * module_Unneed: decrease the usage count of a module.
405 *****************************************************************************
406 * This function must be called by the thread that called module_Need, to
407 * decrease the reference count and allow for hiding of modules.
408 *****************************************************************************/
409 void module_Unneed( module_t * p_module )
411 /* We take the global lock */
412 vlc_mutex_lock( &p_module_bank->lock );
414 /* Just unlock the module - we can't do anything if it fails,
415 * so there is no need to check the return value. */
416 UnlockModule( p_module );
418 intf_WarnMsg( 1, "module: unlocking module `%s'", p_module->psz_name );
420 /* We release the global lock */
421 vlc_mutex_unlock( &p_module_bank->lock );
426 /*****************************************************************************
427 * Following functions are local.
428 *****************************************************************************/
430 #ifdef HAVE_DYNAMIC_PLUGINS
431 /*****************************************************************************
432 * AllocatePluginModule: load a module into memory and initialize it.
433 *****************************************************************************
434 * This function loads a dynamically loadable module and allocates a structure
435 * for its information data. The module can then be handled by module_Need,
436 * module_Unneed and HideModule. It can be removed by DeleteModule.
437 *****************************************************************************/
438 static int AllocatePluginModule( char * psz_filename )
440 module_t * p_module, * p_othermodule;
441 module_handle_t handle;
443 /* Try to dynamically load the module. */
444 if( module_load( psz_filename, &handle ) )
446 /* The plugin module couldn't be opened */
447 intf_WarnMsgImm( 1, "module warning: cannot open %s (%s)",
448 psz_filename, module_error() );
452 /* Now that we have successfully loaded the module, we can
453 * allocate a structure for it */
454 p_module = malloc( sizeof( module_t ) );
455 if( p_module == NULL )
457 intf_ErrMsg( "module error: can't allocate p_module" );
458 module_unload( handle );
462 /* We need to fill these since they may be needed by CallSymbol() */
463 p_module->is.plugin.psz_filename = psz_filename;
464 p_module->is.plugin.handle = handle;
465 p_module->p_symbols = &symbols;
467 /* Initialize the module : fill p_module->psz_name, etc. */
468 if( CallSymbol( p_module, "InitModule" ) != 0 )
470 /* We couldn't call InitModule() */
472 module_unload( handle );
476 /* Check that version numbers match */
477 if( strcmp( VLC_VERSION, p_module->psz_version ) )
480 module_unload( handle );
484 /* Check that we don't already have a module with this name */
485 for( p_othermodule = p_module_bank->first ;
486 p_othermodule != NULL ;
487 p_othermodule = p_othermodule->next )
489 if( !strcmp( p_othermodule->psz_name, p_module->psz_name ) )
492 module_unload( handle );
497 /* Activate the module : fill the capability structure, etc. */
498 if( CallSymbol( p_module, "ActivateModule" ) != 0 )
500 /* We couldn't call ActivateModule() */
502 module_unload( handle );
506 /* We strdup() these entries so that they are still valid when the
507 * module is unloaded. */
508 p_module->is.plugin.psz_filename =
509 strdup( p_module->is.plugin.psz_filename );
510 p_module->psz_name = strdup( p_module->psz_name );
511 p_module->psz_longname = strdup( p_module->psz_longname );
512 p_module->psz_version = strdup( p_module->psz_version );
513 if( p_module->is.plugin.psz_filename == NULL
514 || p_module->psz_name == NULL
515 || p_module->psz_longname == NULL
516 || p_module->psz_version == NULL )
518 intf_ErrMsg( "module error: can't duplicate strings" );
520 if( p_module->is.plugin.psz_filename != NULL )
522 free( p_module->is.plugin.psz_filename );
525 if( p_module->psz_name != NULL )
527 free( p_module->psz_name );
530 if( p_module->psz_longname != NULL )
532 free( p_module->psz_longname );
535 if( p_module->psz_version != NULL )
537 free( p_module->psz_version );
541 module_unload( handle );
545 /* Everything worked fine ! The module is ready to be added to the list. */
546 p_module->i_usage = 0;
547 p_module->i_unused_delay = 0;
549 p_module->b_builtin = 0;
551 /* Link module into the linked list */
552 if( p_module_bank->first != NULL )
554 p_module_bank->first->prev = p_module;
556 p_module->next = p_module_bank->first;
557 p_module->prev = NULL;
558 p_module_bank->first = p_module;
560 /* Immediate message so that a slow module doesn't make the user wait */
561 intf_WarnMsgImm( 2, "module: new plugin module `%s', %s",
562 p_module->psz_name, p_module->psz_longname );
566 #endif /* HAVE_DYNAMIC_PLUGINS */
568 #ifdef ALLOCATE_ALL_BUILTINS
569 /*****************************************************************************
570 * AllocateBuiltinModule: initialize a built-in module.
571 *****************************************************************************
572 * This function registers a built-in module and allocates a structure
573 * for its information data. The module can then be handled by module_Need,
574 * module_Unneed and HideModule. It can be removed by DeleteModule.
575 *****************************************************************************/
576 static int AllocateBuiltinModule( int ( *pf_init ) ( module_t * ),
577 int ( *pf_activate ) ( module_t * ),
578 int ( *pf_deactivate ) ( module_t * ) )
580 module_t * p_module, * p_othermodule;
582 /* Now that we have successfully loaded the module, we can
583 * allocate a structure for it */
584 p_module = malloc( sizeof( module_t ) );
585 if( p_module == NULL )
587 intf_ErrMsg( "module error: can't allocate p_module" );
591 /* Initialize the module : fill p_module->psz_name, etc. */
592 if( pf_init( p_module ) != 0 )
594 /* With a well-written module we shouldn't have to print an
595 * additional error message here, but just make sure. */
596 intf_ErrMsg( "module error: failed calling init in builtin module" );
601 /* Check that version numbers match */
602 if( strcmp( VLC_VERSION, p_module->psz_version ) )
608 /* Check that we don't already have a module with this name */
609 for( p_othermodule = p_module_bank->first ;
610 p_othermodule != NULL ;
611 p_othermodule = p_othermodule->next )
613 if( !strcmp( p_othermodule->psz_name, p_module->psz_name ) )
620 if( pf_activate( p_module ) != 0 )
622 /* With a well-written module we shouldn't have to print an
623 * additional error message here, but just make sure. */
624 intf_ErrMsg( "module error: failed calling activate "
625 "in builtin module" );
630 /* We strdup() these entries so that they are still valid when the
631 * module is unloaded. */
632 p_module->psz_name = strdup( p_module->psz_name );
633 p_module->psz_longname = strdup( p_module->psz_longname );
634 p_module->psz_version = strdup( p_module->psz_version );
635 if( p_module->psz_name == NULL
636 || p_module->psz_longname == NULL
637 || p_module->psz_version == NULL )
639 intf_ErrMsg( "module error: can't duplicate strings" );
641 if( p_module->psz_name != NULL )
643 free( p_module->psz_name );
646 if( p_module->psz_longname != NULL )
648 free( p_module->psz_longname );
651 if( p_module->psz_version != NULL )
653 free( p_module->psz_version );
660 /* Everything worked fine ! The module is ready to be added to the list. */
661 p_module->i_usage = 0;
662 p_module->i_unused_delay = 0;
664 p_module->b_builtin = 1;
665 p_module->is.builtin.pf_deactivate = pf_deactivate;
667 /* Link module into the linked list */
668 if( p_module_bank->first != NULL )
670 p_module_bank->first->prev = p_module;
672 p_module->next = p_module_bank->first;
673 p_module->prev = NULL;
674 p_module_bank->first = p_module;
676 /* Immediate message so that a slow module doesn't make the user wait */
677 intf_WarnMsgImm( 2, "module: new builtin module `%s', %s",
678 p_module->psz_name, p_module->psz_longname );
682 #endif /* ALLOCATE_ALL_BUILTINS */
684 /*****************************************************************************
685 * DeleteModule: delete a module and its structure.
686 *****************************************************************************
687 * This function can only be called if i_usage <= 0.
688 *****************************************************************************/
689 static int DeleteModule( module_t * p_module )
691 /* If the module is not in use but is still in memory, we first have
692 * to hide it and remove it from memory before we can free the
694 if( p_module->b_builtin )
696 if( p_module->i_usage != 0 )
698 intf_ErrMsg( "module error: trying to free builtin module `%s' with"
699 " usage %i", p_module->psz_name, p_module->i_usage );
704 /* We deactivate the module now. */
705 p_module->is.builtin.pf_deactivate( p_module );
708 #ifdef HAVE_DYNAMIC_PLUGINS
711 if( p_module->i_usage >= 1 )
713 intf_ErrMsg( "module error: trying to free module `%s' which is"
714 " still in use", p_module->psz_name );
718 /* Two possibilities here: i_usage == -1 and the module is already
719 * unloaded, we can continue, or i_usage == 0, and we have to hide
720 * the module before going on. */
721 if( p_module->i_usage == 0 )
723 if( HideModule( p_module ) != 0 )
731 /* Unlink the module from the linked list. */
732 if( p_module == p_module_bank->first )
734 p_module_bank->first = p_module->next;
737 if( p_module->prev != NULL )
739 p_module->prev->next = p_module->next;
742 if( p_module->next != NULL )
744 p_module->next->prev = p_module->prev;
747 /* We free the structures that we strdup()ed in Allocate*Module(). */
748 #ifdef HAVE_DYNAMIC_PLUGINS
749 if( !p_module->b_builtin )
751 free( p_module->is.plugin.psz_filename );
754 free( p_module->psz_name );
755 free( p_module->psz_longname );
756 free( p_module->psz_version );
763 /*****************************************************************************
764 * LockModule: increase the usage count of a module and load it if needed.
765 *****************************************************************************
766 * This function has to be called before a thread starts using a module. If
767 * the module is already loaded, we just increase its usage count. If it isn't
768 * loaded, we have to dynamically open it and initialize it.
769 * If you successfully call LockModule() at any moment, be careful to call
770 * UnlockModule() when you don't need it anymore.
771 *****************************************************************************/
772 static int LockModule( module_t * p_module )
774 if( p_module->i_usage >= 0 )
776 /* This module is already loaded and activated, we can return */
781 if( p_module->b_builtin )
783 /* A built-in module should always have a refcount >= 0 ! */
784 intf_ErrMsg( "module error: built-in module `%s' has refcount %i",
785 p_module->psz_name, p_module->i_usage );
789 #ifdef HAVE_DYNAMIC_PLUGINS
790 if( p_module->i_usage != -1 )
792 /* This shouldn't happen. Ever. We have serious problems here. */
793 intf_ErrMsg( "module error: plugin module `%s' has refcount %i",
794 p_module->psz_name, p_module->i_usage );
798 /* i_usage == -1, which means that the module isn't in memory */
799 if( module_load( p_module->is.plugin.psz_filename,
800 &p_module->is.plugin.handle ) )
802 /* The plugin module couldn't be opened */
803 intf_ErrMsg( "module error: cannot open %s (%s)",
804 p_module->is.plugin.psz_filename, module_error() );
808 /* FIXME: what to do if the guy modified the plugin while it was
809 * unloaded ? It makes XMMS crash nastily, perhaps we should try
810 * to be a bit more clever here. */
812 /* Activate the module : fill the capability structure, etc. */
813 if( CallSymbol( p_module, "ActivateModule" ) != 0 )
815 /* We couldn't call ActivateModule() -- looks nasty, but
816 * we can't do much about it. Just try to unload module. */
817 module_unload( p_module->is.plugin.handle );
818 p_module->i_usage = -1;
822 /* Everything worked fine ! The module is ready to be used */
823 p_module->i_usage = 1;
824 #endif /* HAVE_DYNAMIC_PLUGINS */
829 /*****************************************************************************
830 * UnlockModule: decrease the usage count of a module.
831 *****************************************************************************
832 * We decrease the usage count of a module so that we know when a module
833 * becomes unused and can be hidden.
834 *****************************************************************************/
835 static int UnlockModule( module_t * p_module )
837 if( p_module->i_usage <= 0 )
839 /* This shouldn't happen. Ever. We have serious problems here. */
840 intf_ErrMsg( "module error: trying to call module_Unneed() on `%s'"
841 " which isn't even in use", p_module->psz_name );
845 /* This module is still in use, we can return */
847 p_module->i_unused_delay = 0;
852 #ifdef HAVE_DYNAMIC_PLUGINS
853 /*****************************************************************************
854 * HideModule: remove a module from memory but keep its structure.
855 *****************************************************************************
856 * This function can only be called if i_usage == 0. It will make a call
857 * to the module's inner DeactivateModule() symbol, and then unload it
858 * from memory. A call to module_Need() will automagically load it again.
859 *****************************************************************************/
860 static int HideModule( module_t * p_module )
862 if( p_module->b_builtin )
864 /* A built-in module should never be hidden. */
865 intf_ErrMsg( "module error: trying to hide built-in module `%s'",
866 p_module->psz_name );
870 if( p_module->i_usage >= 1 )
872 intf_ErrMsg( "module error: trying to hide module `%s' which is still"
873 " in use", p_module->psz_name );
877 if( p_module->i_usage <= -1 )
879 intf_ErrMsg( "module error: trying to hide module `%s' which is already"
880 " hidden", p_module->psz_name );
884 /* Deactivate the module : free the capability structure, etc. */
885 if( CallSymbol( p_module, "DeactivateModule" ) != 0 )
887 /* We couldn't call DeactivateModule() -- looks nasty, but
888 * we can't do much about it. Just try to unload module anyway. */
889 module_unload( p_module->is.plugin.handle );
890 p_module->i_usage = -1;
894 /* Everything worked fine, we can safely unload the module. */
895 module_unload( p_module->is.plugin.handle );
896 p_module->i_usage = -1;
901 /*****************************************************************************
902 * CallSymbol: calls a module symbol.
903 *****************************************************************************
904 * This function calls a symbol given its name and a module structure. The
905 * symbol MUST refer to a function returning int and taking a module_t* as
907 *****************************************************************************/
908 static int CallSymbol( module_t * p_module, char * psz_name )
910 int (* pf_symbol) ( module_t * p_module );
912 /* Try to resolve the symbol */
913 pf_symbol = module_getsymbol( p_module->is.plugin.handle, psz_name );
915 if( pf_symbol == NULL )
917 /* We couldn't load the symbol */
918 intf_WarnMsg( 1, "module warning: "
919 "cannot find symbol %s in module %s (%s)",
920 psz_name, p_module->is.plugin.psz_filename,
925 /* We can now try to call the symbol */
926 if( pf_symbol( p_module ) != 0 )
928 /* With a well-written module we shouldn't have to print an
929 * additional error message here, but just make sure. */
930 intf_ErrMsg( "module error: failed calling symbol %s in module %s",
931 psz_name, p_module->is.plugin.psz_filename );
935 /* Everything worked fine, we can return */
938 #endif /* HAVE_DYNAMIC_PLUGINS */