29 #include <libaudgui/init.h>
35 #define AUD_API_DECLARE
40 #undef AUD_API_DECLARE
48 .misc_api = & misc_api,
49 .playlist_api = & playlist_api,
50 .plugins_api = & plugins_api,
59 static pthread_mutex_t
mutex = PTHREAD_MUTEX_INITIALIZER;
63 AUDDBG (
"Loading plugin: %s.\n", filename);
65 GModule * module = g_module_open (filename, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
68 fprintf (stderr,
" *** ERROR: %s could not be loaded: %s\n", filename,
76 if (! g_module_symbol (module,
"get_plugin_info", (
void *) &
func) ||
79 fprintf (stderr,
" *** ERROR: %s is not a valid Audacious plugin.\n", filename);
80 g_module_close (module);
87 fprintf (stderr,
" *** ERROR: %s is not compatible with this version "
88 "of Audacious.\n", filename);
89 g_module_close (module);
100 fprintf (stderr,
" *** ERROR: %s failed to initialize.\n", filename);
101 g_module_close (module);
106 pthread_mutex_lock (&
mutex);
111 pthread_mutex_unlock (&
mutex);
118 Plugin * header = loaded->
header;
120 switch (header->type)
131 pthread_mutex_lock (&
mutex);
132 g_module_close (loaded->
module);
134 pthread_mutex_unlock (&
mutex);
145 if (stat (path, & st))
147 fprintf (stderr,
"Unable to stat %s: %s\n", path, strerror (errno));
151 if (S_ISREG (st.st_mode))
164 assert (g_module_supported ());
169 audgui_init (& api_table);
173 #ifndef DISABLE_USER_PLUGIN_DIR