32 #include <libaudgui/init.h>
37 # define SHARED_SUFFIX G_MODULE_SUFFIX
45 #define AUD_API_DECLARE
50 #undef AUD_API_DECLARE
58 .misc_api = & misc_api,
59 .playlist_api = & playlist_api,
60 .plugins_api = & plugins_api,
69 static pthread_mutex_t
mutex = PTHREAD_MUTEX_INITIALIZER;
75 fprintf (stderr,
" *** ERROR: %s is not a valid Audacious plugin.\n", filename);
76 g_module_close (module);
82 fprintf (stderr,
" *** ERROR: %s is not compatible with this version of Audacious.\n", filename);
83 g_module_close (module);
95 fprintf (stderr,
" *** ERROR: %s failed to initialize.\n", filename);
96 g_module_close (module);
102 pthread_mutex_lock (&
mutex);
107 pthread_mutex_unlock (&
mutex);
114 Plugin * header = loaded->
header;
116 switch (header->type)
129 pthread_mutex_lock (&
mutex);
130 g_module_close (loaded->
module);
132 pthread_mutex_unlock (&
mutex);
142 AUDDBG (
"Loading plugin: %s.\n", filename);
144 if (!(module = g_module_open(filename, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL)))
146 printf(
"Failed to load plugin (%s): %s\n", filename, g_module_error());
151 if (g_module_symbol (module,
"get_plugin_info", (
void *) &
func))
153 Plugin * header =
func (& api_table);
154 g_return_if_fail (header !=
NULL);
159 printf(
"Invalid plugin (%s)\n", filename);
160 g_module_close(module);
168 if (!g_file_test(path, G_FILE_TEST_IS_REGULAR))
183 assert (g_module_supported ());
188 audgui_init (& api_table);
192 #ifndef DISABLE_USER_PLUGIN_DIR