reformat wiith unix2dos & astyle

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1495 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Branch: ni/coolstream
Commit: 7dab3d9e3e
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2011-05-26 (Thu, 26 May 2011)



------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2011-05-26 20:23:16 +00:00
parent 376e883736
commit cf15f33903
14 changed files with 10830 additions and 10576 deletions

View File

@@ -73,7 +73,7 @@ SIevent::SIevent(const struct eit_event *e)
} }
SIevent::SIevent(const t_original_network_id _original_network_id, const t_transport_stream_id _transport_stream_id, const t_service_id _service_id, SIevent::SIevent(const t_original_network_id _original_network_id, const t_transport_stream_id _transport_stream_id, const t_service_id _service_id,
const unsigned short _event_id) const unsigned short _event_id)
{ {
original_network_id = _original_network_id; original_network_id = _original_network_id;
transport_stream_id = _transport_stream_id; transport_stream_id = _transport_stream_id;
@@ -81,11 +81,11 @@ SIevent::SIevent(const t_original_network_id _original_network_id, const t_trans
eventID = _event_id; eventID = _event_id;
table_id = 0xFF; /* not set */ table_id = 0xFF; /* not set */
version = 0xFF; version = 0xFF;
/* contentClassification = ""; /* contentClassification = "";
userClassification = ""; userClassification = "";
itemDescription = ""; itemDescription = "";
item = ""; item = "";
extendedText = "";*/ extendedText = "";*/
} }
// Std-Copy // Std-Copy
@@ -134,10 +134,10 @@ char SIevent::getFSK() const
{ {
if (it->countryCode == "DEU") if (it->countryCode == "DEU")
{ {
if ((it->rating >= 0x01) && (it->rating <= 0x0F)) if ((it->rating >= 0x01) && (it->rating <= 0x0F))
return (it->rating + 3); // 0x01 to 0x0F minimum age = rating + 3 years return (it->rating + 3); // 0x01 to 0x0F minimum age = rating + 3 years
else else
return (it->rating == 0 ? 0 : 18); // return FSK 18 for : 0x10 to 0xFF defined by the broadcaster return (it->rating == 0 ? 0 : 18); // return FSK 18 for : 0x10 to 0xFF defined by the broadcaster
} }
} }
if (!ratings.empty()) if (!ratings.empty())
@@ -161,9 +161,9 @@ int SIevent::saveXML0(FILE *file) const
int SIevent::saveXML2(FILE *file) const int SIevent::saveXML2(FILE *file) const
{ {
for (std::map<std::string, std::string>::const_iterator for (std::map<std::string, std::string>::const_iterator
i = langName.begin() ; i = langName.begin() ;
i != langName.end() ; i != langName.end() ;
i++) { i++) {
if (i->second.length()) { if (i->second.length()) {
fprintf(file, "\t\t\t<name lang=\"%s\" string=\"", i->first.c_str()); fprintf(file, "\t\t\t<name lang=\"%s\" string=\"", i->first.c_str());
saveStringToXMLfile(file, i->second.c_str()); saveStringToXMLfile(file, i->second.c_str());
@@ -171,9 +171,9 @@ int SIevent::saveXML2(FILE *file) const
} }
} }
for (std::map<std::string, std::string>::const_iterator for (std::map<std::string, std::string>::const_iterator
i = langText.begin() ; i = langText.begin() ;
i != langText.end() ; i != langText.end() ;
i++) { i++) {
if (i->second.length()) { if (i->second.length()) {
fprintf(file, "\t\t\t<text lang=\"%s\" string=\"", i->first.c_str()); fprintf(file, "\t\t\t<text lang=\"%s\" string=\"", i->first.c_str());
saveStringToXMLfile(file, i->second.c_str()); saveStringToXMLfile(file, i->second.c_str());
@@ -191,9 +191,9 @@ int SIevent::saveXML2(FILE *file) const
fprintf(file, "\"/>\n"); fprintf(file, "\"/>\n");
} }
for (std::map<std::string, std::string>::const_iterator for (std::map<std::string, std::string>::const_iterator
i = langExtendedText.begin() ; i = langExtendedText.begin() ;
i != langExtendedText.end() ; i != langExtendedText.end() ;
i++) { i++) {
if (i->second.length()) { if (i->second.length()) {
fprintf(file, "\t\t\t<extended_text lang=\"%s\" string=\"", i->first.c_str()); fprintf(file, "\t\t\t<extended_text lang=\"%s\" string=\"", i->first.c_str());
saveStringToXMLfile(file, i->second.c_str()); saveStringToXMLfile(file, i->second.c_str());
@@ -212,7 +212,7 @@ int SIevent::saveXML2(FILE *file) const
std::string SIevent::getName() const std::string SIevent::getName() const
{ {
if (CSectionsdClient::LANGUAGE_MODE_OFF == SIlanguage::getMode()){ if (CSectionsdClient::LANGUAGE_MODE_OFF == SIlanguage::getMode()) {
std::map<std::string, std::string>::const_iterator it = langName.begin() ; std::map<std::string, std::string>::const_iterator it = langName.begin() ;
if (it != langName.end()) return it->second; if (it != langName.end()) return it->second;
else return(""); else return("");
@@ -228,7 +228,7 @@ void SIevent::setName(const std::string &lang, const std::string &name)
std::string tmp = name; std::string tmp = name;
std::replace(tmp.begin(), tmp.end(), '\n', ' '); std::replace(tmp.begin(), tmp.end(), '\n', ' ');
//printf("setName: lang %s text %s\n", lang.c_str(), name.c_str()); //printf("setName: lang %s text %s\n", lang.c_str(), name.c_str());
if (CSectionsdClient::LANGUAGE_MODE_OFF == SIlanguage::getMode()){ if (CSectionsdClient::LANGUAGE_MODE_OFF == SIlanguage::getMode()) {
langName[languangeOFF] = tmp; //name; langName[languangeOFF] = tmp; //name;
} else { } else {
langName[lang] = tmp; //name; langName[lang] = tmp; //name;
@@ -237,7 +237,7 @@ void SIevent::setName(const std::string &lang, const std::string &name)
std::string SIevent::getText() const std::string SIevent::getText() const
{ {
if (CSectionsdClient::LANGUAGE_MODE_OFF == SIlanguage::getMode()){ if (CSectionsdClient::LANGUAGE_MODE_OFF == SIlanguage::getMode()) {
std::map<std::string, std::string>::const_iterator it = langText.begin() ; std::map<std::string, std::string>::const_iterator it = langText.begin() ;
if (it != langText.end()) return it->second; if (it != langText.end()) return it->second;
else return(""); else return("");
@@ -251,7 +251,7 @@ std::string SIevent::getText() const
void SIevent::setText(const std::string &lang, const std::string &text) void SIevent::setText(const std::string &lang, const std::string &text)
{ {
//printf("setText: lang %s text %s\n", lang.c_str(), text.c_str()); //printf("setText: lang %s text %s\n", lang.c_str(), text.c_str());
if (CSectionsdClient::LANGUAGE_MODE_OFF == SIlanguage::getMode()){ if (CSectionsdClient::LANGUAGE_MODE_OFF == SIlanguage::getMode()) {
langText[languangeOFF] = text; langText[languangeOFF] = text;
} else { } else {
langText[lang] = text; langText[lang] = text;
@@ -260,7 +260,7 @@ void SIevent::setText(const std::string &lang, const std::string &text)
std::string SIevent::getExtendedText() const std::string SIevent::getExtendedText() const
{ {
if (CSectionsdClient::LANGUAGE_MODE_OFF == SIlanguage::getMode()){ if (CSectionsdClient::LANGUAGE_MODE_OFF == SIlanguage::getMode()) {
std::map<std::string, std::string>::const_iterator it = langExtendedText.begin() ; std::map<std::string, std::string>::const_iterator it = langExtendedText.begin() ;
if (it != langExtendedText.end()) return it->second; if (it != langExtendedText.end()) return it->second;
else return(""); else return("");
@@ -273,7 +273,7 @@ std::string SIevent::getExtendedText() const
void SIevent::appendExtendedText(const std::string &lang, const std::string &text) void SIevent::appendExtendedText(const std::string &lang, const std::string &text)
{ {
if (CSectionsdClient::LANGUAGE_MODE_OFF == SIlanguage::getMode()){ if (CSectionsdClient::LANGUAGE_MODE_OFF == SIlanguage::getMode()) {
langExtendedText[languangeOFF] += text; langExtendedText[languangeOFF] += text;
} else { } else {
langExtendedText[lang] += text; langExtendedText[lang] += text;
@@ -283,7 +283,7 @@ void SIevent::appendExtendedText(const std::string &lang, const std::string &tex
void SIevent::setExtendedText(const std::string &lang, const std::string &text) void SIevent::setExtendedText(const std::string &lang, const std::string &text)
{ {
//printf("setExtendedText: lang %s text %s\n", lang.c_str(), text.c_str()); //printf("setExtendedText: lang %s text %s\n", lang.c_str(), text.c_str());
if (CSectionsdClient::LANGUAGE_MODE_OFF == SIlanguage::getMode()){ if (CSectionsdClient::LANGUAGE_MODE_OFF == SIlanguage::getMode()) {
langExtendedText[languangeOFF] = text; langExtendedText[languangeOFF] = text;
} else { } else {
langExtendedText[lang] = text; langExtendedText[lang] = text;
@@ -301,16 +301,16 @@ void SIevent::dump(void) const
if(item.length()) if(item.length())
printf("Item: %s\n", item.c_str()); printf("Item: %s\n", item.c_str());
if(itemDescription.length()) if(itemDescription.length())
printf("Item-Description: %s\n", itemDescription.c_str()); printf("Item-Description: %s\n", itemDescription.c_str());
for (std::map<std::string, std::string>::const_iterator it = langName.begin() ; for (std::map<std::string, std::string>::const_iterator it = langName.begin() ;
it != langName.end() ; ++it) it != langName.end() ; ++it)
printf("Name (%s): %s\n", it->first.c_str(), it->second.c_str()); printf("Name (%s): %s\n", it->first.c_str(), it->second.c_str());
for (std::map<std::string, std::string>::const_iterator it = langText.begin() ; for (std::map<std::string, std::string>::const_iterator it = langText.begin() ;
it != langText.end() ; ++it) it != langText.end() ; ++it)
printf("Text (%s): %s\n", it->first.c_str(), it->second.c_str()); printf("Text (%s): %s\n", it->first.c_str(), it->second.c_str());
for (std::map<std::string, std::string>::const_iterator it = langExtendedText.begin() ; for (std::map<std::string, std::string>::const_iterator it = langExtendedText.begin() ;
it != langExtendedText.end() ; ++it) it != langExtendedText.end() ; ++it)
printf("Extended-Text (%s): %s\n", it->first.c_str(), it->second.c_str()); printf("Extended-Text (%s): %s\n", it->first.c_str(), it->second.c_str());
if(contentClassification.length()) { if(contentClassification.length()) {
@@ -325,12 +325,12 @@ void SIevent::dump(void) const
printf(" 0x%02hhx", userClassification[i]); printf(" 0x%02hhx", userClassification[i]);
printf("\n"); printf("\n");
} }
/* /*
if(startzeit) if(startzeit)
printf("Startzeit: %s", ctime(&startzeit)); printf("Startzeit: %s", ctime(&startzeit));
if(dauer) if(dauer)
printf("Dauer: %02u:%02u:%02u (%umin, %us)\n", dauer/3600, (dauer%3600)/60, dauer%60, dauer/60, dauer); printf("Dauer: %02u:%02u:%02u (%umin, %us)\n", dauer/3600, (dauer%3600)/60, dauer%60, dauer/60, dauer);
*/ */
for_each(times.begin(), times.end(), printSItime()); for_each(times.begin(), times.end(), printSItime());
for_each(components.begin(), components.end(), printSIcomponent()); for_each(components.begin(), components.end(), printSIcomponent());
for_each(ratings.begin(), ratings.end(), printSIparentalRating()); for_each(ratings.begin(), ratings.end(), printSIparentalRating());
@@ -340,20 +340,20 @@ void SIevent::dump(void) const
void SIevent::dumpSmall(void) const void SIevent::dumpSmall(void) const
{ {
for (std::map<std::string, std::string>::const_iterator it = langName.begin() ; for (std::map<std::string, std::string>::const_iterator it = langName.begin() ;
it != langName.end() ; ++it) it != langName.end() ; ++it)
printf("Name (%s): %s\n", it->first.c_str(), it->second.c_str()); printf("Name (%s): %s\n", it->first.c_str(), it->second.c_str());
for (std::map<std::string, std::string>::const_iterator it = langText.begin() ; for (std::map<std::string, std::string>::const_iterator it = langText.begin() ;
it != langText.end() ; ++it) it != langText.end() ; ++it)
printf("Text (%s): %s\n", it->first.c_str(), it->second.c_str()); printf("Text (%s): %s\n", it->first.c_str(), it->second.c_str());
for (std::map<std::string, std::string>::const_iterator it = langExtendedText.begin() ; for (std::map<std::string, std::string>::const_iterator it = langExtendedText.begin() ;
it != langExtendedText.end() ; ++it) it != langExtendedText.end() ; ++it)
printf("Extended-Text (%s): %s\n", it->first.c_str(), it->second.c_str()); printf("Extended-Text (%s): %s\n", it->first.c_str(), it->second.c_str());
/* /*
if(startzeit) if(startzeit)
printf("Startzeit: %s", ctime(&startzeit)); printf("Startzeit: %s", ctime(&startzeit));
if(dauer) if(dauer)
printf("Dauer: %02u:%02u:%02u (%umin, %us)\n", dauer/3600, (dauer%3600)/60, dauer%60, dauer/60, dauer); printf("Dauer: %02u:%02u:%02u (%umin, %us)\n", dauer/3600, (dauer%3600)/60, dauer%60, dauer/60, dauer);
*/ */
for_each(times.begin(), times.end(), printSItime()); for_each(times.begin(), times.end(), printSItime());
for_each(ratings.begin(), ratings.end(), printSIparentalRating()); for_each(ratings.begin(), ratings.end(), printSIparentalRating());
for_each(linkage_descs.begin(), linkage_descs.end(), printSIlinkage()); for_each(linkage_descs.begin(), linkage_descs.end(), printSIlinkage());

View File

@@ -72,7 +72,7 @@ void SIlanguage::filter(const std::map<std::string, std::string>& s, int max, st
if (mode != CSectionsdClient::ALL) { if (mode != CSectionsdClient::ALL) {
for (std::vector<std::string>::const_iterator it = languages.begin() ; for (std::vector<std::string>::const_iterator it = languages.begin() ;
it != languages.end() ; ++it) { it != languages.end() ; ++it) {
std::map<std::string,std::string>::const_iterator text; std::map<std::string,std::string>::const_iterator text;
if ((text = s.find(*it)) != s.end()) { if ((text = s.find(*it)) != s.end()) {
if (count != max) { if (count != max) {
@@ -92,7 +92,7 @@ void SIlanguage::filter(const std::map<std::string, std::string>& s, int max, st
// return all available languages // return all available languages
if (s.begin() != s.end()) { if (s.begin() != s.end()) {
for (std::map<std::string, std::string>::const_iterator it = s.begin() ; for (std::map<std::string, std::string>::const_iterator it = s.begin() ;
it != s.end() ; ++it) { it != s.end() ; ++it) {
if (it != s.begin()) { if (it != s.begin()) {
retval.append(" \n"); retval.append(" \n");
} }
@@ -142,7 +142,7 @@ bool SIlanguage::loadLanguages()
pthread_mutex_unlock(&languages_lock); pthread_mutex_unlock(&languages_lock);
return true; return true;
error: error:
tmpLang.push_back("OFF"); tmpLang.push_back("OFF");
languages = tmpLang; languages = tmpLang;
mode = tmpMode; mode = tmpMode;
@@ -176,7 +176,7 @@ bool SIlanguage::saveLanguages()
} }
for (std::vector<std::string>::iterator it = languages.begin() ; for (std::vector<std::string>::iterator it = languages.begin() ;
it != languages.end() ; ++it) { it != languages.end() ; ++it) {
file << *it; file << *it;
file << "\n"; file << "\n";
if (file.fail()) goto error; if (file.fail()) goto error;
@@ -188,7 +188,7 @@ bool SIlanguage::saveLanguages()
pthread_mutex_unlock(&languages_lock); pthread_mutex_unlock(&languages_lock);
return true; return true;
error: error:
pthread_mutex_unlock(&languages_lock); pthread_mutex_unlock(&languages_lock);
return false; return false;
} }

View File

@@ -129,28 +129,31 @@ inline unsigned min(unsigned a, unsigned b)
static int get_table(unsigned char hi, unsigned char mid, unsigned char lo) static int get_table(unsigned char hi, unsigned char mid, unsigned char lo)
{ {
char lang[4]; char lang[4];
lang[0] = hi; lang[1] = mid; lang[2] = lo; lang[3] = 0; lang[0] = hi;
if(!strcmp(lang, "pol")) lang[1] = mid;
return 2; lang[2] = lo;
else if(!strcmp(lang, "tur")) lang[3] = 0;
return 9; if(!strcmp(lang, "pol"))
else if(!strcmp(lang, "gre")) return 2;
return 7; else if(!strcmp(lang, "tur"))
else if(!strcmp(lang, "rus")) return 9;
return 5; else if(!strcmp(lang, "gre"))
else if(!strcmp(lang, "bul")) return 7;
return 5; else if(!strcmp(lang, "rus"))
else if(!strcmp(lang, "ara")) return 5;
return 6; else if(!strcmp(lang, "bul"))
return 0; return 5;
else if(!strcmp(lang, "ara"))
return 6;
return 0;
} }
bool check_blacklisted(const t_original_network_id onid, const t_transport_stream_id tsid) bool check_blacklisted(const t_original_network_id onid, const t_transport_stream_id tsid)
{ {
if ( (onid == 0x0001) && if ( (onid == 0x0001) &&
((tsid == 0x03F0) || (tsid == 0x0408) || (tsid == 0x040E) || (tsid == 0x0412) || (tsid == 0x0416) || (tsid == 0x041E) || ((tsid == 0x03F0) || (tsid == 0x0408) || (tsid == 0x040E) || (tsid == 0x0412) || (tsid == 0x0416) || (tsid == 0x041E) ||
(tsid == 0x0420) || (tsid == 0x0422) || (tsid == 0x0424) || (tsid == 0x0444) )) (tsid == 0x0420) || (tsid == 0x0422) || (tsid == 0x0424) || (tsid == 0x0444) ))
return true; return true;
else else
return false; return false;
@@ -186,9 +189,9 @@ void SIsectionEIT::parsePDCDescriptor(const char *buf, SIevent &e, unsigned maxl
t.tm_min = s->pil2 & 0x3F; t.tm_min = s->pil2 & 0x3F;
t.tm_sec = 0; t.tm_sec = 0;
if (month == 11 && t.tm_mon == 0) // current month is dec, but event is in jan if (month == 11 && t.tm_mon == 0) // current month is dec, but event is in jan
t.tm_year++; t.tm_year++;
else if (month == 0 && t.tm_mon == 11) // current month is jan, but event is in dec else if (month == 0 && t.tm_mon == 11) // current month is jan, but event is in dec
t.tm_year--; t.tm_year--;
e.vps = mktime(&t); e.vps = mktime(&t);
// fprintf(stderr, "SIsectionEIT::parsePDCDescriptor: vps: %ld %s", e.vps, ctime(&e.vps)); // fprintf(stderr, "SIsectionEIT::parsePDCDescriptor: vps: %ld %s", e.vps, ctime(&e.vps));
} }
@@ -293,108 +296,108 @@ void SIsectionEIT::parseExtendedEventDescriptor(const char *buf, SIevent &e, uns
#ifdef ENABLE_FREESATEPG #ifdef ENABLE_FREESATEPG
std::string SIsectionEIT::freesatHuffmanDecode(std::string input) std::string SIsectionEIT::freesatHuffmanDecode(std::string input)
{ {
const char *src = input.c_str(); const char *src = input.c_str();
uint size = input.length(); uint size = input.length();
if (src[1] == 1 || src[1] == 2) if (src[1] == 1 || src[1] == 2)
{ {
std::string uncompressed(size * 3, ' '); std::string uncompressed(size * 3, ' ');
uint p = 0; uint p = 0;
struct hufftab *table; struct hufftab *table;
unsigned table_length; unsigned table_length;
if (src[1] == 1) if (src[1] == 1)
{ {
table = fsat_huffman1; table = fsat_huffman1;
table_length = sizeof(fsat_huffman1) / sizeof(fsat_huffman1[0]); table_length = sizeof(fsat_huffman1) / sizeof(fsat_huffman1[0]);
} }
else else
{ {
table = fsat_huffman2; table = fsat_huffman2;
table_length = sizeof(fsat_huffman2) / sizeof(fsat_huffman2[0]); table_length = sizeof(fsat_huffman2) / sizeof(fsat_huffman2[0]);
} }
unsigned value = 0, byte = 2, bit = 0; unsigned value = 0, byte = 2, bit = 0;
while (byte < 6 && byte < size) while (byte < 6 && byte < size)
{ {
value |= src[byte] << ((5-byte) * 8); value |= src[byte] << ((5-byte) * 8);
byte++; byte++;
} }
char lastch = START; char lastch = START;
do
{
bool found = false;
unsigned bitShift = 0;
if (lastch == ESCAPE)
{
found = true;
// Encoded in the next 8 bits.
// Terminated by the first ASCII character.
char nextCh = (value >> 24) & 0xff;
bitShift = 8;
if ((nextCh & 0x80) == 0)
lastch = nextCh;
if (p >= uncompressed.length())
uncompressed.resize(p+10);
uncompressed[p++] = nextCh;
}
else
{
for (unsigned j = 0; j < table_length; j++)
{
if (table[j].last == lastch)
{
unsigned mask = 0, maskbit = 0x80000000;
for (short kk = 0; kk < table[j].bits; kk++)
{
mask |= maskbit;
maskbit >>= 1;
}
if ((value & mask) == table[j].value)
{
char nextCh = table[j].next;
bitShift = table[j].bits;
if (nextCh != STOP && nextCh != ESCAPE)
{
if (p >= uncompressed.length())
uncompressed.resize(p+10);
uncompressed[p++] = nextCh;
}
found = true;
lastch = nextCh;
break;
}
}
}
}
if (found)
{
// Shift up by the number of bits.
for (unsigned b = 0; b < bitShift; b++)
{
value = (value << 1) & 0xfffffffe;
if (byte < size)
value |= (src[byte] >> (7-bit)) & 1;
if (bit == 7)
{
bit = 0;
byte++;
}
else bit++;
}
}
else
{
// Entry missing in table.
uncompressed.resize(p);
uncompressed.append("...");
return uncompressed;
}
} while (lastch != STOP && value != 0);
do
{
bool found = false;
unsigned bitShift = 0;
if (lastch == ESCAPE)
{
found = true;
// Encoded in the next 8 bits.
// Terminated by the first ASCII character.
char nextCh = (value >> 24) & 0xff;
bitShift = 8;
if ((nextCh & 0x80) == 0)
lastch = nextCh;
if (p >= uncompressed.length())
uncompressed.resize(p+10);
uncompressed[p++] = nextCh;
}
else
{
for (unsigned j = 0; j < table_length; j++)
{
if (table[j].last == lastch)
{
unsigned mask = 0, maskbit = 0x80000000;
for (short kk = 0; kk < table[j].bits; kk++)
{
mask |= maskbit;
maskbit >>= 1;
}
if ((value & mask) == table[j].value)
{
char nextCh = table[j].next;
bitShift = table[j].bits;
if (nextCh != STOP && nextCh != ESCAPE)
{
if (p >= uncompressed.length())
uncompressed.resize(p+10);
uncompressed[p++] = nextCh;
}
found = true;
lastch = nextCh;
break;
}
}
}
}
if (found)
{
// Shift up by the number of bits.
for (unsigned b = 0; b < bitShift; b++)
{
value = (value << 1) & 0xfffffffe;
if (byte < size)
value |= (src[byte] >> (7-bit)) & 1;
if (bit == 7)
{
bit = 0;
byte++;
}
else bit++;
}
}
else
{
// Entry missing in table.
uncompressed.resize(p);
uncompressed.append("...");
return uncompressed;
}
} while (lastch != STOP && value != 0);
uncompressed.resize(p); uncompressed.resize(p);
return uncompressed; return uncompressed;
} }
else return input; else return input;
} }
#endif #endif
@@ -420,7 +423,7 @@ void SIsectionEIT::parseShortEventDescriptor(const char *buf, SIevent &e, unsign
#endif #endif
} else } else
#endif // 0 #endif // 0
{ {
#ifdef ENABLE_FREESATEPG #ifdef ENABLE_FREESATEPG
// e.setName(language, buf[0] == 0x1f ? freesatHuffmanDecode(std::string(buf, evt->event_name_length)) : std::string(buf, evt->event_name_length)); // e.setName(language, buf[0] == 0x1f ? freesatHuffmanDecode(std::string(buf, evt->event_name_length)) : std::string(buf, evt->event_name_length));
@@ -444,7 +447,7 @@ void SIsectionEIT::parseShortEventDescriptor(const char *buf, SIevent &e, unsign
#endif #endif
} else } else
#endif // 0 #endif // 0
{ {
#ifdef ENABLE_FREESATEPG #ifdef ENABLE_FREESATEPG
// e.setText(language, buf[1] == 0x1f ? freesatHuffmanDecode(std::string(++buf, textlength)) : std::string(++buf, textlength)); // e.setText(language, buf[1] == 0x1f ? freesatHuffmanDecode(std::string(++buf, textlength)) : std::string(++buf, textlength));
std::string tmp_str = buf[1] == 0x1f ? freesatHuffmanDecode(std::string(++buf, textlength)) : std::string(++buf, textlength); std::string tmp_str = buf[1] == 0x1f ? freesatHuffmanDecode(std::string(++buf, textlength)) : std::string(++buf, textlength);
@@ -539,106 +542,106 @@ void SIsectionEIT::parse(void)
#ifdef ENABLE_PPT #ifdef ENABLE_PPT
void SIsectionPPT::parseLinkageDescriptor(const char *buf, SIevent &e, unsigned maxlen) void SIsectionPPT::parseLinkageDescriptor(const char *buf, SIevent &e, unsigned maxlen)
{ {
if(maxlen>=sizeof(struct descr_linkage_header)) if(maxlen>=sizeof(struct descr_linkage_header))
{ {
SIlinkage l((const struct descr_linkage_header *)buf); SIlinkage l((const struct descr_linkage_header *)buf);
e.linkage_descs.insert(e.linkage_descs.end(), l); e.linkage_descs.insert(e.linkage_descs.end(), l);
// printf("LinkName: %s\n", l.name.c_str()); // printf("LinkName: %s\n", l.name.c_str());
} }
} }
void SIsectionPPT::parseComponentDescriptor(const char *buf, SIevent &e, unsigned maxlen) void SIsectionPPT::parseComponentDescriptor(const char *buf, SIevent &e, unsigned maxlen)
{ {
if(maxlen>=sizeof(struct descr_component_header)) if(maxlen>=sizeof(struct descr_component_header))
e.components.insert(SIcomponent((const struct descr_component_header *)buf)); e.components.insert(SIcomponent((const struct descr_component_header *)buf));
} }
void SIsectionPPT::parseContentDescriptor(const char *buf, SIevent &e, unsigned maxlen) void SIsectionPPT::parseContentDescriptor(const char *buf, SIevent &e, unsigned maxlen)
{ {
struct descr_generic_header *cont=(struct descr_generic_header *)buf; struct descr_generic_header *cont=(struct descr_generic_header *)buf;
if(cont->descriptor_length+sizeof(struct descr_generic_header)>maxlen) if(cont->descriptor_length+sizeof(struct descr_generic_header)>maxlen)
return; // defekt return; // defekt
const char *classification=buf+sizeof(struct descr_generic_header); const char *classification=buf+sizeof(struct descr_generic_header);
while(classification<=buf+sizeof(struct descr_generic_header)+cont->descriptor_length-2) { while(classification<=buf+sizeof(struct descr_generic_header)+cont->descriptor_length-2) {
e.contentClassification+=std::string(classification, 1); e.contentClassification+=std::string(classification, 1);
// printf("Content: 0x%02hhx\n", *classification); // printf("Content: 0x%02hhx\n", *classification);
e.userClassification+=std::string(classification+1, 1); e.userClassification+=std::string(classification+1, 1);
// printf("User: 0x%02hhx\n", *(classification+1)); // printf("User: 0x%02hhx\n", *(classification+1));
classification+=2; classification+=2;
} }
} }
void SIsectionPPT::parseParentalRatingDescriptor(const char *buf, SIevent &e, unsigned maxlen) void SIsectionPPT::parseParentalRatingDescriptor(const char *buf, SIevent &e, unsigned maxlen)
{ {
struct descr_generic_header *cont=(struct descr_generic_header *)buf; struct descr_generic_header *cont=(struct descr_generic_header *)buf;
if(cont->descriptor_length+sizeof(struct descr_generic_header)>maxlen) if(cont->descriptor_length+sizeof(struct descr_generic_header)>maxlen)
return; // defekt return; // defekt
const char *s=buf+sizeof(struct descr_generic_header); const char *s=buf+sizeof(struct descr_generic_header);
while(s<buf+sizeof(struct descr_generic_header)+cont->descriptor_length-4) { while(s<buf+sizeof(struct descr_generic_header)+cont->descriptor_length-4) {
e.ratings.insert(SIparentalRating(std::string(s, 3), *(s+3))); e.ratings.insert(SIparentalRating(std::string(s, 3), *(s+3)));
s+=4; s+=4;
} }
} }
void SIsectionPPT::parseExtendedEventDescriptor(const char *buf, SIevent &e, unsigned maxlen) void SIsectionPPT::parseExtendedEventDescriptor(const char *buf, SIevent &e, unsigned maxlen)
{ {
struct descr_extended_event_header *evt=(struct descr_extended_event_header *)buf; struct descr_extended_event_header *evt=(struct descr_extended_event_header *)buf;
if((evt->descriptor_length+sizeof(descr_generic_header)>maxlen) || (evt->descriptor_length<sizeof(struct descr_extended_event_header)-sizeof(descr_generic_header))) if((evt->descriptor_length+sizeof(descr_generic_header)>maxlen) || (evt->descriptor_length<sizeof(struct descr_extended_event_header)-sizeof(descr_generic_header)))
return; // defekt return; // defekt
std::string language; std::string language;
language += evt->iso_639_2_language_code_hi + evt->iso_639_2_language_code_mid + evt->iso_639_2_language_code_lo; language += evt->iso_639_2_language_code_hi + evt->iso_639_2_language_code_mid + evt->iso_639_2_language_code_lo;
unsigned char *items=(unsigned char *)(buf+sizeof(struct descr_extended_event_header)); unsigned char *items=(unsigned char *)(buf+sizeof(struct descr_extended_event_header));
while(items<(unsigned char *)(buf+sizeof(struct descr_extended_event_header)+evt->length_of_items)) { while(items<(unsigned char *)(buf+sizeof(struct descr_extended_event_header)+evt->length_of_items)) {
if(*items) { if(*items) {
if(*(items+1) < 0x06) // other code table if(*(items+1) < 0x06) // other code table
e.itemDescription=std::string((const char *)(items+2), min(maxlen-((const char *)items+2-buf), (*items)-1)); e.itemDescription=std::string((const char *)(items+2), min(maxlen-((const char *)items+2-buf), (*items)-1));
else else
e.itemDescription=std::string((const char *)(items+1), min(maxlen-((const char *)items+1-buf), *items)); e.itemDescription=std::string((const char *)(items+1), min(maxlen-((const char *)items+1-buf), *items));
// printf("Item Description: %s\n", e.itemDescription.c_str()); // printf("Item Description: %s\n", e.itemDescription.c_str());
} }
items+=1+*items; items+=1+*items;
if(*items) { if(*items) {
e.item=std::string((const char *)(items+1), min(maxlen-((const char *)items+1-buf), *items)); e.item=std::string((const char *)(items+1), min(maxlen-((const char *)items+1-buf), *items));
// printf("Item: %s\n", e.item.c_str()); // printf("Item: %s\n", e.item.c_str());
} }
items+=1+*items; items+=1+*items;
} }
if(*items) { if(*items) {
if(*(items+1) < 0x06) // other code table if(*(items+1) < 0x06) // other code table
e.appendExtendedText(language, std::string((const char *)(items+2),min(maxlen-((const char *)items+2-buf), (*items)-1))); e.appendExtendedText(language, std::string((const char *)(items+2),min(maxlen-((const char *)items+2-buf), (*items)-1)));
else else
e.appendExtendedText(language, std::string((const char *)(items+1), min(maxlen-((const char *)items+1-buf), *items))); e.appendExtendedText(language, std::string((const char *)(items+1), min(maxlen-((const char *)items+1-buf), *items)));
// printf("Extended Text: %s\n", e.extendedText.c_str()); // printf("Extended Text: %s\n", e.extendedText.c_str());
} }
} }
void SIsectionPPT::parseShortEventDescriptor(const char *buf, SIevent &e, unsigned maxlen) void SIsectionPPT::parseShortEventDescriptor(const char *buf, SIevent &e, unsigned maxlen)
{ {
struct descr_short_event_header *evt=(struct descr_short_event_header *)buf; struct descr_short_event_header *evt=(struct descr_short_event_header *)buf;
if((evt->descriptor_length+sizeof(descr_generic_header)>maxlen) || (evt->descriptor_length<sizeof(struct descr_short_event_header)-sizeof(descr_generic_header))) if((evt->descriptor_length+sizeof(descr_generic_header)>maxlen) || (evt->descriptor_length<sizeof(struct descr_short_event_header)-sizeof(descr_generic_header)))
return; // defekt return; // defekt
std::string language; std::string language;
language += evt->language_code_hi + evt->language_code_mid + evt->language_code_lo; language += evt->language_code_hi + evt->language_code_mid + evt->language_code_lo;
buf+=sizeof(struct descr_short_event_header); buf+=sizeof(struct descr_short_event_header);
if(evt->event_name_length) { if(evt->event_name_length) {
if(*buf < 0x06) // other code table if(*buf < 0x06) // other code table
e.setName(language, std::string(buf+1, evt->event_name_length-1)); e.setName(language, std::string(buf+1, evt->event_name_length-1));
else else
e.setName(language, std::string(buf, evt->event_name_length)); e.setName(language, std::string(buf, evt->event_name_length));
} }
buf+=evt->event_name_length; buf+=evt->event_name_length;
unsigned char textlength=*((unsigned char *)buf); unsigned char textlength=*((unsigned char *)buf);
if(textlength > 2) { if(textlength > 2) {
if(*(buf+1) < 0x06) // other code table if(*(buf+1) < 0x06) // other code table
e.setText(language, std::string((++buf)+1, textlength-1)); e.setText(language, std::string((++buf)+1, textlength-1));
else else
e.setText(language, std::string(++buf, textlength)); e.setText(language, std::string(++buf, textlength));
} }
// printf("Name: %s\n", e.name.c_str()); // printf("Name: %s\n", e.name.c_str());
// printf("Text: %s\n", e.text.c_str()); // printf("Text: %s\n", e.text.c_str());
@@ -647,42 +650,42 @@ void SIsectionPPT::parseShortEventDescriptor(const char *buf, SIevent &e, unsign
void SIsectionPPT::parsePrivateContentOrderDescriptor(const char *buf, SIevent &e, unsigned maxlen) void SIsectionPPT::parsePrivateContentOrderDescriptor(const char *buf, SIevent &e, unsigned maxlen)
{ {
struct descr_short_event_header *evt=(struct descr_short_event_header *)buf; struct descr_short_event_header *evt=(struct descr_short_event_header *)buf;
if((evt->descriptor_length+sizeof(descr_generic_header)>maxlen) || (evt->descriptor_length<sizeof(struct descr_short_event_header)-sizeof(descr_generic_header))) if((evt->descriptor_length+sizeof(descr_generic_header)>maxlen) || (evt->descriptor_length<sizeof(struct descr_short_event_header)-sizeof(descr_generic_header)))
return; // defekt return; // defekt
#if 0 #if 0
// to be done // to be done
unsigned char Order_number_length; unsigned char Order_number_length;
char Order_number[Order_number_length]; char Order_number[Order_number_length];
unsigned char Order_price_length; unsigned char Order_price_length;
char Order_price[Order_price_length]; char Order_price[Order_price_length];
unsigned char Order_phone_number_length; unsigned char Order_phone_number_length;
char Order_phone_number[Order_phone_number_length]; char Order_phone_number[Order_phone_number_length];
unsigned char SMS_order_information_length; unsigned char SMS_order_information_length;
char SMS_order_information[SMS_order_information_length]; char SMS_order_information[SMS_order_information_length];
unsigned char URL_order_information_length; unsigned char URL_order_information_length;
char URL_order_information[URL_order_information_length]; char URL_order_information[URL_order_information_length];
#endif #endif
} }
void SIsectionPPT::parsePrivateParentalInformationDescriptor(const char *buf, SIevent &e, unsigned maxlen) void SIsectionPPT::parsePrivateParentalInformationDescriptor(const char *buf, SIevent &e, unsigned maxlen)
{ {
struct descr_short_event_header *evt=(struct descr_short_event_header *)buf; struct descr_short_event_header *evt=(struct descr_short_event_header *)buf;
if((evt->descriptor_length+sizeof(descr_generic_header)>maxlen) || (evt->descriptor_length<sizeof(struct descr_short_event_header)-sizeof(descr_generic_header))) if((evt->descriptor_length+sizeof(descr_generic_header)>maxlen) || (evt->descriptor_length<sizeof(struct descr_short_event_header)-sizeof(descr_generic_header)))
return; // defekt return; // defekt
buf+=sizeof(struct descr_generic_header); buf+=sizeof(struct descr_generic_header);
if (sizeof(struct descr_generic_header)+1 < evt->descriptor_length) { if (sizeof(struct descr_generic_header)+1 < evt->descriptor_length) {
e.ratings.insert(SIparentalRating(std::string("", 0), *(buf))); e.ratings.insert(SIparentalRating(std::string("", 0), *(buf)));
} }
#if 0 #if 0
unsigned char rating; unsigned char rating;
unsigned char Controll_time_t1[3]; // BCD coded unsigned char Controll_time_t1[3]; // BCD coded
unsigned char Controll_time_t2[3]; // BCD coded unsigned char Controll_time_t2[3]; // BCD coded
unsigned char Parental_information_length; unsigned char Parental_information_length;
unsigned char Parental_information[Parental_information_length]; unsigned char Parental_information[Parental_information_length];
#endif #endif
} }
@@ -707,7 +710,7 @@ void SIsectionPPT::parsePrivateContentTransmissionDescriptor(const char *buf, SI
tm_buf[0] = *(p); tm_buf[0] = *(p);
tm_buf[1] = *(p+1); tm_buf[1] = *(p+1);
starttime_loop_length = (*(p+2))/3; starttime_loop_length = (*(p+2))/3;
for (i=0;i<starttime_loop_length; i++) { for (i=0; i<starttime_loop_length; i++) {
tm_buf[2] = *(p+3*i+3); tm_buf[2] = *(p+3*i+3);
tm_buf[3] = *(p+3*i+4); tm_buf[3] = *(p+3*i+4);
tm_buf[4] = *(p+3*i+5); tm_buf[4] = *(p+3*i+5);
@@ -788,7 +791,8 @@ void SIsectionPPT::parse(void)
actPos = &buffer[sizeof(SI_section_PPT_header)]; actPos = &buffer[sizeof(SI_section_PPT_header)];
/*while (actPos < &buffer[bufferLength])*/ { /*while (actPos < &buffer[bufferLength])*/
{
SIevent e; SIevent e;
descriptors_loop_length = (((SI_section_PPT_header*)buffer)->descriptor_section_length_hi << 8) | ((SI_section_PPT_header*)buffer)->descriptor_section_length_lo; descriptors_loop_length = (((SI_section_PPT_header*)buffer)->descriptor_section_length_hi << 8) | ((SI_section_PPT_header*)buffer)->descriptor_section_length_lo;
e.eventID = (unsigned short)(content_id()); // ?? e.eventID = (unsigned short)(content_id()); // ??
@@ -804,42 +808,42 @@ void SIsectionPPT::parse(void)
/********************/ /********************/
void SIsectionSDT::parseNVODreferenceDescriptor(const char *buf, SIservice &s) void SIsectionSDT::parseNVODreferenceDescriptor(const char *buf, SIservice &s)
{ {
struct descr_generic_header *hdr=(struct descr_generic_header *)buf; struct descr_generic_header *hdr=(struct descr_generic_header *)buf;
unsigned short *spointer=(unsigned short *)(buf+sizeof(struct descr_generic_header)); unsigned short *spointer=(unsigned short *)(buf+sizeof(struct descr_generic_header));
while((const char *)spointer<=buf+sizeof(struct descr_generic_header)+hdr->descriptor_length-2) { while((const char *)spointer<=buf+sizeof(struct descr_generic_header)+hdr->descriptor_length-2) {
unsigned short transportStreamID=*spointer++; unsigned short transportStreamID=*spointer++;
unsigned short originalNetworkID=*spointer++; unsigned short originalNetworkID=*spointer++;
unsigned short sID=*spointer++; unsigned short sID=*spointer++;
s.nvods.insert(SInvodReference(transportStreamID, originalNetworkID, sID)); s.nvods.insert(SInvodReference(transportStreamID, originalNetworkID, sID));
} }
} }
void SIsectionSDT::parseServiceDescriptor(const char *buf, SIservice &s) void SIsectionSDT::parseServiceDescriptor(const char *buf, SIservice &s)
{ {
bool is_blacklisted; bool is_blacklisted;
struct descr_service_header *sv=(struct descr_service_header *)buf; struct descr_service_header *sv=(struct descr_service_header *)buf;
buf+=sizeof(struct descr_service_header); buf+=sizeof(struct descr_service_header);
s.serviceTyp=sv->service_typ; s.serviceTyp=sv->service_typ;
is_blacklisted = check_blacklisted(s.original_network_id, s.transport_stream_id); is_blacklisted = check_blacklisted(s.original_network_id, s.transport_stream_id);
if(sv->service_provider_name_length) { if(sv->service_provider_name_length) {
//if(*buf < 0x06) // other code table //if(*buf < 0x06) // other code table
// s.providerName=std::string(buf+1, sv->service_provider_name_length-1); // s.providerName=std::string(buf+1, sv->service_provider_name_length-1);
// else // else
// s.providerName=std::string(buf, sv->service_provider_name_length); // s.providerName=std::string(buf, sv->service_provider_name_length);
if ((*buf > 0x05) && (is_blacklisted)) if ((*buf > 0x05) && (is_blacklisted))
s.providerName = CDVBString(("\x05" + std::string((const char *)(buf))).c_str(), sv->service_provider_name_length+1).getContent(); s.providerName = CDVBString(("\x05" + std::string((const char *)(buf))).c_str(), sv->service_provider_name_length+1).getContent();
else else
s.providerName = CDVBString((const char *)(buf), sv->service_provider_name_length).getContent(); s.providerName = CDVBString((const char *)(buf), sv->service_provider_name_length).getContent();
} }
buf+=sv->service_provider_name_length; buf+=sv->service_provider_name_length;
unsigned char servicenamelength=*((unsigned char *)buf); unsigned char servicenamelength=*((unsigned char *)buf);
if(servicenamelength) { if(servicenamelength) {
if ((*buf+1 > 0x05) && (is_blacklisted)) if ((*buf+1 > 0x05) && (is_blacklisted))
s.serviceName = CDVBString(("\x05" + std::string((const char *)(++buf))).c_str(), servicenamelength+1).getContent(); s.serviceName = CDVBString(("\x05" + std::string((const char *)(++buf))).c_str(), servicenamelength+1).getContent();
else else
s.serviceName = CDVBString((const char *)(++buf), servicenamelength).getContent(); s.serviceName = CDVBString((const char *)(++buf), servicenamelength).getContent();
} }
// printf("Provider-Name: %s\n", s.providerName.c_str()); // printf("Provider-Name: %s\n", s.providerName.c_str());
// printf("Service-Name: %s\n", s.serviceName.c_str()); // printf("Service-Name: %s\n", s.serviceName.c_str());
} }
@@ -854,30 +858,30 @@ void SIsectionSDT::parsePrivateDataDescriptor(const char *buf, SIservice &s)
void SIsectionSDT::parseDescriptors(const char *des, unsigned len, SIservice &s) void SIsectionSDT::parseDescriptors(const char *des, unsigned len, SIservice &s)
{ {
struct descr_generic_header *desc; struct descr_generic_header *desc;
des += sizeof(struct sdt_service); des += sizeof(struct sdt_service);
len -= sizeof(struct sdt_service); len -= sizeof(struct sdt_service);
while(len>=sizeof(struct descr_generic_header)) { while(len>=sizeof(struct descr_generic_header)) {
desc=(struct descr_generic_header *)des; desc=(struct descr_generic_header *)des;
// printf("Type: %s\n", decode_descr(desc->descriptor_tag)); // printf("Type: %s\n", decode_descr(desc->descriptor_tag));
// printf("Length: %hhu\n", desc->descriptor_length); // printf("Length: %hhu\n", desc->descriptor_length);
if(desc->descriptor_tag==0x48) { if(desc->descriptor_tag==0x48) {
// printf("Found service descriptor\n"); // printf("Found service descriptor\n");
parseServiceDescriptor((const char *)desc, s); parseServiceDescriptor((const char *)desc, s);
} }
else if(desc->descriptor_tag==0x4b) { else if(desc->descriptor_tag==0x4b) {
// printf("Found NVOD reference descriptor\n"); // printf("Found NVOD reference descriptor\n");
parseNVODreferenceDescriptor((const char *)desc, s); parseNVODreferenceDescriptor((const char *)desc, s);
} }
else if(desc->descriptor_tag==0x5f) { else if(desc->descriptor_tag==0x5f) {
// printf("Found Private Data Specifier\n"); // printf("Found Private Data Specifier\n");
parsePrivateDataDescriptor((const char *)desc, s); parsePrivateDataDescriptor((const char *)desc, s);
} }
// hotfix for ARD crash // hotfix for ARD crash
if ((int) len<desc->descriptor_length+2) break; if ((int) len<desc->descriptor_length+2) break;
len-=desc->descriptor_length+2; len-=desc->descriptor_length+2;
des+=desc->descriptor_length+2; des+=desc->descriptor_length+2;
} }
} }
// Die infos aus dem Puffer holen // Die infos aus dem Puffer holen
@@ -1004,7 +1008,7 @@ void SIsectionBAT::parse(void)
// SIbouquet s((bh->bouquet_id_hi << 8) | bh->bouquet_id_lo); //Create a new Bouquet entry // SIbouquet s((bh->bouquet_id_hi << 8) | bh->bouquet_id_lo); //Create a new Bouquet entry
// printf("ident: %hu actpos: %p buf+bl: %p desclen: %hu\n", bi.bouquet_id, actPos, buffer+bufferLength, descriptors_loop_length); // printf("ident: %hu actpos: %p buf+bl: %p desclen: %hu\n", bi.bouquet_id, actPos, buffer+bufferLength, descriptors_loop_length);
int count = 0; int count = 0;
//Fill out Bouquet Name //Fill out Bouquet Name
//count = parseDescriptors(((const char *)bh) + sizeof(SI_section_BAT_header), descriptors_loop_length, s, bh->section_number, count); //count = parseDescriptors(((const char *)bh) + sizeof(SI_section_BAT_header), descriptors_loop_length, s, bh->section_number, count);
const char *des = ((const char *)bh) + sizeof(SI_section_BAT_header); const char *des = ((const char *)bh) + sizeof(SI_section_BAT_header);
unsigned len = descriptors_loop_length; unsigned len = descriptors_loop_length;
@@ -1021,12 +1025,12 @@ void SIsectionBAT::parse(void)
//struct descr_generic_header *sv=(struct descr_generic_header *)buf; //struct descr_generic_header *sv=(struct descr_generic_header *)buf;
buf+=sizeof(struct descr_generic_header); buf+=sizeof(struct descr_generic_header);
if(desc->descriptor_length) { if(desc->descriptor_length) {
/* /*
if(*buf < 0x06) // other code table if(*buf < 0x06) // other code table
s.bouquetName=std::string(buf+1, sv->descriptor_length-1); s.bouquetName=std::string(buf+1, sv->descriptor_length-1);
else else
s.bouquetName=std::string(buf, sv->descriptor_length); s.bouquetName=std::string(buf, sv->descriptor_length);
*/ */
//Mega stupid providers do not reserve their own bouquet_id //Mega stupid providers do not reserve their own bouquet_id
//So we do it for them... f*ck that's stupid too, but what else can we do... //So we do it for them... f*ck that's stupid too, but what else can we do...
if (bouquet_id == 0x0001) { if (bouquet_id == 0x0001) {
@@ -1046,7 +1050,7 @@ void SIsectionBAT::parse(void)
struct private_data_specifier *pds=(struct private_data_specifier *)buf; struct private_data_specifier *pds=(struct private_data_specifier *)buf;
buf+=sizeof(struct private_data_specifier); buf+=sizeof(struct private_data_specifier);
current_private_data_specifier=(((pds->byte1 << 24) | (pds->byte2 << 16)) | (pds->byte3 << 8)) | pds->byte4; current_private_data_specifier=(((pds->byte1 << 24) | (pds->byte2 << 16)) | (pds->byte3 << 8)) | pds->byte4;
//printf("Private Data Specifier: %08x\n", current_private_data_specifier); //printf("Private Data Specifier: %08x\n", current_private_data_specifier);
} }
len-=desc->descriptor_length+2; len-=desc->descriptor_length+2;
des+=desc->descriptor_length+2; des+=desc->descriptor_length+2;
@@ -1063,35 +1067,35 @@ void SIsectionBAT::parse(void)
if (bouquet_id != 0x0001) { if (bouquet_id != 0x0001) {
while (actPos <= &buffer[bufferLength - sizeof(struct bat_service)]) { while (actPos <= &buffer[bufferLength - sizeof(struct bat_service)]) {
sv = (struct bat_service *)actPos; sv = (struct bat_service *)actPos;
//s.transport_stream_id = (sv->transport_stream_id_hi << 8) | sv->transport_stream_id_lo; //s.transport_stream_id = (sv->transport_stream_id_hi << 8) | sv->transport_stream_id_lo;
//s.original_network_id = (sv->original_network_id_hi << 8) | sv->original_network_id_lo; //s.original_network_id = (sv->original_network_id_hi << 8) | sv->original_network_id_lo;
// s.position = (uint16_t) (((bh->section_number & 0x1f) << 11) + (count & 0x7ff)); // s.position = (uint16_t) (((bh->section_number & 0x1f) << 11) + (count & 0x7ff));
// printf("Section Number: %d Count: %d position: %04x\n", bh->section_number, count, s.position); // printf("Section Number: %d Count: %d position: %04x\n", bh->section_number, count, s.position);
descriptors_length = (sv->descriptors_loop_length_hi << 8) | sv->descriptors_loop_length_lo; descriptors_length = (sv->descriptors_loop_length_hi << 8) | sv->descriptors_loop_length_lo;
// Transport Stream Loop // Transport Stream Loop
//count = parseDescriptors(((const char *)sv) + sizeof(struct bat_service), descriptors_length, s, bh->section_number, count, //count = parseDescriptors(((const char *)sv) + sizeof(struct bat_service), descriptors_length, s, bh->section_number, count,
//(const char *) bouquetName[0]); //(const char *) bouquetName[0]);
bool found = false; bool found = false;
int loop_count = 1; int loop_count = 1;
while (loop_count >= 0) { while (loop_count >= 0) {
const char *des_ = ((const char *)sv) + sizeof(struct bat_service); const char *des_ = ((const char *)sv) + sizeof(struct bat_service);
len = descriptors_length; len = descriptors_length;
while(len>=sizeof(struct descr_generic_header)) { while(len>=sizeof(struct descr_generic_header)) {
desc=(struct descr_generic_header *)des_; desc=(struct descr_generic_header *)des_;
// printf("Type: %s\n", decode_descr(desc->descriptor_tag)); // printf("Type: %s\n", decode_descr(desc->descriptor_tag));
// printf("Length: %hhu\n", desc->descriptor_length); // printf("Length: %hhu\n", desc->descriptor_length);
const char *buf = (const char *) desc; const char *buf = (const char *) desc;
buf+=sizeof(struct descr_generic_header); buf+=sizeof(struct descr_generic_header);
unsigned short dlen = desc->descriptor_length; unsigned short dlen = desc->descriptor_length;
if ((desc->descriptor_tag==0x41) && (loop_count == 0) && (current_private_data_specifier != 0x00000002)) { if ((desc->descriptor_tag==0x41) && (loop_count == 0) && (current_private_data_specifier != 0x00000002)) {
// printf("Found service list descriptor\n"); // printf("Found service list descriptor\n");
//count = parseServiceListDescriptor((const char *)desc, s, section_no, count); //count = parseServiceListDescriptor((const char *)desc, s, section_no, count);
//struct descr_generic_header *sv=(struct descr_generic_header *)buf; //struct descr_generic_header *sv=(struct descr_generic_header *)buf;
while(dlen >= sizeof(struct service_list_entry)) { while(dlen >= sizeof(struct service_list_entry)) {
struct service_list_entry *sl=(struct service_list_entry *)buf; struct service_list_entry *sl=(struct service_list_entry *)buf;
buf+=sizeof(struct service_list_entry); buf+=sizeof(struct service_list_entry);
SIbouquet bs(bouquet_id); SIbouquet bs(bouquet_id);
bs.bouquetName = bouquetName; bs.bouquetName = bouquetName;
@@ -1117,7 +1121,7 @@ void SIsectionBAT::parse(void)
(oe->channel_number_hi << 8) | oe->channel_number_lo); (oe->channel_number_hi << 8) | oe->channel_number_lo);
*/ */
if ( ((sl->service_id_hi << 8) | sl->service_id_lo) == if ( ((sl->service_id_hi << 8) | sl->service_id_lo) ==
((oe->service_id_hi << 8) | oe->service_id_lo)) { ((oe->service_id_hi << 8) | oe->service_id_lo)) {
bs.position = (oe->channel_number_hi << 8) | oe->channel_number_lo; bs.position = (oe->channel_number_hi << 8) | oe->channel_number_lo;
/* /*
printf("Found Search: %04x Service_id: %04x Posi:%04x\n", printf("Found Search: %04x Service_id: %04x Posi:%04x\n",
@@ -1137,7 +1141,7 @@ void SIsectionBAT::parse(void)
bsv.insert(bs); bsv.insert(bs);
dlen -= sizeof(struct service_list_entry); dlen -= sizeof(struct service_list_entry);
count++; count++;
} }
} }
if (desc->descriptor_tag == 0x5f) { if (desc->descriptor_tag == 0x5f) {
struct private_data_specifier *pds=(struct private_data_specifier *)buf; struct private_data_specifier *pds=(struct private_data_specifier *)buf;
@@ -1145,7 +1149,7 @@ void SIsectionBAT::parse(void)
if ((pds->byte1 != 0) || (pds->byte2 != 0) || (pds->byte3 != 0) || (pds->byte4 != 0)) if ((pds->byte1 != 0) || (pds->byte2 != 0) || (pds->byte3 != 0) || (pds->byte4 != 0))
current_private_data_specifier=(((pds->byte1 << 24) | (pds->byte2 << 16)) | current_private_data_specifier=(((pds->byte1 << 24) | (pds->byte2 << 16)) |
(pds->byte3 << 8)) | pds->byte4; (pds->byte3 << 8)) | pds->byte4;
//printf("Private Data Specifier: %08x\n", current_private_data_specifier); //printf("Private Data Specifier: %08x\n", current_private_data_specifier);
} }
if (desc->descriptor_tag == 0x81) { if (desc->descriptor_tag == 0x81) {
if (current_private_data_specifier == 0x55504300) { if (current_private_data_specifier == 0x55504300) {
@@ -1194,9 +1198,9 @@ void SIsectionBAT::parse(void)
SIbouquet bs(bouquet_id); SIbouquet bs(bouquet_id);
bs.bouquetName = bouquetName; bs.bouquetName = bouquetName;
bs.transport_stream_id = (sv->transport_stream_id_hi << 8) | bs.transport_stream_id = (sv->transport_stream_id_hi << 8) |
sv->transport_stream_id_lo; sv->transport_stream_id_lo;
bs.original_network_id = (sv->original_network_id_hi << 8) | bs.original_network_id = (sv->original_network_id_hi << 8) |
sv->original_network_id_lo; sv->original_network_id_lo;
bs.service_id = (oe->service_id_hi << 8) | oe->service_id_lo; bs.service_id = (oe->service_id_hi << 8) | oe->service_id_lo;
bs.serviceTyp = oe->service_type; bs.serviceTyp = oe->service_type;
bs.position = (oe->channel_number_hi << 8) | oe->channel_number_lo; bs.position = (oe->channel_number_hi << 8) | oe->channel_number_lo;
@@ -1207,14 +1211,14 @@ void SIsectionBAT::parse(void)
} }
} }
len-=desc->descriptor_length+2; len-=desc->descriptor_length+2;
des_+=desc->descriptor_length+2; des_+=desc->descriptor_length+2;
} }
loop_count--; loop_count--;
} }
actPos += sizeof(struct bat_service) + descriptors_length; actPos += sizeof(struct bat_service) + descriptors_length;
// count++; // count++;
} }
} }
parsed = 1; parsed = 1;
@@ -1222,10 +1226,10 @@ void SIsectionBAT::parse(void)
void SIsectionNIT::copyDeliveryDescriptor(const char *buf, SInetwork &s) void SIsectionNIT::copyDeliveryDescriptor(const char *buf, SInetwork &s)
{ {
//struct descr_generic_header *sv=(struct descr_generic_header *)buf; //struct descr_generic_header *sv=(struct descr_generic_header *)buf;
buf+=sizeof(struct descr_generic_header); buf+=sizeof(struct descr_generic_header);
memmove(s.delivery_descriptor, buf, sizeof(struct satellite_delivery_descriptor)); //same size as cable... memmove(s.delivery_descriptor, buf, sizeof(struct satellite_delivery_descriptor)); //same size as cable...
//printf("Bouquet-Name: %s\n", s.bouquetName.c_str()); //printf("Bouquet-Name: %s\n", s.bouquetName.c_str());
} }
void SIsectionNIT::parseDescriptors(const char *des, unsigned len, SInetwork &s) void SIsectionNIT::parseDescriptors(const char *des, unsigned len, SInetwork &s)
@@ -1236,28 +1240,28 @@ void SIsectionNIT::parseDescriptors(const char *des, unsigned len, SInetwork &s)
// t_original_network_id onid; // t_original_network_id onid;
// unsigned short orbital_pos; // unsigned short orbital_pos;
struct descr_generic_header *desc; struct descr_generic_header *desc;
des += sizeof(struct nit_transponder); des += sizeof(struct nit_transponder);
len -= sizeof(struct nit_transponder); len -= sizeof(struct nit_transponder);
while(len>=sizeof(struct descr_generic_header)) { while(len>=sizeof(struct descr_generic_header)) {
desc=(struct descr_generic_header *)des; desc=(struct descr_generic_header *)des;
// printf("Type: %s\n", decode_descr(desc->descriptor_tag)); // printf("Type: %s\n", decode_descr(desc->descriptor_tag));
// printf("Length: %hhu\n", desc->descriptor_length); // printf("Length: %hhu\n", desc->descriptor_length);
if ( (desc->descriptor_tag==0x43) || (desc->descriptor_tag==0x44) ) { if ( (desc->descriptor_tag==0x43) || (desc->descriptor_tag==0x44) ) {
s.delivery_type = desc->descriptor_tag; s.delivery_type = desc->descriptor_tag;
// printf("Found satellite_delivery_system_descriptor\n"); // printf("Found satellite_delivery_system_descriptor\n");
copyDeliveryDescriptor((const char *)desc, s); copyDeliveryDescriptor((const char *)desc, s);
// ddp = &s.delivery_descriptor[0]; // ddp = &s.delivery_descriptor[0];
// sdd = (struct satellite_delivery_descriptor *)ddp; // sdd = (struct satellite_delivery_descriptor *)ddp;
// tsid = s.transport_stream_id; // tsid = s.transport_stream_id;
// onid = s.original_network_id; // onid = s.original_network_id;
// orbital_pos = (sdd->orbital_pos_hi << 8) | sdd->orbital_pos_lo; // orbital_pos = (sdd->orbital_pos_hi << 8) | sdd->orbital_pos_lo;
// printf("ONID: %04x TSID: %04x Orbital Position: %d\n", onid, tsid, orbital_pos); // printf("ONID: %04x TSID: %04x Orbital Position: %d\n", onid, tsid, orbital_pos);
} }
len-=desc->descriptor_length+2; len-=desc->descriptor_length+2;
des+=desc->descriptor_length+2; des+=desc->descriptor_length+2;
} }
} }
// Die infos aus dem Puffer holen // Die infos aus dem Puffer holen
@@ -1318,29 +1322,29 @@ void SIsectionNIT::parse(void)
// ansonsten die Anzahl gelesener Bytes // ansonsten die Anzahl gelesener Bytes
inline int readNbytes(int fd, char *buf, int n, unsigned timeoutInSeconds) inline int readNbytes(int fd, char *buf, int n, unsigned timeoutInSeconds)
{ {
int j; int j;
for(j=0; j<n;) { for(j=0; j<n;) {
struct pollfd ufds; struct pollfd ufds;
// memset(&ufds, 0, sizeof(ufds)); // memset(&ufds, 0, sizeof(ufds));
ufds.fd=fd; ufds.fd=fd;
ufds.events=POLLIN|POLLPRI; ufds.events=POLLIN|POLLPRI;
ufds.revents=0; ufds.revents=0;
int rc=poll(&ufds, 1, timeoutInSeconds*1000); int rc=poll(&ufds, 1, timeoutInSeconds*1000);
if(!rc) if(!rc)
return 0; // timeout return 0; // timeout
else if(rc<0) { else if(rc<0) {
perror ("poll"); perror ("poll");
return -1; return -1;
} }
int r=read (fd, buf, n-j); int r=read (fd, buf, n-j);
if(r<=0) { if(r<=0) {
perror ("read"); perror ("read");
return -1; return -1;
} }
j+=r; j+=r;
buf+=r; buf+=r;
} }
return j; return j;
} }
// //

View File

@@ -209,10 +209,10 @@ time_t changeUTCtoCtime(const unsigned char *buffer, int local_time)
#if 0 #if 0
printf ("Startzeit: GMT: %.2d.%.2d.%.4d %.2x:%.2x:%.2x\n", printf ("Startzeit: GMT: %.2d.%.2d.%.4d %.2x:%.2x:%.2x\n",
day, month, year, hour, minutes, seconds); day, month, year, hour, minutes, seconds);
printf ("Startzeit: GMT: %.2d.%.2d.%.4d %.2d:%.2d:%.2d\n", printf ("Startzeit: GMT: %.2d.%.2d.%.4d %.2d:%.2d:%.2d\n",
time.tm_mday, time.tm_mon + 1, time.tm_year + 1900, time.tm_mday, time.tm_mon + 1, time.tm_year + 1900,
time.tm_hour, time.tm_min, time.tm_sec); time.tm_hour, time.tm_min, time.tm_sec);
#endif #endif
return mktime(&time) + (local_time ? -timezone : 0); return mktime(&time) + (local_time ? -timezone : 0);
@@ -221,80 +221,80 @@ time_t changeUTCtoCtime(const unsigned char *buffer, int local_time)
// Thanks to tmbinc // Thanks to tmbinc
int saveStringToXMLfile(FILE *out, const char *c, int /*withControlCodes*/) int saveStringToXMLfile(FILE *out, const char *c, int /*withControlCodes*/)
{ {
if(!c) if(!c)
return 1; return 1;
// Die Umlaute sind ISO-8859-9 [5] // Die Umlaute sind ISO-8859-9 [5]
/* /*
char buf[6000]; char buf[6000];
int inlen=strlen(c); int inlen=strlen(c);
int outlen=sizeof(buf); int outlen=sizeof(buf);
// UTF8Toisolat1((unsigned char *)buf, &outlen, (const unsigned char *)c, &inlen); // UTF8Toisolat1((unsigned char *)buf, &outlen, (const unsigned char *)c, &inlen);
isolat1ToUTF8((unsigned char *)buf, &outlen, (const unsigned char *)c, &inlen); isolat1ToUTF8((unsigned char *)buf, &outlen, (const unsigned char *)c, &inlen);
buf[outlen]=0; buf[outlen]=0;
c=buf; c=buf;
*/ */
for(;*c; c++) { for(; *c; c++) {
switch ((unsigned char)*c) { switch ((unsigned char)*c) {
case '<': case '<':
fprintf(out, "&lt;"); fprintf(out, "&lt;");
break; break;
case '>': case '>':
fprintf(out, "&gt;"); fprintf(out, "&gt;");
break; break;
case '&': case '&':
fprintf(out, "&amp;"); fprintf(out, "&amp;");
break; break;
case '\"': case '\"':
fprintf(out, "&quot;"); fprintf(out, "&quot;");
break; break;
case '\'': case '\'':
fprintf(out, "&apos;"); fprintf(out, "&apos;");
break; break;
#if 0 #if 0
case 0x81: case 0x81:
case 0x82: case 0x82:
break; break;
case 0x86: case 0x86:
if(withControlCodes) if(withControlCodes)
fprintf(out, "<b>"); fprintf(out, "<b>");
break; break;
case 0x87: case 0x87:
if(withControlCodes) if(withControlCodes)
fprintf(out, "</b>"); fprintf(out, "</b>");
break; break;
case 0x8a: case 0x8a:
if(withControlCodes) if(withControlCodes)
fprintf(out, "<br/>"); fprintf(out, "<br/>");
break; break;
default: default:
if (*c<32) if (*c<32)
break; break;
if ((*c>=32) && (((unsigned char)*c)<128)) if ((*c>=32) && (((unsigned char)*c)<128))
fprintf(out, "%c", *c); fprintf(out, "%c", *c);
else else
fprintf(out, "&#%d;", *c); fprintf(out, "&#%d;", *c);
#else #else
default: default:
if ((unsigned char)*c<32) if ((unsigned char)*c<32)
break; break;
fprintf(out, "%c", *c); fprintf(out, "%c", *c);
#endif #endif
} // case } // case
} // for } // for
return 0; return 0;
} }
// Entfernt die ControlCodes aus dem String (-> String wird evtl. kuerzer) // Entfernt die ControlCodes aus dem String (-> String wird evtl. kuerzer)
void removeControlCodes(char *string) void removeControlCodes(char *string)
{ {
if(!string) if(!string)
return; return;
for(;*string; ) for(; *string; )
if (!((*string>=32) && (((unsigned char)*string)<128))) if (!((*string>=32) && (((unsigned char)*string)<128)))
memmove(string, string+1, strlen(string+1)+1); memmove(string, string+1, strlen(string+1)+1);
else else
string++; string++;
return ; return ;
} }

View File

@@ -61,16 +61,16 @@
int main(int /*argc*/, char** /*argv*/) int main(int /*argc*/, char** /*argv*/)
{ {
time_t starttime, endtime; time_t starttime, endtime;
SIsectionsBAT batset; SIsectionsBAT batset;
starttime=time(NULL); starttime=time(NULL);
batset.readSections(); batset.readSections();
endtime=time(NULL); endtime=time(NULL);
printf("Sections read: %d\n", batset.size()); printf("Sections read: %d\n", batset.size());
printf("Time needed: %ds\n", (int)difftime(endtime, starttime)); printf("Time needed: %ds\n", (int)difftime(endtime, starttime));
// for_each(batset.begin(), batset.end(), printSmallSectionHeader()); // for_each(batset.begin(), batset.end(), printSmallSectionHeader());
// for_each(batset.begin(), batset.end(), printSIsection()); // for_each(batset.begin(), batset.end(), printSIsection());
for_each(batset.begin(), batset.end(), printSIsectionBAT()); for_each(batset.begin(), batset.end(), printSIsectionBAT());
return 0; return 0;
} }

View File

@@ -100,9 +100,9 @@ ssize_t DMX::read(char * const /*buf*/, const size_t /*buflength*/, const unsign
void DMX::close(void) void DMX::close(void)
{ {
if(dmx) if(dmx)
delete dmx; delete dmx;
dmx = NULL; dmx = NULL;
} }
void DMX::closefd(void) void DMX::closefd(void)
@@ -157,8 +157,10 @@ void DMX::lock(void)
int rc = pthread_mutex_lock(&start_stop_mutex); int rc = pthread_mutex_lock(&start_stop_mutex);
if (rc != 0) if (rc != 0)
{ {
fprintf(stderr, "[sectionsd] mutex_lock: %d %d %d\n", rc, EINVAL, EDEADLK); fflush(stderr); fprintf(stderr, "[sectionsd] mutex_lock: %d %d %d\n", rc, EINVAL, EDEADLK);
fprintf(stderr, "[sectionsd] pid: %d\n", getpid()); fflush(stderr); fflush(stderr);
fprintf(stderr, "[sectionsd] pid: %d\n", getpid());
fflush(stderr);
} }
#else #else
pthread_mutex_lock(&start_stop_mutex); pthread_mutex_lock(&start_stop_mutex);
@@ -172,8 +174,10 @@ void DMX::unlock(void)
int rc = pthread_mutex_unlock(&start_stop_mutex); int rc = pthread_mutex_unlock(&start_stop_mutex);
if (rc != 0) if (rc != 0)
{ {
fprintf(stderr, "[sectionsd] mutex_unlock: %d %d %d\n", rc, EINVAL, EPERM); fflush(stderr); fprintf(stderr, "[sectionsd] mutex_unlock: %d %d %d\n", rc, EINVAL, EPERM);
fprintf(stderr, "[sectionsd] pid: %d\n", getpid()); fflush(stderr); fflush(stderr);
fprintf(stderr, "[sectionsd] pid: %d\n", getpid());
fflush(stderr);
} }
#else #else
pthread_mutex_unlock(&start_stop_mutex); pthread_mutex_unlock(&start_stop_mutex);
@@ -198,20 +202,20 @@ bool DMX::check_complete(const unsigned char table_id, const unsigned short exte
if (last == 0) if (last == 0)
return true; return true;
MyDMXOrderUniqueKey::iterator di = myDMXOrderUniqueKey.find(create_sections_id( MyDMXOrderUniqueKey::iterator di = myDMXOrderUniqueKey.find(create_sections_id(
table_id, table_id,
extension_id, extension_id,
current_section_number, current_section_number,
onid, onid,
tsid)); tsid));
if (di != myDMXOrderUniqueKey.end()) { if (di != myDMXOrderUniqueKey.end()) {
di++; di++;
} }
while ((di != myDMXOrderUniqueKey.end()) && ((uint8_t) ((di->first >> 56) & 0xff) == table_id) && while ((di != myDMXOrderUniqueKey.end()) && ((uint8_t) ((di->first >> 56) & 0xff) == table_id) &&
((uint16_t) ((di->first >> 40) & 0xffff) == extension_id) && ((uint16_t) ((di->first >> 40) & 0xffff) == extension_id) &&
(((uint8_t) ((di->first >> 32) & 0xff) == current_section_number + 1) || (((uint8_t) ((di->first >> 32) & 0xff) == current_section_number + 1) ||
((uint8_t) ((di->first >> 32) & 0xff) == current_section_number + 8)) && ((uint8_t) ((di->first >> 32) & 0xff) == current_section_number + 8)) &&
((uint16_t) ((di->first >> 16) & 0xffff) == onid) && ((uint16_t) ((di->first >> 16) & 0xffff) == onid) &&
((uint16_t) (di->first & 0xffff) == tsid)) ((uint16_t) (di->first & 0xffff) == tsid))
{ {
if ((uint8_t) ((di->first >> 32) & 0xff) == last) { if ((uint8_t) ((di->first >> 32) & 0xff) == last) {
return true; return true;
@@ -343,7 +347,7 @@ int DMX::getSection(char *buf, const unsigned timeoutInMSeconds, int &timeouts)
unlock(); unlock();
// skip sections which are too short // skip sections which are too short
if ((section_length < 5) || if ((section_length < 5) ||
(initial_header->table_id >= 0x4e && initial_header->table_id <= 0x6f && section_length < 14)) (initial_header->table_id >= 0x4e && initial_header->table_id <= 0x6f && section_length < 14))
{ {
dprintf("section too short: table %x, length: %d\n", initial_header->table_id, section_length); dprintf("section too short: table %x, length: %d\n", initial_header->table_id, section_length);
return -1; return -1;
@@ -376,8 +380,8 @@ int DMX::getSection(char *buf, const unsigned timeoutInMSeconds, int &timeouts)
if (!cache) if (!cache)
{ {
if (initial_header->table_id == 0x4e && if (initial_header->table_id == 0x4e &&
eh_tbl_extension_id == current_service && eh_tbl_extension_id == current_service &&
extended_header->version_number != eit_version) { extended_header->version_number != eit_version) {
dprintf("EIT old: %d new version: %d\n",eit_version,extended_header->version_number); dprintf("EIT old: %d new version: %d\n",eit_version,extended_header->version_number);
eit_version = extended_header->version_number; eit_version = extended_header->version_number;
} }
@@ -398,9 +402,9 @@ int DMX::getSection(char *buf, const unsigned timeoutInMSeconds, int &timeouts)
if (di->second == extended_header->version_number) { if (di->second == extended_header->version_number) {
#ifdef DEBUG_CACHED_SECTIONS #ifdef DEBUG_CACHED_SECTIONS
dprintf("[sectionsd] skipped duplicate section for table 0x%02x table_extension 0x%04x section 0x%02x\n", dprintf("[sectionsd] skipped duplicate section for table 0x%02x table_extension 0x%04x section 0x%02x\n",
initial_header->table_id, initial_header->table_id,
eh_tbl_extension_id, eh_tbl_extension_id,
extended_header->section_number); extended_header->section_number);
#endif #endif
//the version number is still up2date //the version number is still up2date
if (first_skipped == 0) { if (first_skipped == 0) {
@@ -415,21 +419,21 @@ int DMX::getSection(char *buf, const unsigned timeoutInMSeconds, int &timeouts)
} }
//since version is still up2date, check if table complete //since version is still up2date, check if table complete
if (check_complete(initial_header->table_id, if (check_complete(initial_header->table_id,
eh_tbl_extension_id, eh_tbl_extension_id,
current_onid, current_onid,
current_tsid, current_tsid,
extended_header->last_section_number)) extended_header->last_section_number))
timeouts = -2; timeouts = -2;
return -1; return -1;
} }
else { else {
#ifdef DEBUG_CACHED_SECTIONS #ifdef DEBUG_CACHED_SECTIONS
dprintf("[sectionsd] version update from 0x%02x to 0x%02x for table 0x%02x table_extension 0x%04x section 0x%02x\n", dprintf("[sectionsd] version update from 0x%02x to 0x%02x for table 0x%02x table_extension 0x%04x section 0x%02x\n",
di->second, di->second,
extended_header->version_number, extended_header->version_number,
initial_header->table_id, initial_header->table_id,
eh_tbl_extension_id, eh_tbl_extension_id,
extended_header->section_number); extended_header->section_number);
#endif #endif
//update version number //update version number
di->second = extended_header->version_number; di->second = extended_header->version_number;
@@ -438,19 +442,19 @@ int DMX::getSection(char *buf, const unsigned timeoutInMSeconds, int &timeouts)
else else
{ {
#ifdef DEBUG_CACHED_SECTIONS #ifdef DEBUG_CACHED_SECTIONS
dprintf("[sectionsd] new section for table 0x%02x table_extension 0x%04x section 0x%02x\n", dprintf("[sectionsd] new section for table 0x%02x table_extension 0x%04x section 0x%02x\n",
initial_header->table_id, initial_header->table_id,
eh_tbl_extension_id, eh_tbl_extension_id,
extended_header->section_number); extended_header->section_number);
#endif #endif
//section was not read before - insert in list //section was not read before - insert in list
myDMXOrderUniqueKey.insert(std::make_pair(s_id, extended_header->version_number)); myDMXOrderUniqueKey.insert(std::make_pair(s_id, extended_header->version_number));
//check if table is now complete //check if table is now complete
if (check_complete(initial_header->table_id, if (check_complete(initial_header->table_id,
eh_tbl_extension_id, eh_tbl_extension_id,
current_onid, current_onid,
current_tsid, current_tsid,
extended_header->last_section_number)) extended_header->last_section_number))
timeouts = -2; timeouts = -2;
} }
//if control comes to here the sections skipped counter must be restarted //if control comes to here the sections skipped counter must be restarted
@@ -465,7 +469,7 @@ int DMX::immediate_start(void)
{ {
if (isOpen()) if (isOpen())
{ {
xprintf(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>DMX::imediate_start: isOpen()<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"); xprintf(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>DMX::imediate_start: isOpen()<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
closefd(); closefd();
} }
@@ -487,12 +491,12 @@ xprintf(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>DMX::imediate_start: isOpen()<<<<<<<<<<<<
return 3; return 3;
} }
#endif #endif
if(dmx == NULL) { if(dmx == NULL) {
dmx = new cDemux(dmx_num); dmx = new cDemux(dmx_num);
#if !HAVE_TRIPLEDRAGON #if !HAVE_TRIPLEDRAGON
dmx->Open(DMX_PSI_CHANNEL, NULL, dmxBufferSizeInKB*1024UL); dmx->Open(DMX_PSI_CHANNEL, NULL, dmxBufferSizeInKB*1024UL);
#endif #endif
} }
#if HAVE_TRIPLEDRAGON #if HAVE_TRIPLEDRAGON
dmx->Open(DMX_PSI_CHANNEL, NULL, dmxBufferSizeInKB*1024UL); dmx->Open(DMX_PSI_CHANNEL, NULL, dmxBufferSizeInKB*1024UL);
#endif #endif
@@ -501,20 +505,20 @@ xprintf(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>DMX::imediate_start: isOpen()<<<<<<<<<<<<
/* setfilter() only if this is no dummy filter... */ /* setfilter() only if this is no dummy filter... */
#if 0 #if 0
if (filters[filter_index].filter && filters[filter_index].mask && if (filters[filter_index].filter && filters[filter_index].mask &&
!setfilter(fd, pID, filters[filter_index].filter, filters[filter_index].mask, DMX_IMMEDIATE_START | DMX_CHECK_CRC)) !setfilter(fd, pID, filters[filter_index].filter, filters[filter_index].mask, DMX_IMMEDIATE_START | DMX_CHECK_CRC))
#endif #endif
if (filters[filter_index].filter && filters[filter_index].mask) if (filters[filter_index].filter && filters[filter_index].mask)
{ {
unsigned char filter[DMX_FILTER_SIZE]; unsigned char filter[DMX_FILTER_SIZE];
unsigned char mask[DMX_FILTER_SIZE]; unsigned char mask[DMX_FILTER_SIZE];
filter[0] = filters[filter_index].filter; filter[0] = filters[filter_index].filter;
mask[0] = filters[filter_index].mask; mask[0] = filters[filter_index].mask;
dmx->sectionFilter(pID, filter, mask, 1); dmx->sectionFilter(pID, filter, mask, 1);
//FIXME error check //FIXME error check
//closefd(); //closefd();
//return 4; //return 4;
} }
/* this is for dmxCN only... */ /* this is for dmxCN only... */
eit_version = 0xff; eit_version = 0xff;
return 0; return 0;
@@ -628,18 +632,18 @@ int DMX::unpause(void)
#endif #endif
const char *dmx_filter_types [] = { const char *dmx_filter_types [] = {
"dummy filter", "dummy filter",
"actual transport stream, scheduled", "actual transport stream, scheduled",
"other transport stream, now/next", "other transport stream, now/next",
"other transport stream, scheduled 1", "other transport stream, scheduled 1",
"other transport stream, scheduled 2" "other transport stream, scheduled 2"
}; };
int DMX::change(const int new_filter_index, const int new_current_service) int DMX::change(const int new_filter_index, const int new_current_service)
{ {
if (sections_debug) if (sections_debug)
showProfiling("changeDMX: before pthread_mutex_lock(&start_stop_mutex)"); showProfiling("changeDMX: before pthread_mutex_lock(&start_stop_mutex)");
lock(); lock();
if (sections_debug) if (sections_debug)
showProfiling("changeDMX: after pthread_mutex_lock(&start_stop_mutex)"); showProfiling("changeDMX: after pthread_mutex_lock(&start_stop_mutex)");
@@ -648,9 +652,9 @@ int DMX::change(const int new_filter_index, const int new_current_service)
first_skipped = 0; first_skipped = 0;
#if 0 #if 0
/* i have to think about this. This #if 0 now makes .change() automatically unpause the /* i have to think about this. This #if 0 now makes .change() automatically unpause the
* demux. No idea if there are negative side effects - we will find out :) -- seife * demux. No idea if there are negative side effects - we will find out :) -- seife
*/ */
if (!isOpen()) if (!isOpen())
{ {
pthread_cond_signal(&change_cond); pthread_cond_signal(&change_cond);
@@ -665,7 +669,7 @@ int DMX::change(const int new_filter_index, const int new_current_service)
if (real_pauseCounter > 0) if (real_pauseCounter > 0)
{ {
printf("changeDMX: for 0x%x not ignored! even though real_pauseCounter> 0 (%d)\n", printf("changeDMX: for 0x%x not ignored! even though real_pauseCounter> 0 (%d)\n",
filters[new_filter_index].filter, real_pauseCounter); filters[new_filter_index].filter, real_pauseCounter);
/* immediate_start() checks for real_pauseCounter again (and /* immediate_start() checks for real_pauseCounter again (and
does nothing in that case), so we can just continue here. */ does nothing in that case), so we can just continue here. */
} }
@@ -698,7 +702,7 @@ int DMX::change(const int new_filter_index, const int new_current_service)
if (sections_debug) if (sections_debug)
showProfiling("after DMX_SET_FILTER"); showProfiling("after DMX_SET_FILTER");
pthread_cond_signal(&change_cond); pthread_cond_signal(&change_cond);
lastChanged = time_monotonic(); lastChanged = time_monotonic();
@@ -734,8 +738,8 @@ ssize_t DMX::readNbytes(int _fd, char *buf, const size_t n, unsigned timeoutInMS
{ {
printdate_ms(stderr); printdate_ms(stderr);
fprintf(stderr, "[sectionsd] DMX::readNbytes received POLLERR, pid 0x%x, filter[%d] " fprintf(stderr, "[sectionsd] DMX::readNbytes received POLLERR, pid 0x%x, filter[%d] "
"filter 0x%02x mask 0x%02x\n", pID, filter_index, "filter 0x%02x mask 0x%02x\n", pID, filter_index,
filters[filter_index].filter, filters[filter_index].mask); filters[filter_index].filter, filters[filter_index].mask);
return -1; return -1;
} }
if (!(ufds.revents&POLLIN)) if (!(ufds.revents&POLLIN))
@@ -764,7 +768,7 @@ ssize_t DMX::readNbytes(int _fd, char *buf, const size_t n, unsigned timeoutInMS
int DMX::setPid(const unsigned short new_pid) int DMX::setPid(const unsigned short new_pid)
{ {
lock(); lock();
if (!isOpen()) if (!isOpen())
{ {
@@ -790,7 +794,7 @@ int DMX::setPid(const unsigned short new_pid)
return rc; return rc;
} }
pthread_cond_signal(&change_cond); pthread_cond_signal(&change_cond);
lastChanged = time_monotonic(); lastChanged = time_monotonic();
@@ -806,12 +810,12 @@ int DMX::setCurrentService(int new_current_service)
int DMX::dropCachedSectionIDs() int DMX::dropCachedSectionIDs()
{ {
lock(); lock();
/* i think that those checks are wrong for dropCachedSectionIDs(), since /* i think that those checks are wrong for dropCachedSectionIDs(), since
this is called from the housekeeping thread while sectionsd might be this is called from the housekeeping thread while sectionsd might be
idle waiting for the EIT update filter to trigger -- seife idle waiting for the EIT update filter to trigger -- seife
*/ */
#if 0 #if 0
if (!isOpen()) if (!isOpen())
{ {
@@ -840,7 +844,7 @@ int DMX::dropCachedSectionIDs()
} }
#endif #endif
pthread_cond_signal(&change_cond); pthread_cond_signal(&change_cond);
unlock(); unlock();

View File

@@ -41,7 +41,7 @@ typedef unsigned char version_number_t;
class DMX class DMX
{ {
private: private:
int fd; int fd;
cDemux * dmx; cDemux * dmx;
@@ -54,15 +54,17 @@ class DMX
unsigned char eit_version; unsigned char eit_version;
bool cache; /* should read sections be cached? true for all but dmxCN */ bool cache; /* should read sections be cached? true for all but dmxCN */
inline bool isOpen(void) { return (fd != -1); } inline bool isOpen(void) {
return (fd != -1);
}
int immediate_start(void); /* mutex must be locked before and unlocked after this method */ int immediate_start(void); /* mutex must be locked before and unlocked after this method */
int immediate_stop(void); /* mutex must be locked before and unlocked after this method */ int immediate_stop(void); /* mutex must be locked before and unlocked after this method */
bool check_complete(const unsigned char table_id, const unsigned short extension_id, const unsigned short onid, const unsigned short tsid, const unsigned char); bool check_complete(const unsigned char table_id, const unsigned short extension_id, const unsigned short onid, const unsigned short tsid, const unsigned char);
sections_id_t create_sections_id(const unsigned char table_id, const unsigned short extension_id, const unsigned char section_number, const unsigned short onid, const unsigned short tsid); sections_id_t create_sections_id(const unsigned char table_id, const unsigned short extension_id, const unsigned char section_number, const unsigned short onid, const unsigned short tsid);
ssize_t readNbytes(int fd, char * buf, const size_t n, unsigned timeoutInMSeconds); ssize_t readNbytes(int fd, char * buf, const size_t n, unsigned timeoutInMSeconds);
public: public:
struct s_filters struct s_filters
{ {
unsigned char filter; unsigned char filter;

View File

@@ -89,7 +89,7 @@ struct SI_section_TDT_header
unsigned char reserved_future_use : 1; unsigned char reserved_future_use : 1;
unsigned char reserved1 : 2; unsigned char reserved1 : 2;
unsigned short section_length : 12; unsigned short section_length : 12;
/* uint64_t UTC_time : 40;*/ /* uint64_t UTC_time : 40;*/
UTC_t UTC_time; UTC_t UTC_time;
} }
__attribute__ ((packed)); /* 8 bytes */ __attribute__ ((packed)); /* 8 bytes */
@@ -156,7 +156,7 @@ bool getUTC(UTC_t * const UTC, const bool TDT)
if ((cUTC[2] > 0x23) || (cUTC[3] > 0x59) || (cUTC[4] > 0x59)) // no valid time if ((cUTC[2] > 0x23) || (cUTC[3] > 0x59) || (cUTC[4] > 0x59)) // no valid time
{ {
printf("[sectionsd] getUTC: invalid %s section received: %02x %02x %02x %02x %02x\n", printf("[sectionsd] getUTC: invalid %s section received: %02x %02x %02x %02x %02x\n",
TDT ? "TDT" : "TOT", cUTC[0], cUTC[1], cUTC[2], cUTC[3], cUTC[4]); TDT ? "TDT" : "TOT", cUTC[0], cUTC[1], cUTC[2], cUTC[3], cUTC[4]);
ret = false; ret = false;
} }

View File

@@ -38,119 +38,133 @@ int readEncodingFile()
return -1; return -1;
} }
// 8859-x to ucs-16 coding tables. taken from www.unicode.org/Public/MAPPINGS/ISO8859/ // 8859-x to ucs-16 coding tables. taken from www.unicode.org/Public/MAPPINGS/ISO8859/
static unsigned long c88592[96]={ static unsigned long c88592[96]= {
0x00A0, 0x0104, 0x02D8, 0x0141, 0x00A4, 0x013D, 0x015A, 0x00A7, 0x00A8, 0x0160, 0x015E, 0x0164, 0x0179, 0x00AD, 0x017D, 0x017B, 0x00A0, 0x0104, 0x02D8, 0x0141, 0x00A4, 0x013D, 0x015A, 0x00A7, 0x00A8, 0x0160, 0x015E, 0x0164, 0x0179, 0x00AD, 0x017D, 0x017B,
0x00B0, 0x0105, 0x02DB, 0x0142, 0x00B4, 0x013E, 0x015B, 0x02C7, 0x00B8, 0x0161, 0x015F, 0x0165, 0x017A, 0x02DD, 0x017E, 0x017C, 0x00B0, 0x0105, 0x02DB, 0x0142, 0x00B4, 0x013E, 0x015B, 0x02C7, 0x00B8, 0x0161, 0x015F, 0x0165, 0x017A, 0x02DD, 0x017E, 0x017C,
0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7, 0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E, 0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7, 0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E,
0x0110, 0x0143, 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7, 0x0158, 0x016E, 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF, 0x0110, 0x0143, 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7, 0x0158, 0x016E, 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF,
0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7, 0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F, 0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7, 0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F,
0x0111, 0x0144, 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7, 0x0142, /*0x0159,*/ 0x016F, 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9}; 0x0111, 0x0144, 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7, 0x0142, /*0x0159,*/ 0x016F, 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9
};
static unsigned long c88593[96]={
0x00A0, 0x0126, 0x02D8, 0x00A3, 0x00A4, 0x0000, 0x0124, 0x00A7, 0x00A8, 0x0130, 0x015E, 0x011E, 0x0134, 0x00AD, 0x0000, 0x017B,
0x00B0, 0x0127, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x0125, 0x00B7, 0x00B8, 0x0131, 0x015F, 0x011F, 0x0135, 0x00BD, 0x0000, 0x017C,
0x00C0, 0x00C1, 0x00C2, 0x0000, 0x00C4, 0x010A, 0x0108, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
0x0000, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x0120, 0x00D6, 0x00D7, 0x011C, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x016C, 0x015C, 0x00DF,
0x00E0, 0x00E1, 0x00E2, 0x0000, 0x00E4, 0x010B, 0x0109, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
0x0000, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x0121, 0x00F6, 0x00F7, 0x011D, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x016D, 0x015D, 0x02D9};
static unsigned long c88594[96]={ static unsigned long c88593[96]= {
0x00A0, 0x0104, 0x0138, 0x0156, 0x00A4, 0x0128, 0x013B, 0x00A7, 0x00A8, 0x0160, 0x0112, 0x0122, 0x0166, 0x00AD, 0x017D, 0x00AF, 0x00A0, 0x0126, 0x02D8, 0x00A3, 0x00A4, 0x0000, 0x0124, 0x00A7, 0x00A8, 0x0130, 0x015E, 0x011E, 0x0134, 0x00AD, 0x0000, 0x017B,
0x00B0, 0x0105, 0x02DB, 0x0157, 0x00B4, 0x0129, 0x013C, 0x02C7, 0x00B8, 0x0161, 0x0113, 0x0123, 0x0167, 0x014A, 0x017E, 0x014B, 0x00B0, 0x0127, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x0125, 0x00B7, 0x00B8, 0x0131, 0x015F, 0x011F, 0x0135, 0x00BD, 0x0000, 0x017C,
0x0100, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x012E, 0x010C, 0x00C9, 0x0118, 0x00CB, 0x0116, 0x00CD, 0x00CE, 0x012A, 0x00C0, 0x00C1, 0x00C2, 0x0000, 0x00C4, 0x010A, 0x0108, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
0x0110, 0x0145, 0x014C, 0x0136, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x0172, 0x00DA, 0x00DB, 0x00DC, 0x0168, 0x016A, 0x00DF, 0x0000, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x0120, 0x00D6, 0x00D7, 0x011C, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x016C, 0x015C, 0x00DF,
0x0101, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x012F, 0x010D, 0x00E9, 0x0119, 0x00EB, 0x0117, 0x00ED, 0x00EE, 0x012B, 0x00E0, 0x00E1, 0x00E2, 0x0000, 0x00E4, 0x010B, 0x0109, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
0x0111, 0x0146, 0x014D, 0x0137, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x0173, 0x00FA, 0x00FB, 0x00FC, 0x0169, 0x016B, 0x02D9}; 0x0000, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x0121, 0x00F6, 0x00F7, 0x011D, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x016D, 0x015D, 0x02D9
};
static unsigned long c88595[96]={ static unsigned long c88594[96]= {
0x00A0, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, 0x0408, 0x0409, 0x040A, 0x040B, 0x040C, 0x00AD, 0x040E, 0x040F, 0x00A0, 0x0104, 0x0138, 0x0156, 0x00A4, 0x0128, 0x013B, 0x00A7, 0x00A8, 0x0160, 0x0112, 0x0122, 0x0166, 0x00AD, 0x017D, 0x00AF,
0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F, 0x00B0, 0x0105, 0x02DB, 0x0157, 0x00B4, 0x0129, 0x013C, 0x02C7, 0x00B8, 0x0161, 0x0113, 0x0123, 0x0167, 0x014A, 0x017E, 0x014B,
0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F, 0x0100, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x012E, 0x010C, 0x00C9, 0x0118, 0x00CB, 0x0116, 0x00CD, 0x00CE, 0x012A,
0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, 0x0110, 0x0145, 0x014C, 0x0136, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x0172, 0x00DA, 0x00DB, 0x00DC, 0x0168, 0x016A, 0x00DF,
0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, 0x0101, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x012F, 0x010D, 0x00E9, 0x0119, 0x00EB, 0x0117, 0x00ED, 0x00EE, 0x012B,
0x2116, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, 0x0458, 0x0459, 0x045A, 0x045B, 0x045C, 0x00A7, 0x045E, 0x045F}; 0x0111, 0x0146, 0x014D, 0x0137, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x0173, 0x00FA, 0x00FB, 0x00FC, 0x0169, 0x016B, 0x02D9
};
static unsigned long c88596[96]={
0x00A0, 0x0000, 0x0000, 0x0000, 0x00A4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x060C, 0x00AD, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x061B, 0x0000, 0x0000, 0x0000, 0x061F,
0x0000, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, 0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F,
0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637, 0x0638, 0x0639, 0x063A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647, 0x0648, 0x0649, 0x064A, 0x064B, 0x064C, 0x064D, 0x064E, 0x064F,
0x0650, 0x0651, 0x0652, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000};
static unsigned long c88597[96]={
0x00A0, 0x2018, 0x2019, 0x00A3, 0x20AC, 0x20AF, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x037A, 0x00AB, 0x00AC, 0x00AD, 0x0000, 0x2015,
0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x0385, 0x0386, 0x00B7, 0x0388, 0x0389, 0x038A, 0x00BB, 0x038C, 0x00BD, 0x038E, 0x038F,
0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F,
0x03A0, 0x03A1, 0x0000, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x03AC, 0x03AD, 0x03AE, 0x03AF,
0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF,
0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x0000};
static unsigned long c88598[96]={ static unsigned long c88595[96]= {
0x00A0, 0x0000, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00D7, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, 0x00A0, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, 0x0408, 0x0409, 0x040A, 0x040B, 0x040C, 0x00AD, 0x040E, 0x040F,
0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00F7, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x0000, 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2017, 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F,
0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7, 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF, 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F,
0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7, 0x05E8, 0x05E9, 0x05EA, 0x0000, 0x0000, 0x200E, 0x200F, 0x0000}; 0x2116, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, 0x0458, 0x0459, 0x045A, 0x045B, 0x045C, 0x00A7, 0x045E, 0x045F
};
static unsigned long c88599[96]={ static unsigned long c88596[96]= {
0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, 0x00A0, 0x0000, 0x0000, 0x0000, 0x00A4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x060C, 0x00AD, 0x0000, 0x0000,
0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x061B, 0x0000, 0x0000, 0x0000, 0x061F,
0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x0000, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, 0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F,
0x011E, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x0130, 0x015E, 0x00DF, 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637, 0x0638, 0x0639, 0x063A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647, 0x0648, 0x0649, 0x064A, 0x064B, 0x064C, 0x064D, 0x064E, 0x064F,
0x011F, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x0131, 0x015F, 0x00FF}; 0x0650, 0x0651, 0x0652, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
};
static unsigned long c885910[96]={ static unsigned long c88597[96]= {
0x00A0, 0x0104, 0x0112, 0x0122, 0x012A, 0x0128, 0x0136, 0x00A7, 0x013B, 0x0110, 0x0160, 0x0166, 0x017D, 0x00AD, 0x016A, 0x014A, 0x00A0, 0x2018, 0x2019, 0x00A3, 0x20AC, 0x20AF, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x037A, 0x00AB, 0x00AC, 0x00AD, 0x0000, 0x2015,
0x00B0, 0x0105, 0x0113, 0x0123, 0x012B, 0x0129, 0x0137, 0x00B7, 0x013C, 0x0111, 0x0161, 0x0167, 0x017E, 0x2015, 0x016B, 0x014B, 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x0385, 0x0386, 0x00B7, 0x0388, 0x0389, 0x038A, 0x00BB, 0x038C, 0x00BD, 0x038E, 0x038F,
0x0100, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x012E, 0x010C, 0x00C9, 0x0118, 0x00CB, 0x0116, 0x00CD, 0x00CE, 0x00CF, 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F,
0x00D0, 0x0145, 0x014C, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x0168, 0x00D8, 0x0172, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, 0x03A0, 0x03A1, 0x0000, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x03AC, 0x03AD, 0x03AE, 0x03AF,
0x0101, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x012F, 0x010D, 0x00E9, 0x0119, 0x00EB, 0x0117, 0x00ED, 0x00EE, 0x00EF, 0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF,
0x00F0, 0x0146, 0x014D, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x0169, 0x00F8, 0x0173, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x0138}; 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x0000
};
static unsigned long c885911[96]={
0x00A0, 0x0E01, 0x0E02, 0x0E03, 0x0E04, 0x0E05, 0x0E06, 0x0E07, 0x0E08, 0x0E09, 0x0E0A, 0x0E0B, 0x0E0C, 0x0E0D, 0x0E0E, 0x0E0F,
0x0E10, 0x0E11, 0x0E12, 0x0E13, 0x0E14, 0x0E15, 0x0E16, 0x0E17, 0x0E18, 0x0E19, 0x0E1A, 0x0E1B, 0x0E1C, 0x0E1D, 0x0E1E, 0x0E1F,
0x0E20, 0x0E21, 0x0E22, 0x0E23, 0x0E24, 0x0E25, 0x0E26, 0x0E27, 0x0E28, 0x0E29, 0x0E2A, 0x0E2B, 0x0E2C, 0x0E2D, 0x0E2E, 0x0E2F,
0x0E30, 0x0E31, 0x0E32, 0x0E33, 0x0E34, 0x0E35, 0x0E36, 0x0E37, 0x0E38, 0x0E39, 0x0E3A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0E3F,
0x0E40, 0x0E41, 0x0E42, 0x0E43, 0x0E44, 0x0E45, 0x0E46, 0x0E47, 0x0E48, 0x0E49, 0x0E4A, 0x0E4B, 0x0E4C, 0x0E4D, 0x0E4E, 0x0E4F,
0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57, 0x0E58, 0x0E59, 0x0E5A, 0x0E5B, 0x0000, 0x0000, 0x0000, 0x0000};
static unsigned long c885913[96]={ static unsigned long c88598[96]= {
0x00A0, 0x201D, 0x00A2, 0x00A3, 0x00A4, 0x201E, 0x00A6, 0x00A7, 0x00D8, 0x00A9, 0x0156, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00C6, 0x00A0, 0x0000, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00D7, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x201C, 0x00B5, 0x00B6, 0x00B7, 0x00F8, 0x00B9, 0x0157, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00E6, 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00F7, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x0000,
0x0104, 0x012E, 0x0100, 0x0106, 0x00C4, 0x00C5, 0x0118, 0x0112, 0x010C, 0x00C9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012A, 0x013B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0160, 0x0143, 0x0145, 0x00D3, 0x014C, 0x00D5, 0x00D6, 0x00D7, 0x0172, 0x0141, 0x015A, 0x016A, 0x00DC, 0x017B, 0x017D, 0x00DF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2017,
0x0105, 0x012F, 0x0101, 0x0107, 0x00E4, 0x00E5, 0x0119, 0x0113, 0x010D, 0x00E9, 0x017A, 0x0117, 0x0123, 0x0137, 0x012B, 0x013C, 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7, 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF,
0x0161, 0x0144, 0x0146, 0x00F3, 0x014D, 0x00F5, 0x00F6, 0x00F7, 0x0173, 0x0142, 0x015B, 0x016B, 0x00FC, 0x017C, 0x017E, 0x2019}; 0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7, 0x05E8, 0x05E9, 0x05EA, 0x0000, 0x0000, 0x200E, 0x200F, 0x0000
};
static unsigned long c885914[96]={ static unsigned long c88599[96]= {
0x00A0, 0x1E02, 0x1E03, 0x00A3, 0x010A, 0x010B, 0x1E0A, 0x00A7, 0x1E80, 0x00A9, 0x1E82, 0x1E0B, 0x1EF2, 0x00AD, 0x00AE, 0x0178, 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
0x1E1E, 0x1E1F, 0x0120, 0x0121, 0x1E40, 0x1E41, 0x00B6, 0x1E56, 0x1E81, 0x1E57, 0x1E83, 0x1E60, 0x1EF3, 0x1E84, 0x1E85, 0x1E61, 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
0x0174, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x1E6A, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x0176, 0x00DF, 0x011E, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x0130, 0x015E, 0x00DF,
0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
0x0175, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x1E6B, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x0177, 0x00FF}; 0x011F, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x0131, 0x015F, 0x00FF
};
static unsigned long c885915[96]={ static unsigned long c885910[96]= {
0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x20AC, 0x00A5, 0x0160, 0x00A7, 0x0161, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, 0x00A0, 0x0104, 0x0112, 0x0122, 0x012A, 0x0128, 0x0136, 0x00A7, 0x013B, 0x0110, 0x0160, 0x0166, 0x017D, 0x00AD, 0x016A, 0x014A,
0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x017D, 0x00B5, 0x00B6, 0x00B7, 0x017E, 0x00B9, 0x00BA, 0x00BB, 0x0152, 0x0153, 0x0178, 0x00BF, 0x00B0, 0x0105, 0x0113, 0x0123, 0x012B, 0x0129, 0x0137, 0x00B7, 0x013C, 0x0111, 0x0161, 0x0167, 0x017E, 0x2015, 0x016B, 0x014B,
0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x0100, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x012E, 0x010C, 0x00C9, 0x0118, 0x00CB, 0x0116, 0x00CD, 0x00CE, 0x00CF,
0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, 0x00D0, 0x0145, 0x014C, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x0168, 0x00D8, 0x0172, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF,
0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x0101, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x012F, 0x010D, 0x00E9, 0x0119, 0x00EB, 0x0117, 0x00ED, 0x00EE, 0x00EF,
0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF}; 0x00F0, 0x0146, 0x014D, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x0169, 0x00F8, 0x0173, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x0138
};
static unsigned long c885916[96]={ static unsigned long c885911[96]= {
0x00A0, 0x0104, 0x0105, 0x0141, 0x20AC, 0x201E, 0x0160, 0x00A7, 0x0161, 0x00A9, 0x0218, 0x00AB, 0x0179, 0x00AD, 0x017A, 0x017B, 0x00A0, 0x0E01, 0x0E02, 0x0E03, 0x0E04, 0x0E05, 0x0E06, 0x0E07, 0x0E08, 0x0E09, 0x0E0A, 0x0E0B, 0x0E0C, 0x0E0D, 0x0E0E, 0x0E0F,
0x00B0, 0x00B1, 0x010C, 0x0142, 0x017D, 0x201D, 0x00B6, 0x00B7, 0x017E, 0x010D, 0x0219, 0x00BB, 0x0152, 0x0153, 0x0178, 0x017C, 0x0E10, 0x0E11, 0x0E12, 0x0E13, 0x0E14, 0x0E15, 0x0E16, 0x0E17, 0x0E18, 0x0E19, 0x0E1A, 0x0E1B, 0x0E1C, 0x0E1D, 0x0E1E, 0x0E1F,
0x00C0, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0106, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x0E20, 0x0E21, 0x0E22, 0x0E23, 0x0E24, 0x0E25, 0x0E26, 0x0E27, 0x0E28, 0x0E29, 0x0E2A, 0x0E2B, 0x0E2C, 0x0E2D, 0x0E2E, 0x0E2F,
0x0110, 0x0143, 0x00D2, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x015A, 0x0170, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x0118, 0x021A, 0x00DF, 0x0E30, 0x0E31, 0x0E32, 0x0E33, 0x0E34, 0x0E35, 0x0E36, 0x0E37, 0x0E38, 0x0E39, 0x0E3A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0E3F,
0x00E0, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x0107, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x0E40, 0x0E41, 0x0E42, 0x0E43, 0x0E44, 0x0E45, 0x0E46, 0x0E47, 0x0E48, 0x0E49, 0x0E4A, 0x0E4B, 0x0E4C, 0x0E4D, 0x0E4E, 0x0E4F,
0x0111, 0x0144, 0x00F2, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x015B, 0x0171, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x0119, 0x021B, 0x00FF}; 0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57, 0x0E58, 0x0E59, 0x0E5A, 0x0E5B, 0x0000, 0x0000, 0x0000, 0x0000
};
static unsigned long c885913[96]= {
0x00A0, 0x201D, 0x00A2, 0x00A3, 0x00A4, 0x201E, 0x00A6, 0x00A7, 0x00D8, 0x00A9, 0x0156, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00C6,
0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x201C, 0x00B5, 0x00B6, 0x00B7, 0x00F8, 0x00B9, 0x0157, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00E6,
0x0104, 0x012E, 0x0100, 0x0106, 0x00C4, 0x00C5, 0x0118, 0x0112, 0x010C, 0x00C9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012A, 0x013B,
0x0160, 0x0143, 0x0145, 0x00D3, 0x014C, 0x00D5, 0x00D6, 0x00D7, 0x0172, 0x0141, 0x015A, 0x016A, 0x00DC, 0x017B, 0x017D, 0x00DF,
0x0105, 0x012F, 0x0101, 0x0107, 0x00E4, 0x00E5, 0x0119, 0x0113, 0x010D, 0x00E9, 0x017A, 0x0117, 0x0123, 0x0137, 0x012B, 0x013C,
0x0161, 0x0144, 0x0146, 0x00F3, 0x014D, 0x00F5, 0x00F6, 0x00F7, 0x0173, 0x0142, 0x015B, 0x016B, 0x00FC, 0x017C, 0x017E, 0x2019
};
static unsigned long c885914[96]= {
0x00A0, 0x1E02, 0x1E03, 0x00A3, 0x010A, 0x010B, 0x1E0A, 0x00A7, 0x1E80, 0x00A9, 0x1E82, 0x1E0B, 0x1EF2, 0x00AD, 0x00AE, 0x0178,
0x1E1E, 0x1E1F, 0x0120, 0x0121, 0x1E40, 0x1E41, 0x00B6, 0x1E56, 0x1E81, 0x1E57, 0x1E83, 0x1E60, 0x1EF3, 0x1E84, 0x1E85, 0x1E61,
0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
0x0174, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x1E6A, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x0176, 0x00DF,
0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
0x0175, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x1E6B, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x0177, 0x00FF
};
static unsigned long c885915[96]= {
0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x20AC, 0x00A5, 0x0160, 0x00A7, 0x0161, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x017D, 0x00B5, 0x00B6, 0x00B7, 0x017E, 0x00B9, 0x00BA, 0x00BB, 0x0152, 0x0153, 0x0178, 0x00BF,
0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF,
0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF
};
static unsigned long c885916[96]= {
0x00A0, 0x0104, 0x0105, 0x0141, 0x20AC, 0x201E, 0x0160, 0x00A7, 0x0161, 0x00A9, 0x0218, 0x00AB, 0x0179, 0x00AD, 0x017A, 0x017B,
0x00B0, 0x00B1, 0x010C, 0x0142, 0x017D, 0x201D, 0x00B6, 0x00B7, 0x017E, 0x010D, 0x0219, 0x00BB, 0x0152, 0x0153, 0x0178, 0x017C,
0x00C0, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0106, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
0x0110, 0x0143, 0x00D2, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x015A, 0x0170, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x0118, 0x021A, 0x00DF,
0x00E0, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x0107, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
0x0111, 0x0144, 0x00F2, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x015B, 0x0171, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x0119, 0x021B, 0x00FF
};
// Two Char Mapping ( many polish services and UPC Direct/HBO services) // Two Char Mapping ( many polish services and UPC Direct/HBO services)
// get from http://mitglied.lycos.de/buran/charsets/videotex-suppl.html // get from http://mitglied.lycos.de/buran/charsets/videotex-suppl.html
@@ -159,140 +173,369 @@ static inline unsigned int doVideoTexSuppl(char c1, char c2)
{ {
switch (c1) switch (c1)
{ {
case 0xC1: // grave case 0xC1: // grave
switch (c2) switch (c2)
{ {
case 0x61: return 224; case 0x41: return 192; case 0x61:
case 0x65: return 232; case 0x45: return 200; return 224;
case 0x69: return 236; case 0x49: return 204; case 0x41:
case 0x6f: return 242; case 0x4f: return 210; return 192;
case 0x75: return 249; case 0x55: return 217; case 0x65:
default: return 0; return 232;
} case 0x45:
case 0xC2: // acute return 200;
switch (c2) case 0x69:
{ return 236;
case 0x61: return 225; case 0x41: return 193; case 0x49:
case 0x65: return 233; case 0x45: return 201; return 204;
case 0x69: return 237; case 0x49: return 205; case 0x6f:
case 0x6f: return 243; case 0x4f: return 211; return 242;
case 0x75: return 250; case 0x55: return 218; case 0x4f:
case 0x79: return 253; case 0x59: return 221; return 210;
case 0x63: return 263; case 0x43: return 262; case 0x75:
case 0x6c: return 314; case 0x4c: return 313; return 249;
case 0x6e: return 324; case 0x4e: return 323; case 0x55:
case 0x72: return 341; case 0x52: return 340; return 217;
case 0x73: return 347; case 0x53: return 346; default:
case 0x7a: return 378; case 0x5a: return 377; return 0;
default: return 0; }
} case 0xC2: // acute
case 0xC3: // cedilla switch (c2)
switch (c2) {
{ case 0x61:
case 0x61: return 226; case 0x41: return 194; return 225;
case 0x65: return 234; case 0x45: return 202; case 0x41:
case 0x69: return 238; case 0x49: return 206; return 193;
case 0x6f: return 244; case 0x4f: return 212; case 0x65:
case 0x75: return 251; case 0x55: return 219; return 233;
case 0x79: return 375; case 0x59: return 374; case 0x45:
case 0x63: return 265; case 0x43: return 264; return 201;
case 0x67: return 285; case 0x47: return 284; case 0x69:
case 0x68: return 293; case 0x48: return 292; return 237;
case 0x6a: return 309; case 0x4a: return 308; case 0x49:
case 0x73: return 349; case 0x53: return 348; return 205;
case 0x77: return 373; case 0x57: return 372; case 0x6f:
default: return 0; return 243;
} case 0x4f:
case 0xC4: // tilde return 211;
switch (c2) case 0x75:
{ return 250;
case 0x61: return 227; case 0x41: return 195; case 0x55:
case 0x6e: return 241; case 0x4e: return 209; return 218;
case 0x69: return 297; case 0x49: return 296; case 0x79:
case 0x6f: return 245; case 0x4f: return 213; return 253;
case 0x75: return 361; case 0x55: return 360; case 0x59:
default: return 0; return 221;
} case 0x63:
case 0xC6: // breve return 263;
switch (c2) case 0x43:
{ return 262;
case 0x61: return 259; case 0x41: return 258; case 0x6c:
case 0x67: return 287; case 0x47: return 286; return 314;
case 0x75: return 365; case 0x55: return 364; case 0x4c:
default: return 0; return 313;
} case 0x6e:
case 0xC7: // dot above return 324;
switch (c2) case 0x4e:
{ return 323;
case 0x63: return 267; case 0x43: return 266; case 0x72:
case 0x65: return 279; case 0x45: return 278; return 341;
case 0x67: return 289; case 0x47: return 288; case 0x52:
case 0x49: return 304; case 0x7a: return 380; return 340;
case 0x5a: return 379; case 0x73:
default: return 0; return 347;
} case 0x53:
case 0xC8: // diaeresis return 346;
switch (c2) case 0x7a:
{ return 378;
case 0x61: return 228; case 0x41: return 196; case 0x5a:
case 0x65: return 235; case 0x45: return 203; return 377;
case 0x69: return 239; case 0x49: return 207; default:
case 0x6f: return 246; case 0x4f: return 214; return 0;
case 0x75: return 252; case 0x55: return 220; }
case 0x79: return 255; case 0x59: return 376; case 0xC3: // cedilla
default: return 0; switch (c2)
} {
case 0xCA: // ring above case 0x61:
switch (c2) return 226;
{ case 0x41:
case 0x61: return 229; case 0x41: return 197; return 194;
case 0x75: return 367; case 0x55: return 366; case 0x65:
default: return 0; return 234;
} case 0x45:
case 0xCB: // cedilla return 202;
switch (c2) case 0x69:
{ return 238;
case 0x63: return 231; case 0x43: return 199; case 0x49:
case 0x67: return 291; case 0x47: return 290; return 206;
case 0x6b: return 311; case 0x4b: return 310; case 0x6f:
case 0x6c: return 316; case 0x4c: return 315; return 244;
case 0x6e: return 326; case 0x4e: return 325; case 0x4f:
case 0x72: return 343; case 0x52: return 342; return 212;
case 0x73: return 351; case 0x53: return 350; case 0x75:
case 0x74: return 355; case 0x54: return 354; return 251;
default: return 0; case 0x55:
} return 219;
case 0xCD: // double acute accent case 0x79:
switch (c2) return 375;
{ case 0x59:
case 0x6f: return 337; case 0x4f: return 336; return 374;
case 0x75: return 369; case 0x55: return 368; case 0x63:
default: return 0; return 265;
} case 0x43:
case 0xCE: // ogonek return 264;
switch (c2) case 0x67:
{ return 285;
case 0x61: return 261; case 0x41: return 260; case 0x47:
case 0x65: return 281; case 0x45: return 280; return 284;
case 0x69: return 303; case 0x49: return 302; case 0x68:
case 0x75: return 371; case 0x55: return 370; return 293;
default: return 0; case 0x48:
} return 292;
case 0xCF: // caron case 0x6a:
switch (c2) return 309;
{ case 0x4a:
case 0x63: return 269; case 0x43: return 268; return 308;
case 0x64: return 271; case 0x44: return 270; case 0x73:
case 0x65: return 283; case 0x45: return 282; return 349;
case 0x6c: return 318; case 0x4c: return 317; case 0x53:
case 0x6e: return 328; case 0x4e: return 327; return 348;
case 0x72: return 345; case 0x52: return 344; case 0x77:
case 0x73: return 353; case 0x53: return 352; return 373;
case 0x74: return 357; case 0x54: return 356; case 0x57:
case 0x7a: return 382; case 0x5a: return 381; return 372;
default: return 0; default:
} return 0;
} }
case 0xC4: // tilde
switch (c2)
{
case 0x61:
return 227;
case 0x41:
return 195;
case 0x6e:
return 241;
case 0x4e:
return 209;
case 0x69:
return 297;
case 0x49:
return 296;
case 0x6f:
return 245;
case 0x4f:
return 213;
case 0x75:
return 361;
case 0x55:
return 360;
default:
return 0;
}
case 0xC6: // breve
switch (c2)
{
case 0x61:
return 259;
case 0x41:
return 258;
case 0x67:
return 287;
case 0x47:
return 286;
case 0x75:
return 365;
case 0x55:
return 364;
default:
return 0;
}
case 0xC7: // dot above
switch (c2)
{
case 0x63:
return 267;
case 0x43:
return 266;
case 0x65:
return 279;
case 0x45:
return 278;
case 0x67:
return 289;
case 0x47:
return 288;
case 0x49:
return 304;
case 0x7a:
return 380;
case 0x5a:
return 379;
default:
return 0;
}
case 0xC8: // diaeresis
switch (c2)
{
case 0x61:
return 228;
case 0x41:
return 196;
case 0x65:
return 235;
case 0x45:
return 203;
case 0x69:
return 239;
case 0x49:
return 207;
case 0x6f:
return 246;
case 0x4f:
return 214;
case 0x75:
return 252;
case 0x55:
return 220;
case 0x79:
return 255;
case 0x59:
return 376;
default:
return 0;
}
case 0xCA: // ring above
switch (c2)
{
case 0x61:
return 229;
case 0x41:
return 197;
case 0x75:
return 367;
case 0x55:
return 366;
default:
return 0;
}
case 0xCB: // cedilla
switch (c2)
{
case 0x63:
return 231;
case 0x43:
return 199;
case 0x67:
return 291;
case 0x47:
return 290;
case 0x6b:
return 311;
case 0x4b:
return 310;
case 0x6c:
return 316;
case 0x4c:
return 315;
case 0x6e:
return 326;
case 0x4e:
return 325;
case 0x72:
return 343;
case 0x52:
return 342;
case 0x73:
return 351;
case 0x53:
return 350;
case 0x74:
return 355;
case 0x54:
return 354;
default:
return 0;
}
case 0xCD: // double acute accent
switch (c2)
{
case 0x6f:
return 337;
case 0x4f:
return 336;
case 0x75:
return 369;
case 0x55:
return 368;
default:
return 0;
}
case 0xCE: // ogonek
switch (c2)
{
case 0x61:
return 261;
case 0x41:
return 260;
case 0x65:
return 281;
case 0x45:
return 280;
case 0x69:
return 303;
case 0x49:
return 302;
case 0x75:
return 371;
case 0x55:
return 370;
default:
return 0;
}
case 0xCF: // caron
switch (c2)
{
case 0x63:
return 269;
case 0x43:
return 268;
case 0x64:
return 271;
case 0x44:
return 270;
case 0x65:
return 283;
case 0x45:
return 282;
case 0x6c:
return 318;
case 0x4c:
return 317;
case 0x6e:
return 328;
case 0x4e:
return 327;
case 0x72:
return 345;
case 0x52:
return 344;
case 0x73:
return 353;
case 0x53:
return 352;
case 0x74:
return 357;
case 0x54:
return 356;
case 0x7a:
return 382;
case 0x5a:
return 381;
default:
return 0;
}
}
return 0; return 0;
} }
@@ -325,8 +568,8 @@ static inline unsigned int recode(unsigned char d, int cp)
return c885910[d-0xA0]; return c885910[d-0xA0];
case 11:// 8859-11 -> unicode mapping case 11:// 8859-11 -> unicode mapping
return c885911[d-0xA0]; return c885911[d-0xA0];
/* case 12:// 8859-12 -> unicode mapping // reserved for indian use.. /* case 12:// 8859-12 -> unicode mapping // reserved for indian use..
return c885912[d-0xA0];*/ return c885912[d-0xA0];*/
case 13:// 8859-13 -> unicode mapping case 13:// 8859-13 -> unicode mapping
return c885913[d-0xA0]; return c885913[d-0xA0];
case 14:// 8859-14 -> unicode mapping case 14:// 8859-14 -> unicode mapping
@@ -360,48 +603,48 @@ std::string convertDVBUTF8(const char *data, int len, int table, int tsidonid)
//printf("table %d tsidonid %04x twochar %d : %20s\n", table, tsidonid, twochar, data); //printf("table %d tsidonid %04x twochar %d : %20s\n", table, tsidonid, twochar, data);
switch(data[0]) switch(data[0])
{ {
case 1 ... 12: case 1 ... 12:
newtable=data[i++]+4; newtable=data[i++]+4;
// eDebug("(1..12)text encoded in ISO-8859-%d",table); // eDebug("(1..12)text encoded in ISO-8859-%d",table);
break; break;
case 0x10: case 0x10:
{ {
// eDebug("(0x10)text encoded in ISO-8859-%d",n); // eDebug("(0x10)text encoded in ISO-8859-%d",n);
int n=(data[i+1]<<8)|(data[i+2]); int n=(data[i+1]<<8)|(data[i+2]);
i += 3; i += 3;
switch(n) switch(n)
{ {
case 12: case 12:
{} //eDebug("unsup. ISO8859-12 enc.", n); {} //eDebug("unsup. ISO8859-12 enc.", n);
default: default:
newtable=n; newtable=n;
break;
}
break; break;
} }
case 0x11:// Basic Multilingual Plane of ISO/IEC 10646-1 enc (UTF-16... Unicode) break;
table = 65; }
tsidonid = 0; case 0x11:// Basic Multilingual Plane of ISO/IEC 10646-1 enc (UTF-16... Unicode)
++i; table = 65;
break; tsidonid = 0;
case 0x12: ++i;
++i; break;
{} //eDebug("unsup. KSC 5601 enc."); case 0x12:
break; ++i;
case 0x13: {} //eDebug("unsup. KSC 5601 enc.");
++i; break;
{} //eDebug("unsup. GB-2312-1980 enc."); case 0x13:
break; ++i;
case 0x14: {} //eDebug("unsup. GB-2312-1980 enc.");
++i; break;
{} //eDebug("unsup. Big5 subset of ISO/IEC 10646-1 enc."); case 0x14:
break; ++i;
case 0x0: {} //eDebug("unsup. Big5 subset of ISO/IEC 10646-1 enc.");
case 0xD ... 0xF: break;
case 0x15 ... 0x1F: case 0x0:
{} //eDebug("reserved %d", data[0]); case 0xD ... 0xF:
++i; case 0x15 ... 0x1F:
break; {} //eDebug("reserved %d", data[0]);
++i;
break;
} }
if(!table) if(!table)
table = newtable; table = newtable;
@@ -428,11 +671,11 @@ std::string convertDVBUTF8(const char *data, int len, int table, int tsidonid)
} }
if (!code) if (!code)
continue; continue;
// Unicode->UTF8 encoding // Unicode->UTF8 encoding
if (code < 0x80) // identity ascii <-> utf8 mapping if (code < 0x80) // identity ascii <-> utf8 mapping
res[t++]=char(code); res[t++]=char(code);
else if((table == 5) && (code == 0x8A)) else if((table == 5) && (code == 0x8A))
res[t++]= 0x20; res[t++]= 0x20;
else if ((code == 0x8A)) else if ((code == 0x8A))
res[t++]= '\n'; // 0x8a is vertical tab. Just use newline for now. res[t++]= '\n'; // 0x8a is vertical tab. Just use newline for now.
else if (code < 0x800) // two byte mapping else if (code < 0x800) // two byte mapping
@@ -468,7 +711,7 @@ eString convertUTF8DVB(const eString &string, int table)
unsigned char buf[len]; unsigned char buf[len];
for(int i=0;i<len;i++) for(int i=0; i<len; i++)
{ {
unsigned char c1=string[i]; unsigned char c1=string[i];
unsigned int c; unsigned int c;
@@ -487,58 +730,58 @@ eString convertUTF8DVB(const eString &string, int table)
{ {
switch(table) switch(table)
{ {
case 2: case 2:
coding_table = c88592; coding_table = c88592;
break; break;
case 3: case 3:
coding_table = c88593; coding_table = c88593;
break; break;
case 4: case 4:
coding_table = c88594; coding_table = c88594;
break; break;
case 5: case 5:
coding_table = c88595; coding_table = c88595;
break; break;
case 6: case 6:
coding_table = c88596; coding_table = c88596;
break; break;
case 7: case 7:
coding_table = c88597; coding_table = c88597;
break; break;
case 8: case 8:
coding_table = c88598; coding_table = c88598;
break; break;
case 9: case 9:
coding_table = c88599; coding_table = c88599;
break; break;
case 10: case 10:
coding_table = c885910; coding_table = c885910;
break; break;
case 11: case 11:
coding_table = c885911; coding_table = c885911;
break; break;
/* case 12: // reserved.. for indian use /* case 12: // reserved.. for indian use
coding_table = c885912; coding_table = c885912;
break;*/ break;*/
case 13: case 13:
coding_table = c885913; coding_table = c885913;
break; break;
case 14: case 14:
coding_table = c885914; coding_table = c885914;
break; break;
case 15: case 15:
coding_table = c885915; coding_table = c885915;
break; break;
case 16: case 16:
coding_table = c885916; coding_table = c885916;
break; break;
default: default:
//eFatal("unknown coding table %d", table); //eFatal("unknown coding table %d", table);
break; break;
} }
} }
for(unsigned int j=0;j<96;j++) for(unsigned int j=0; j<96; j++)
{ {
if(coding_table[j]==c) if(coding_table[j]==c)
{ {
c=0xA0+j; c=0xA0+j;
@@ -561,7 +804,7 @@ const std::string convertLatin1UTF8(const std::string &string)
while (i < len) while (i < len)
{ {
unsigned long code=string[i++]; unsigned long code=string[i++];
// Unicode->UTF8 encoding // Unicode->UTF8 encoding
if (code < 0x80) // identity latin <-> utf8 mapping if (code < 0x80) // identity latin <-> utf8 mapping
res[t++]=char(code); res[t++]=char(code);
else if (code < 0x800) // two byte mapping else if (code < 0x800) // two byte mapping
@@ -592,14 +835,14 @@ const std::string convertLatin1UTF8(const std::string &string)
int isUTF8(const std::string &string) int isUTF8(const std::string &string)
{ {
unsigned int len=string.size(); unsigned int len=string.size();
for (unsigned int i=0; i < len; ++i) for (unsigned int i=0; i < len; ++i)
{ {
if (!(string[i]&0x80)) // normal ASCII if (!(string[i]&0x80)) // normal ASCII
continue; continue;
if ((string[i] & 0xE0) == 0xC0) // one char following. if ((string[i] & 0xE0) == 0xC0) // one char following.
{ {
// first, length check: // first, length check:
if (i+1 >= len) if (i+1 >= len)
return 0; // certainly NOT utf-8 return 0; // certainly NOT utf-8
i++; i++;

View File

@@ -93,38 +93,38 @@
int main(int /*argc*/, char** /*argv*/) int main(int /*argc*/, char** /*argv*/)
{ {
time_t starttime, endtime; time_t starttime, endtime;
SIsectionsSDT sdtset; SIsectionsSDT sdtset;
#ifdef READ_PRESENT_INFOS #ifdef READ_PRESENT_INFOS
SIsectionsEIT epgset; SIsectionsEIT epgset;
#else #else
SIsectionsEITschedule epgset; SIsectionsEITschedule epgset;
#endif #endif
tzset(); // TZ auswerten tzset(); // TZ auswerten
starttime=time(NULL); starttime=time(NULL);
epgset.readSections(); epgset.readSections();
sdtset.readSections(); sdtset.readSections();
endtime=time(NULL); endtime=time(NULL);
printf("EIT Sections read: %d\n", epgset.size()); printf("EIT Sections read: %d\n", epgset.size());
printf("SDT Sections read: %d\n", sdtset.size()); printf("SDT Sections read: %d\n", sdtset.size());
printf("Time needed: %ds\n", (int)difftime(endtime, starttime)); printf("Time needed: %ds\n", (int)difftime(endtime, starttime));
// for_each(epgset.begin(), epgset.end(), printSmallSectionHeader()); // for_each(epgset.begin(), epgset.end(), printSmallSectionHeader());
// for_each(epgset.begin(), epgset.end(), printSIsection()); // for_each(epgset.begin(), epgset.end(), printSIsection());
SIevents events; SIevents events;
for(SIsectionsEIT::iterator k=epgset.begin(); k!=epgset.end(); k++) for(SIsectionsEIT::iterator k=epgset.begin(); k!=epgset.end(); k++)
events.insert((k->events()).begin(), (k->events()).end()); events.insert((k->events()).begin(), (k->events()).end());
SIservices services; SIservices services;
for(SIsectionsSDT::iterator k=sdtset.begin(); k!=sdtset.end(); k++) for(SIsectionsSDT::iterator k=sdtset.begin(); k!=sdtset.end(); k++)
services.insert((k->services()).begin(), (k->services()).end()); services.insert((k->services()).begin(), (k->services()).end());
// Damit wir die Zeiten der nvods richtig einsortiert bekommen // Damit wir die Zeiten der nvods richtig einsortiert bekommen
// Ist bei epgLarge eigentlich nicht noetig, da die NVODs anscheinend nur im present/actual (epgSmall) vorkommen // Ist bei epgLarge eigentlich nicht noetig, da die NVODs anscheinend nur im present/actual (epgSmall) vorkommen
events.mergeAndRemoveTimeShiftedEvents(services); events.mergeAndRemoveTimeShiftedEvents(services);
for_each(events.begin(), events.end(), printSIeventWithService(services)); for_each(events.begin(), events.end(), printSIeventWithService(services));
// for_each(events.begin(), events.end(), printSIevent()); // for_each(events.begin(), events.end(), printSIevent());
// for_each(epgset.begin(), epgset.end(), printSIsectionEIT()); // for_each(epgset.begin(), epgset.end(), printSIsectionEIT());
@@ -134,5 +134,5 @@ int main(int /*argc*/, char** /*argv*/)
// sprintf(fname, "seit%d", i+1); // sprintf(fname, "seit%d", i+1);
// s->saveBufferToFile(fname); // s->saveBufferToFile(fname);
// } // }
return 0; return 0;
} }

View File

@@ -47,40 +47,40 @@
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
SIsectionsSDT sdtset; SIsectionsSDT sdtset;
if(argc!=2) { if(argc!=2) {
fprintf(stderr, "Aufruf: %s Sendername\n", argv[0]); fprintf(stderr, "Aufruf: %s Sendername\n", argv[0]);
return 1; return 1;
} }
tzset(); // TZ auswerten tzset(); // TZ auswerten
sdtset.readSections(); sdtset.readSections();
// Die for-Schleifen sind laestig, // Die for-Schleifen sind laestig,
// Evtl. sollte man aus den sets maps machen, damit man den key einfacher aendern // Evtl. sollte man aus den sets maps machen, damit man den key einfacher aendern
// kann und somit find() funktioniert // kann und somit find() funktioniert
for(SIsectionsSDT::iterator k=sdtset.begin(); k!=sdtset.end(); k++) for(SIsectionsSDT::iterator k=sdtset.begin(); k!=sdtset.end(); k++)
for(SIservices::iterator ks=k->services().begin(); ks!=k->services().end(); ks++) { for(SIservices::iterator ks=k->services().begin(); ks!=k->services().end(); ks++) {
// Erst mal die Controlcodes entfernen // Erst mal die Controlcodes entfernen
// printf("Servicename: '%s'\n", ks->serviceName.c_str()); // printf("Servicename: '%s'\n", ks->serviceName.c_str());
char servicename[50]; char servicename[50];
strncpy(servicename, ks->serviceName.c_str(), sizeof(servicename)-1); strncpy(servicename, ks->serviceName.c_str(), sizeof(servicename)-1);
servicename[sizeof(servicename)-1]=0; servicename[sizeof(servicename)-1]=0;
removeControlCodes(servicename); removeControlCodes(servicename);
// Jetz pruefen ob der Servicename der gewuenschte ist // Jetz pruefen ob der Servicename der gewuenschte ist
// printf("Servicename: '%s'\n", servicename); // printf("Servicename: '%s'\n", servicename);
if(!strcmp(servicename, argv[1])) { if(!strcmp(servicename, argv[1])) {
// Event (serviceid) suchen // Event (serviceid) suchen
SIevent evt=SIevent::readActualEvent(ks->service_id); SIevent evt=SIevent::readActualEvent(ks->service_id);
if(evt.service_id != 0) if(evt.service_id != 0)
evt.saveXML(stdout); // gefunden evt.saveXML(stdout); // gefunden
// evt.dump(); // gefunden // evt.dump(); // gefunden
else else
printf("Kein aktuelles EPG fuer %s gefunden!\n", argv[1]); printf("Kein aktuelles EPG fuer %s gefunden!\n", argv[1]);
return 0; return 0;
} }
} }
return 1; return 1;
} }

View File

@@ -61,16 +61,16 @@
int main(int /*argc*/, char** /*argv*/) int main(int /*argc*/, char** /*argv*/)
{ {
time_t starttime, endtime; time_t starttime, endtime;
SIsectionsNIT nitset; SIsectionsNIT nitset;
starttime=time(NULL); starttime=time(NULL);
nitset.readSections(); nitset.readSections();
endtime=time(NULL); endtime=time(NULL);
printf("Sections read: %d\n", nitset.size()); printf("Sections read: %d\n", nitset.size());
printf("Time needed: %ds\n", (int)difftime(endtime, starttime)); printf("Time needed: %ds\n", (int)difftime(endtime, starttime));
// for_each(nitset.begin(), nitset.end(), printSmallSectionHeader()); // for_each(nitset.begin(), nitset.end(), printSmallSectionHeader());
// for_each(nitset.begin(), nitset.end(), printSIsection()); // for_each(nitset.begin(), nitset.end(), printSIsection());
for_each(nitset.begin(), nitset.end(), printSIsectionNIT()); for_each(nitset.begin(), nitset.end(), printSIsectionNIT());
return 0; return 0;
} }

View File

@@ -70,16 +70,16 @@
int main(int /*argc*/, char** /*argv*/) int main(int /*argc*/, char** /*argv*/)
{ {
time_t starttime, endtime; time_t starttime, endtime;
SIsectionsSDT sdtset; SIsectionsSDT sdtset;
starttime=time(NULL); starttime=time(NULL);
sdtset.readSections(); sdtset.readSections();
endtime=time(NULL); endtime=time(NULL);
printf("Sections read: %d\n", sdtset.size()); printf("Sections read: %d\n", sdtset.size());
printf("Time needed: %ds\n", (int)difftime(endtime, starttime)); printf("Time needed: %ds\n", (int)difftime(endtime, starttime));
// for_each(sdtset.begin(), sdtset.end(), printSmallSectionHeader()); // for_each(sdtset.begin(), sdtset.end(), printSmallSectionHeader());
// for_each(sdtset.begin(), sdtset.end(), printSIsection()); // for_each(sdtset.begin(), sdtset.end(), printSIsection());
for_each(sdtset.begin(), sdtset.end(), printSIsectionSDT()); for_each(sdtset.begin(), sdtset.end(), printSIsectionSDT());
return 0; return 0;
} }

File diff suppressed because it is too large Load Diff