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) {
323 while ((e = d.
Next()) != NULL) {
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) {