summaryrefslogtreecommitdiff
path: root/eepg.c
diff options
context:
space:
mode:
authorDimitar Petrovski <dimeptr@gmail.com>2012-05-23 20:07:47 (GMT)
committerDimitar Petrovski <dimeptr@gmail.com>2012-05-23 20:07:47 (GMT)
commit7089617d8186143cfe946596dfafd650cb3028f9 (patch)
tree2614d69c4d9f7f765a893cddbba9bf0bae92df42 /eepg.c
parent07e0eccce3b565fb13f2d675f6eddc38c4917b89 (diff)
downloadvdr-plugin-eepg-7089617d8186143cfe946596dfafd650cb3028f9.tar.gz
vdr-plugin-eepg-7089617d8186143cfe946596dfafd650cb3028f9.tar.bz2
move utilities to separate files
Diffstat (limited to 'eepg.c')
-rw-r--r--eepg.c110
1 files changed, 1 insertions, 109 deletions
diff --git a/eepg.c b/eepg.c
index 91a08c0..337e93a 100644
--- a/eepg.c
+++ b/eepg.c
@@ -44,6 +44,7 @@
#include "log.h"
#include "setupeepg.h"
#include "equivhandler.h"
+#include "util.h"
#include <map>
#include <string>
@@ -168,8 +169,6 @@ unsigned int crc16 (unsigned int crc, unsigned char const *p, int len)
#define STARTTIME_BIAS (20*60)
-static int AvailableSources[32];
-static int NumberOfAvailableSources = 0;
static int LastVersionNagra = -1; //currently only used for Nagra, should be stored per transponder, per system
@@ -772,113 +771,6 @@ nextloop1:
//unsigned char DecodeErrorText[4096]; //TODO only used for debugging?
-int Yesterday;
-int YesterdayEpoch;
-int YesterdayEpochUTC;
-
-/*
- * Convert local time to UTC
- */
-time_t LocalTime2UTC (time_t t)
-{
- struct tm *temp;
-
- temp = gmtime (&t);
- temp->tm_isdst = -1;
- return mktime (temp);
-}
-
-/*
- * Convert UTC to local time
- */
-time_t UTC2LocalTime (time_t t)
-{
- return 2 * t - LocalTime2UTC (t);
-}
-
-void GetLocalTimeOffset (void)
-{
- time_t timeLocal;
- struct tm *tmCurrent;
-
- timeLocal = time (NULL);
- timeLocal -= 86400;
- tmCurrent = gmtime (&timeLocal);
- Yesterday = tmCurrent->tm_wday;
- tmCurrent->tm_hour = 0;
- tmCurrent->tm_min = 0;
- tmCurrent->tm_sec = 0;
- tmCurrent->tm_isdst = -1;
- YesterdayEpoch = mktime (tmCurrent);
- YesterdayEpochUTC = UTC2LocalTime (mktime (tmCurrent));
-}
-
-void CleanString (unsigned char *String)
-{
-
-// LogD (1, prep("Unclean: %s"), String);
- unsigned char *Src;
- unsigned char *Dst;
- int Spaces;
- int pC;
- Src = String;
- Dst = String;
- Spaces = 0;
- pC = 0;
- while (*Src) {
- // corrections
- if (*Src == 0x8c) { // iso-8859-2 LATIN CAPITAL LETTER S WITH ACUTE
- *Src = 0xa6;
- }
- if (*Src == 0x8f) { // iso-8859-2 LATIN CAPITAL LETTER Z WITH ACUTE
- *Src = 0xac;
- }
-
- if (*Src!=0x0A && *Src < 0x20) { //don't remove newline
- *Src = 0x20;
- }
- if (*Src == 0x20) {
- Spaces++;
- if (pC == 0) {
- Spaces++;
- }
- } else {
- Spaces = 0;
- }
- if (Spaces < 2) {
- *Dst = *Src;
- Dst++;
- pC++;
- }
- Src++;
- }
- if (Spaces > 0) {
- Dst--;
- *Dst = 0;
- } else {
- *Dst = 0;
- }
-// LogD (1, prep("Clean: %s"), String);
-}
-
-cChannel *GetChannelByID(tChannelID & channelID, bool searchOtherPos)
-{
- cChannel *VC = Channels.GetByChannelID(channelID, true);
- if(!VC && searchOtherPos){
- //look on other satpositions
- for(int i = 0;i < NumberOfAvailableSources;i++){
- channelID = tChannelID(AvailableSources[i], channelID.Nid(), channelID.Tid(), channelID.Sid());
- VC = Channels.GetByChannelID(channelID, true);
- if(VC){
- //found this actually on satellite nextdoor...
- break;
- }
- }
- }
-
- return VC;
-}
-
bool cFilterEEPG::GetThemesSKYBOX (void) //TODO can't we read this from the DVB stream?
{
string FileName = cSetupEEPG::getInstance()->getConfDir();