summaryrefslogtreecommitdiff
path: root/src/vdr-plugin/common.h
diff options
context:
space:
mode:
authorAntti Ajanki <antti.ajanki@iki.fi>2010-07-23 20:55:11 +0300
committerAntti Ajanki <antti.ajanki@iki.fi>2010-07-23 20:55:11 +0300
commit310743fb9ebbf68b253b923a309cc5f635da89a1 (patch)
tree59c365db7459649344b4ab6d58fde1ceb362506d /src/vdr-plugin/common.h
downloadvdr-plugin-webvideo-310743fb9ebbf68b253b923a309cc5f635da89a1.tar.gz
vdr-plugin-webvideo-310743fb9ebbf68b253b923a309cc5f635da89a1.tar.bz2
release 0.3.0
Diffstat (limited to 'src/vdr-plugin/common.h')
-rw-r--r--src/vdr-plugin/common.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/vdr-plugin/common.h b/src/vdr-plugin/common.h
new file mode 100644
index 0000000..5b4385f
--- /dev/null
+++ b/src/vdr-plugin/common.h
@@ -0,0 +1,42 @@
+/*
+ * common.h: Web video plugin for the Video Disk Recorder
+ *
+ * See the README file for copyright information and how to reach the author.
+ *
+ * $Id$
+ */
+
+#ifndef __WEBVIDEO_COMMON_H
+#define __WEBVIDEO_COMMON_H
+
+#ifdef DEBUG
+#define debug(x...) dsyslog("Webvideo: " x);
+#define info(x...) isyslog("Webvideo: " x);
+#define warning(x...) esyslog("Webvideo: Warning: " x);
+#define error(x...) esyslog("Webvideo: " x);
+#else
+#define debug(x...) ;
+#define info(x...) isyslog("Webvideo: " x);
+#define warning(x...) esyslog("Webvideo: Warning: " x);
+#define error(x...) esyslog("Webvideo: " x);
+#endif
+
+// Return the extension of the url or NULL, if the url has no
+// extension. The caller must free the returned string.
+char *extensionFromUrl(const char *url);
+// Returns a "safe" version of filename. Currently just removes / from
+// the name. The caller must free the returned string.
+char *validateFileName(const char *filename);
+int moveFile(const char *oldpath, const char *newpath);
+// Return the URL encoded version of s. The called must free the
+// returned memory.
+char *URLencode(const char *s);
+// Remove URL encoding from s. The called must free the returned
+// memory.
+char *URLdecode(const char *s);
+// Return a "safe" version of filename. Remove path (replace '/' with
+// '!') and dots from the beginning. The string is modified in-place,
+// i.e. returns the pointer filename that was passed as argument.
+char *safeFilename(char *filename);
+
+#endif // __WEBVIDEO_COMMON_H