summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
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;
+}