#include <sources.h>
List of all members.
Detailed Description
Definition at line 15 of file sources.h.
Member Enumeration Documentation
- Enumerator:
| stNone |
|
| stCable |
|
| stSat |
|
| stTerr |
|
| st_Mask |
|
| st_Neg |
|
| st_Pos |
|
Definition at line 17 of file sources.h.
Constructor & Destructor Documentation
| cSource::cSource |
( |
void |
| ) |
|
Member Function Documentation
| int cSource::Code |
( |
void |
| ) |
const [inline] |
| const char* cSource::Description |
( |
void |
| ) |
const [inline] |
| static int cSource::FromData |
( |
eSourceType |
SourceType, |
|
|
int |
Position = 0, |
|
|
bool |
East = false |
|
) |
| [static] |
| int cSource::FromString |
( |
const char * |
s | ) |
[static] |
Definition at line 436 of file compat.c.
References esyslog, st_Neg, stCable, stNone, stSat, and stTerr.
Referenced by main(), and cPlainKeyConstCw::Parse().
{
int type = stNone;
switch (toupper(*s)) {
case 'C': type = stCable; break;
case 'S': type = stSat; break;
case 'T': type = stTerr; break;
case '0' ... '9': type = *s - '0'; break;
default: esyslog("ERROR: unknown source key '%c'", *s);
return stNone;
}
int code = type;
if (type == stSat) {
int pos = 0;
bool dot = false;
bool neg = false;
while (*++s) {
switch (toupper(*s)) {
case '0' ... '9': pos *= 10;
pos += *s - '0';
break;
case '.': dot = true;
break;
case 'E': neg = true;
case 'W': if (!dot)
pos *= 10;
break;
default: esyslog("ERROR: unknown source character '%c'", *s);
return stNone;
}
}
if (neg)
pos |= st_Neg;
code |= pos;
}
return code;
}
| static bool cSource::IsCable |
( |
int |
Code | ) |
[inline, static] |
| static bool cSource::IsSat |
( |
int |
Code | ) |
[inline, static] |
| static bool cSource::IsTerr |
( |
int |
Code | ) |
[inline, static] |
| bool cSource::Parse |
( |
const char * |
s | ) |
|
| cString cSource::ToString |
( |
int |
Code | ) |
[static] |
Definition at line 416 of file compat.c.
References st_Mask, st_Neg, stCable, stSat, and stTerr.
Referenced by cValidityRange::Print(), cPlainKeyConstCw::PrintKeyNr(), and cCam::Tune().
{
char buffer[16];
char *q = buffer;
switch (Code & st_Mask) {
case stCable: *q++ = 'C'; break;
case stSat: *q++ = 'S';
{
int pos = Code & ~st_Mask;
q += snprintf(q, sizeof(buffer) - 2, "%u.%u", (pos & ~st_Neg) / 10, (pos & ~st_Neg) % 10);
*q++ = (Code & st_Neg) ? 'E' : 'W';
}
break;
case stTerr: *q++ = 'T'; break;
default: *q++ = Code + '0';
}
*q = 0;
return buffer;
}
The documentation for this class was generated from the following files: