blob: 8443081ba239fc8df38288eecf334b1372718bc4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
/*
* 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);
// Return the domain part from url.
cString parseDomain(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. Replace '/' with '_' and
// remove dots from the beginning. If vfatnames is true, replace also
// other characters which are not allowed on VFAT. The string is
// modified in-place, i.e. returns the pointer filename that was
// passed as argument.
char *safeFilename(char *filename, bool vfatnames);
// Escape s so that it can be passed as parameter to a shell command.
cString shellEscape(const char *s);
// Convert string s to lower case
char *strlower(char *s);
#endif // __WEBVIDEO_COMMON_H
|