summaryrefslogtreecommitdiff
path: root/plugin.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-05-13 16:11:19 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2002-05-13 16:11:19 +0200
commit49fcbf19fa2a179d06990443349575ffa86a697f (patch)
tree5399a6193ab2f144408c5b73e840ec2071878c18 /plugin.c
parentbbddf7e2dbc855e1abc05c748c7c16ccf7a00ca5 (diff)
downloadvdr-49fcbf19fa2a179d06990443349575ffa86a697f.tar.gz
vdr-49fcbf19fa2a179d06990443349575ffa86a697f.tar.bz2
Made the config directory available to plugins
Diffstat (limited to 'plugin.c')
-rw-r--r--plugin.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/plugin.c b/plugin.c
index 3bf5112f..fa9de4ca 100644
--- a/plugin.c
+++ b/plugin.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: plugin.c 1.3 2002/05/12 10:10:38 kls Exp $
+ * $Id: plugin.c 1.4 2002/05/13 16:08:22 kls Exp $
*/
#include "plugin.h"
@@ -22,6 +22,8 @@
// --- cPlugin ---------------------------------------------------------------
+char *cPlugin::configDirectory = NULL;
+
cPlugin::cPlugin(void)
{
name = NULL;
@@ -91,6 +93,19 @@ void cPlugin::RegisterI18n(const tI18nPhrase * const Phrases)
I18nRegister(Phrases, Name());
}
+void cPlugin::SetConfigDirectory(const char *Dir)
+{
+ configDirectory = strdup(Dir);
+}
+
+const char *cPlugin::ConfigDirectory(const char *PluginName)
+{
+ static char *buffer = NULL;
+ delete buffer;
+ asprintf(&buffer, "%s/plugins%s%s", configDirectory, PluginName ? "/" : "", PluginName ? PluginName : "");
+ return MakeDirs(buffer, true) ? buffer : NULL;
+}
+
// --- cDll ------------------------------------------------------------------
cDll::cDll(const char *FileName, const char *Args)