From ce9af0fefb2cd0dd5fe5743dcca12f17eedd1ce5 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Mon, 28 Apr 2008 14:50:53 +0100 Subject: Add xine_get_pluginroot() for win32. Completely untested. --- src/xine-utils/utils.c | 14 ++++++++++++++ src/xine-utils/xineutils.h | 1 + 2 files changed, 15 insertions(+) (limited to 'src') diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c index cc3ffdc2c..768b41da4 100644 --- a/src/xine-utils/utils.c +++ b/src/xine-utils/utils.c @@ -371,6 +371,20 @@ static void xine_get_rootdir(char *rootdir, size_t maxlen) { if ((s = strrchr(rootdir, XINE_DIRECTORY_SEPARATOR_CHAR))) *s = '\0'; } +const char *xine_get_pluginroot(void) { + static char pluginroot[1024] = {0, }; + + if (!pluginroot[0]) { + char *sep, *sep2; + strcpy (pluginroot, xine_get_plugindir ()); + sep = strrchr (pluginroot, '/'); + sep2 = strrchr (pluginroot, '\\'); + *(sep < sep2 ? sep : sep2) = 0; + } + + return pluginroot; +} + const char *xine_get_plugindir(void) { static char plugindir[1024] = {0, }; diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h index 120cb3578..aeee9e7b3 100644 --- a/src/xine-utils/xineutils.h +++ b/src/xine-utils/xineutils.h @@ -643,6 +643,7 @@ const char *xine_get_homedir(void) XINE_PROTECTED; /* * Get other xine directories. */ +const char *xine_get_pluginroot(void) XINE_PROTECTED; const char *xine_get_plugindir(void) XINE_PROTECTED; const char *xine_get_fontdir(void) XINE_PROTECTED; const char *xine_get_localedir(void) XINE_PROTECTED; -- cgit v1.2.3