blob: 818e8832f8d7e472d183b1560aeb7d4f4aae8ff3 (
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
51
52
53
54
55
56
57
58
|
/*
* epgdata2xmltv.h: a grabber for the xmltv2vdr plugin
*
*/
#ifndef __EPGDATA2XMLTV_H
#define __EPGDATA2XMLTV_H
#include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>
#include <libxslt/transform.h>
#include <libxslt/xsltutils.h>
#include <libexslt/exslt.h>
#include <stdio.h>
#include <sys/stat.h>
#include <unistd.h>
#if __GNUC__ > 3
#define UNUSED(v) UNUSED_ ## v __attribute__((unused))
#else
#define UNUSED(x) x
#endif
#define esyslog(a...) void( (SysLogLevel > 0) ? syslog_redir(a) : void() )
#define isyslog(a...) void( (SysLogLevel > 1) ? syslog_redir(a) : void() )
#define dsyslog(a...) void( (SysLogLevel > 2) ? syslog_redir(a) : void() )
#define tsyslog(a...) void( (SysLogLevel > 3) ? syslog_redir(a) : void() )
#define EPGDATA2XMLTV_USERAGENT "libcurl-agent/1.0"
#define EPGDATA2XMLTV_URL "http://www.epgdata.com/index.php?action=sendPackage&iOEM=VDR&dataType=xml&dayOffset=%s"
struct data
{
size_t size;
int fd;
};
class cepgdata2xmltv
{
private:
struct data data;
xsltStylesheetPtr pxsltStylesheet;
xmlDocPtr sxmlDoc;
char *strreplace(char *s, const char *s1, const char *s2);
int Fetch(const char *path, const char *pin, int day);
int DownloadData(const char *url);
bool Translate(xmlDocPtr pxmlDoc, const char **params);
void LoadXSLT();
public:
cepgdata2xmltv();
~cepgdata2xmltv();
int Process(int argc, char *argv[]);
};
#endif //__EPGDATA2XMLTV_H
|