summaryrefslogtreecommitdiff
path: root/plugin.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-08-21 10:44:29 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2005-08-21 10:44:29 +0200
commit06a27f142b65cef811d7e0a5931d54ed15725a7d (patch)
tree9a66120247458d54463fbee543261cb567365b0d /plugin.c
parent7533b69e9b67d5d2e6df4bef8af17fa02c068f0d (diff)
downloadvdr-06a27f142b65cef811d7e0a5931d54ed15725a7d.tar.gz
vdr-06a27f142b65cef811d7e0a5931d54ed15725a7d.tar.bz2
Added 'Service' functions to the plugin interface
Diffstat (limited to 'plugin.c')
-rw-r--r--plugin.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/plugin.c b/plugin.c
index b7ebf372..8a316cc0 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.13 2005/01/30 14:05:20 kls Exp $
+ * $Id: plugin.c 1.14 2005/08/21 09:35:28 kls Exp $
*/
#include "plugin.h"
@@ -99,6 +99,11 @@ void cPlugin::SetupStore(const char *Name, int Value)
Setup.Store(Name, Value, this->Name());
}
+bool cPlugin::Service(const char *Id, void *Data)
+{
+ return false;
+}
+
void cPlugin::RegisterI18n(const tI18nPhrase * const Phrases)
{
I18nRegister(Phrases, Name());
@@ -372,6 +377,31 @@ cPlugin *cPluginManager::GetPlugin(const char *Name)
return NULL;
}
+cPlugin *cPluginManager::CallFirstService(const char *Id, void *Data)
+{
+ if (pluginManager) {
+ for (cDll *dll = pluginManager->dlls.First(); dll; dll = pluginManager->dlls.Next(dll)) {
+ cPlugin *p = dll->Plugin();
+ if (p && p->Service(Id, Data))
+ return p;
+ }
+ }
+ return NULL;
+}
+
+bool cPluginManager::CallAllServices(const char *Id, void *Data)
+{
+ bool found=false;
+ if (pluginManager) {
+ for (cDll *dll = pluginManager->dlls.First(); dll; dll = pluginManager->dlls.Next(dll)) {
+ cPlugin *p = dll->Plugin();
+ if (p && p->Service(Id, Data))
+ found = true;
+ }
+ }
+ return found;
+}
+
void cPluginManager::StopPlugins(void)
{
for (cDll *dll = dlls.Last(); dll; dll = dlls.Prev(dll)) {