summaryrefslogtreecommitdiff
path: root/epgsearchtools.h
diff options
context:
space:
mode:
authorChristian Wieninger <cwieninger (at) gmx (dot) de>2009-05-06 23:02:32 +0200
committerChristian Wieninger <cwieninger (at) gmx (dot) de>2009-05-06 23:02:32 +0200
commitc0cadf7fbf8a9df4273fcd6757debefb86c7a4aa (patch)
tree05c68cbef2995176476150a330ceb8a27ffdde59 /epgsearchtools.h
parente6bd92773bdd36685070a1e06b677fd6bc539a70 (diff)
downloadvdr-plugin-epgsearch-c0cadf7fbf8a9df4273fcd6757debefb86c7a4aa.tar.gz
vdr-plugin-epgsearch-c0cadf7fbf8a9df4273fcd6757debefb86c7a4aa.tar.bz2
some speed enhancements
Diffstat (limited to 'epgsearchtools.h')
-rw-r--r--epgsearchtools.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/epgsearchtools.h b/epgsearchtools.h
index b21b386..426156c 100644
--- a/epgsearchtools.h
+++ b/epgsearchtools.h
@@ -139,7 +139,21 @@ string UpdateAuxValue(string aux, string section, string value);
string UpdateAuxValue(string aux, string section, long num);
void ToLower(char* szText);
char *strreplacei(char *s, const char *s1, const char *s2);
-char *strreplaceall(char* source, char ch, const char* replacement);
+
+// replace s1 with s2 in s ignoring the case of s1
+inline char *strreplacei(char *s, const char *s1, const char s2)
+{
+ char *p = strcasestr(s, s1);
+ if (p) {
+ int offset = p - s;
+ int l = strlen(s);
+ int l1 = strlen(s1);
+ memmove(s + offset + 1, s + offset + l1, l - offset - l1 + 1);
+ s[offset] = s2;
+ }
+ return s;
+}
+
void sleepMSec(long ms);
void sleepSec(long s);
bool SendViaSVDRP(cString SVDRPcmd);