summaryrefslogtreecommitdiff
path: root/plugins.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-10-05 17:46:33 +0200
committerGravatar waker <wakeroid@gmail.com>2012-10-05 17:46:33 +0200
commitce2923c8f0cac7a563d1ecf22085ac62281c74d7 (patch)
tree20ce1a2fd0cebc36231882b011e34230778a1db9 /plugins.c
parent527ba48d8209a8e854c791d571106a5daf2fdd29 (diff)
parent708c8ba9f7aefe9f795c9c4eb30ab128f09c8b3d (diff)
Merge branch 'master' into devel
Conflicts: README configure.ac deadbeef.h plugins.c plugins/gtkui/Makefile.am plugins/gtkui/ddbcellrenderertextmultiline.c plugins/gtkui/ddblistview.c plugins/gtkui/deadbeef.glade plugins/gtkui/gtkui.c plugins/gtkui/interface.c plugins/gtkui/plcommon.c plugins/shellexec/shellexec.c plugins/supereq/Makefile.am
Diffstat (limited to 'plugins.c')
-rw-r--r--plugins.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/plugins.c b/plugins.c
index e15f640c..1a0216fa 100644
--- a/plugins.c
+++ b/plugins.c
@@ -21,8 +21,8 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
-//#include <alloca.h>
#include <string.h>
+#include <sys/stat.h>
#ifndef __linux__
#define _POSIX_C_SOURCE 1
#endif
@@ -50,10 +50,6 @@
#define trace(...) { fprintf(stderr, __VA_ARGS__); }
//#define trace(fmt,...)
-#ifndef PATH_MAX
-#define PATH_MAX 1024 /* max # of characters in a path name */
-#endif
-
//#define DISABLE_VERSIONCHECK 1
// deadbeef api
@@ -331,6 +327,12 @@ static DB_functions_t deadbeef_api = {
.pl_find_meta_raw = (const char *(*) (DB_playItem_t *it, const char *key))pl_find_meta_raw,
// ******* new 1.3 APIs ********
.streamer_dsp_chain_save = streamer_dsp_chain_save,
+ // ******* new 1.4 APIs ********
+ .pl_get_meta = (int (*) (DB_playItem_t *it, const char *key, char *val, int size))pl_get_meta,
+ .pl_get_meta_raw = (int (*) (DB_playItem_t *it, const char *key, char *val, int size))pl_get_meta_raw,
+ .plt_get_meta = (int (*) (ddb_playlist_t *handle, const char *key, char *val, int size))plt_get_meta,
+ .pl_meta_exists = (int (*) (DB_playItem_t *it, const char *key))pl_meta_exists,
+ // FIXME ******* devel branch only *******
.audio_get_waveform_data = audio_get_waveform_data,
};
@@ -568,6 +570,13 @@ static int
load_plugin (const char *plugdir, char *d_name, int l) {
char fullname[PATH_MAX];
snprintf (fullname, PATH_MAX, "%s/%s", plugdir, d_name);
+
+ // check if the file exists, to avoid printing bogus errors
+ struct stat s;
+ if (0 != stat (fullname, &s)) {
+ return -1;
+ }
+
trace ("loading plugin %s/%s\n", plugdir, d_name);
void *handle = dlopen (fullname, RTLD_NOW);
if (!handle) {