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,
74 if (! g_module_symbol (module,
"get_plugin_info", & ptr))
82 fprintf (stderr,
" *** ERROR: %s is not a valid Audacious plugin.\n", filename);
83 g_module_close (module);
90 fprintf (stderr,
" *** ERROR: %s is not compatible with this version "
91 "of Audacious.\n", filename);
92 g_module_close (module);
103 fprintf (stderr,
" *** ERROR: %s failed to initialize.\n", filename);
104 g_module_close (module);
109 pthread_mutex_lock (&
mutex);
114 pthread_mutex_unlock (&
mutex);
121 Plugin * header = loaded->
header;
123 switch (header->type)
134 pthread_mutex_lock (&
mutex);
135 g_module_close (loaded->
module);
137 pthread_mutex_unlock (&
mutex);
148 if (stat (path, & st))
150 fprintf (stderr,
"Unable to stat %s: %s\n", path, strerror (errno));
154 if (S_ISREG (st.st_mode))
167 assert (g_module_supported ());
172 audgui_init (& api_table);
176 #ifndef DISABLE_USER_PLUGIN_DIR
static void plugin2_unload(LoadedModule *loaded)
void plugin_register(const char *path, int timestamp)
void plugin_registry_prune(void)
#define _AUD_PLUGIN_VERSION_MIN
Plugin * plugin_load(const char *filename)
bool_t dir_foreach(const char *path, DirForeachFunc func, void *user)
void plugin_system_cleanup(void)
#define PLUGIN_HAS_FUNC(p, func)
EXPORT bool_t str_has_suffix_nocase(const char *str, const char *suffix)
static GHashTable * table
void plugin_registry_load(void)
void plugin_registry_save(void)
static GList * loaded_modules
struct DRCTAPI * drct_api
void plugin_system_init(void)
const char * get_path(int id)
static pthread_mutex_t mutex
static bool_t scan_plugin_func(const char *path, const char *basename, void *data)
static void scan_plugins(const char *path)
static const char * plugin_dir_list[]
#define _AUD_PLUGIN_MAGIC
#define _AUD_PLUGIN_VERSION