Go to the documentation of this file.
20 #define LIBVDR_PREFIX "libvdr-"
21 #define SO_INDICATOR ".so."
23 #define MAXPLUGINARGS 1024
24 #define HOUSEKEEPINGDELTA 10 // seconds
144 esyslog(
"ERROR: plugin '%s' called cPlugin::ConfigDirectory(), which is not thread safe!", PluginName ? PluginName :
"<no name given>");
146 return MakeDirs(buffer,
true) ? *buffer : NULL;
158 esyslog(
"ERROR: plugin '%s' called cPlugin::CacheDirectory(), which is not thread safe!", PluginName ? PluginName :
"<no name given>");
160 return MakeDirs(buffer,
true) ? *buffer : NULL;
172 esyslog(
"ERROR: plugin '%s' called cPlugin::ResourceDirectory(), which is not thread safe!", PluginName ? PluginName :
"<no name given>");
174 return MakeDirs(buffer,
true) ? *buffer : NULL;
182 args = Args ? strdup(Args) : NULL;
199 memmove(s, s + 1, strlen(s));
200 while (*s && *s != c) {
202 memmove(s, s + 1, strlen(s));
207 memmove(s, s + 1, strlen(s));
210 esyslog(
"ERROR: missing closing %c", c);
211 fprintf(stderr,
"vdr: missing closing %c\n", c);
224 const char *error = dlerror();
226 void *(*creator)(void);
227 creator = (
void *(*)(void))dlsym(
handle,
"VDRPluginCreator");
228 if (!(error = dlerror()))
242 case '\\': memmove(p, p + 1, strlen(p));
246 esyslog(
"ERROR: missing character after \\");
247 fprintf(stderr,
"vdr: missing character after \\\n");
252 case '\'':
if ((p =
SkipQuote(p)) == NULL)
255 default:
if (!*p || isspace(*p)) {
262 esyslog(
"ERROR: plugin argument list too long");
263 fprintf(stderr,
"vdr: plugin argument list too long\n");
282 fprintf(stderr,
"vdr: %s\n", error);
297 fprintf(stderr,
"vdr: attempt to create more than one plugin manager - exiting!\n");
315 directory = Directory ? strdup(Directory) : NULL;
320 if (strcmp(Args,
"*") == 0) {
322 for (
int i = 0; i < Files.
Size(); i++) {
323 char *FileName = Files.
At(i);
331 if (strcmp(name,
"*") != 0) {
341 char *p = strchr(s,
' ');
346 esyslog(
"WARN: missing plugin '%s'", s);
347 fprintf(stderr,
"vdr: missing plugin '%s'\n", s);
436 time_t Now = time(NULL);
442 if (t > Now && (!Next || t < Next)) {
460 return dll ? dll->
Plugin() : NULL;
468 if (p && strcmp(p->
Name(), Name) == 0)
515 while ((dll =
dlls.Last()) != NULL) {
static cString sprintf(const char *fmt,...) __attribute__((format(printf
#define HOUSEKEEPINGDELTA
virtual cMenuSetupPage * SetupMenu(void)
void SetupStore(const char *Name, const char *Value=NULL)
static bool Active(const char *Prompt=NULL)
static cPlugin * CallFirstService(const char *Id, void *Data=NULL)
static bool HasPlugins(void)
static cPlugin * GetPlugin(int Index)
static const char * ResourceDirectory(const char *PluginName=NULL)
virtual bool Initialize(void)
static const char * ConfigDirectory(const char *PluginName=NULL)
virtual const char * Version(void)=0
void MainThreadHook(void)
void Add(cListObject *Object, cListObject *After=NULL)
virtual const char * Description(void)=0
virtual const char ** SVDRPHelpPages(void)
cPluginManager(const char *Directory)
virtual ~cPluginManager()
virtual void MainThreadHook(void)
void Del(cListObject *Object, bool DeleteObject=true)
static void SetCacheDirectory(const char *Dir)
bool InitializePlugins(void)
static cString cacheDirectory
void Shutdown(bool Log=false)
void AddPlugin(const char *Args)
void SetDirectory(const char *Directory)
virtual void Housekeeping(void)
virtual cString SVDRPCommand(const char *Command, const char *Option, int &ReplyCode)
virtual bool ProcessArgs(int argc, char *argv[])
bool Confirm(const char *s, int Seconds=10, bool WaitForTimeout=false)
cDll(const char *FileName, const char *Args)
static tThreadId IsMainThread(void)
bool LoadPlugins(bool Log=false)
static const char * CacheDirectory(const char *PluginName=NULL)
virtual bool Service(const char *Id, void *Data=NULL)
const T * Prev(const T *Object) const
const cListObject * Get(int Index) const
void I18nRegister(const char *Plugin)
Registers the named plugin, so that it can use internationalized texts.
static cString configDirectory
bool Load(bool Log=false)
static cString resourceDirectory
static cPluginManager * pluginManager
virtual bool SetupParse(const char *Name, const char *Value)
static char * SkipQuote(char *s)
virtual time_t WakeupTime(void)
virtual cString Active(void)
static bool CallAllServices(const char *Id, void *Data=NULL)
virtual const char * MainMenuEntry(void)
const T * Next(const T *Object) const
< Returns the element immediately before Object in this list, or NULL if Object is the first element ...
static void SetConfigDirectory(const char *Dir)
virtual cOsdObject * MainMenuAction(void)
virtual const char * CommandLineHelp(void)
void Store(const char *Name, const char *Value, const char *Plugin=NULL, bool AllowMultiple=false)
static cPlugin * GetNextWakeupPlugin(void)
static void SetResourceDirectory(const char *Dir)
void SetName(const char *s)