summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
authorMatti Lehtimäki <matti.lehtimaki@gmail.com>2013-01-07 21:29:45 +0200
committerMatti Lehtimäki <matti.lehtimaki@gmail.com>2013-01-07 21:29:45 +0200
commitc6ffcc01aa82582b119de294ff40aac915c88e19 (patch)
treeac6881e6c72f9f2511bcbff7d5d29607a9ff9711 /tools.c
downloadvdr-plugin-history-c6ffcc01aa82582b119de294ff40aac915c88e19.tar.gz
vdr-plugin-history-c6ffcc01aa82582b119de294ff40aac915c88e19.tar.bz2
Initial commit. Version 0.0.3.v0.0.3
Diffstat (limited to 'tools.c')
-rwxr-xr-xtools.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/tools.c b/tools.c
new file mode 100755
index 0000000..d1f28bd
--- /dev/null
+++ b/tools.c
@@ -0,0 +1,38 @@
+/*
+ * tools.c: History plugin for the Video Disk Recorder
+ *
+ * See the README file for copyright information and how to reach the author.
+ *
+ */
+
+#include "tools.h"
+
+//
+// File type detection code adapted from RSS Reader plugin for VDR
+// http://www.saunalahti.fi/~rahrenbe/vdr/rssreader/
+// by Rolf Ahrenberg
+//
+
+bool isimage(const char *text)
+{
+ if (endswith(text, ".jpg") || endswith(text, ".gif") || endswith(text, ".png"))
+ return true;
+ return false;
+}
+
+bool isvideo(const char *text)
+{
+ if (endswith(text, ".mpg") || endswith(text, ".avi") || endswith(text, ".ts") ||
+ endswith(text, ".mkv") || endswith(text, ".flv") || endswith(text, ".wmv") ||
+ endswith(text, ".mp4"))
+ return true;
+ return false;
+}
+
+bool ismusic(const char *text)
+{
+ if (endswith(text, ".mp3") || endswith(text, ".wav") || endswith(text, ".ogg") ||
+ endswith(text, ".flac"))
+ return true;
+ return false;
+}