summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/common.c18
-rw-r--r--lib/common.h5
-rw-r--r--lib/demo.c5
3 files changed, 28 insertions, 0 deletions
diff --git a/lib/common.c b/lib/common.c
index cf68ffa..a452b23 100644
--- a/lib/common.c
+++ b/lib/common.c
@@ -261,6 +261,20 @@ const char* toCase(Case cs, char* str)
return str;
}
+char* replaceChars(char* string, const char* chars, const char to)
+{
+ char* p = string;
+
+ while (*p)
+ {
+ if (strchr(chars, *p))
+ *p = to;
+ p++;
+ }
+
+ return string;
+}
+
void removeChars(std::string& str, const char* ignore)
{
const char* s = str.c_str();
@@ -1920,6 +1934,8 @@ int urlUnescape(char* dst, const char* src, int normalize)
return (dst - org_dst) - 1;
}
+#ifdef VDR_PLUGIN
+
//***************************************************************************
//***************************************************************************
// Timer Thread
@@ -1967,3 +1983,5 @@ void cTimerThread::Action()
// if (selfdetroy)
// delete this; // :o :o ;)
}
+
+#endif // VDR_PLUGIN
diff --git a/lib/common.h b/lib/common.h
index c7faf81..c8361ec 100644
--- a/lib/common.h
+++ b/lib/common.h
@@ -265,6 +265,7 @@ const char* bcastAddressOf(const char* ipStr, const char* maskStr = 0);
const char* getUniqueId();
#endif
+char* replaceChars(char* string, const char* chars, const char to);
void removeChars(std::string& str, const char* ignore);
void removeCharsExcept(std::string& str, const char* except);
void removeWord(std::string& pattern, std::string word);
@@ -414,6 +415,8 @@ class LogDuration
int logLevel;
};
+#ifdef VDR_PLUGIN
+
//***************************************************************************
// Timer Thread
//***************************************************************************
@@ -442,6 +445,8 @@ class cTimerThread : public cThread
sendEventFct sendEvent;
};
+#endif // VDR_PLUGIN
+
//***************************************************************************
// Semaphore
//***************************************************************************
diff --git a/lib/demo.c b/lib/demo.c
index 347cabf..9d44526 100644
--- a/lib/demo.c
+++ b/lib/demo.c
@@ -470,6 +470,11 @@ int main(int argc, char** argv)
cEpgConfig::logstdout = yes;
cEpgConfig::loglevel = 2;
+ char* str = strdup("https://cellular.images.dvbdata.com:1234/4998510/4998510/320x240.jpg");
+ replaceChars(str, "<>:\"/\\:|?*", '_');
+ tell(0, "%s", str);
+ free(str);
+
const char* path = "/etc/epgd/epg.dat";
if (argc > 1)