diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2007-02-25 10:56:29 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2007-02-25 10:56:29 +0100 |
commit | ddb7f335674d668af3dd06bd61a0853b3af60df0 (patch) | |
tree | 5d52ba7939f6aa0b18cc01f546ce5c82ae8d3b80 /plugin.c | |
parent | 50b14be807e1d3002246f359de83a8a18a0e6008 (diff) | |
download | vdr-ddb7f335674d668af3dd06bd61a0853b3af60df0.tar.gz vdr-ddb7f335674d668af3dd06bd61a0853b3af60df0.tar.bz2 |
Rewrite of shutdown handling; implemented cPlugin::WakeupTime(); SIGHUP forces reload; cThread::EmergencyExit() replaced by ShutdownHandler.RequestEmergencyExit()
Diffstat (limited to 'plugin.c')
-rw-r--r-- | plugin.c | 27 |
1 files changed, 26 insertions, 1 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: plugin.c 1.24 2006/10/14 09:49:16 kls Exp $ + * $Id: plugin.c 1.25 2007/02/24 13:44:23 kls Exp $ */ #include "plugin.h" @@ -80,6 +80,11 @@ cString cPlugin::Active(void) return NULL; } +time_t cPlugin::WakeupTime(void) +{ + return 0; +} + const char *cPlugin::MainMenuEntry(void) { return NULL; @@ -403,6 +408,26 @@ bool cPluginManager::Active(const char *Prompt) return false; } +cPlugin *cPluginManager::GetNextWakeupPlugin(void) +{ + cPlugin *NextPlugin = NULL; + if (pluginManager) { + time_t Now = time(NULL); + time_t Next = 0; + for (cDll *dll = pluginManager->dlls.First(); dll; dll = pluginManager->dlls.Next(dll)) { + cPlugin *p = dll->Plugin(); + if (p) { + time_t t = p->WakeupTime(); + if (t > Now && (!Next || t < Next)) { + Next = t; + NextPlugin = p; + } + } + } + } + return NextPlugin; +} + bool cPluginManager::HasPlugins(void) { return pluginManager && pluginManager->dlls.Count(); |