23 #define ChkDoublePlausibility(Variable, Default) { if (Variable < 0.00001) Variable = Default; }
36 const char *p = strchr(s,
'/');
39 int m = strtoul(p + 1, &error, 10);
40 if (error && *error && !isspace(*error) || m > 32)
50 int result = inet_aton(s, &
addr);
53 return result != 0 && (
mask != 0 ||
addr.s_addr == 0);
58 return addr.s_addr == htonl(INADDR_LOOPBACK);
86 int n = strtol(p, &t, 10);
91 esyslog(
"ERROR: too many sat cable numbers in '%s'", s);
96 esyslog(
"ERROR: invalid sat cable number in '%s'", s);
101 for ( ; i <
size; i++)
109 for (
int i = 0; i <
size; i++) {
117 if (0 <= DeviceIndex && DeviceIndex <
size) {
118 if (
int CableNr =
array[DeviceIndex]) {
119 for (
int i = 0; i <
size; i++) {
120 if (i < DeviceIndex &&
array[i] == CableNr)
132 text = strdup(Text ? Text :
"");
158 text = strdup(Text ? Text :
"");
187 while ((s = ReadLine.
Read(f)) != NULL) {
189 char *p = strchr(s,
'#');
194 p = s + strlen(s) - 1;
215 if (Item->SubItems()) {
216 fprintf(f,
"%*s%s {\n", Indent,
"", Item->Text());
217 Write(f, Item->SubItems(), Indent + 2);
218 fprintf(f,
"%*s}\n", Indent + 2,
"");
221 fprintf(f,
"%*s%s\n", Indent,
"", Item->Text());
246 result =
Parse(f,
this, Line);
262 result =
Write(f,
this);
336 result = strcasecmp(
name, sl->
name);
342 char *p = strchr(s,
'=');
348 p = strchr(Name,
'.');
353 if (!(*Plugin && *Name))
358 value = strdup(Value);
491 if ((l->Plugin() == NULL) == (Plugin == NULL)) {
492 if ((!Plugin || strcasecmp(l->Plugin(), Plugin) == 0) && strcasecmp(l->Name(), Name) == 0)
499 void cSetup::Store(
const char *Name,
const char *Value,
const char *Plugin,
bool AllowMultiple)
503 if (l && !AllowMultiple)
528 if (p && !p->
SetupParse(l->Name(), l->Value()))
532 if (!
Parse(l->Name(), l->Value()))
536 esyslog(
"ERROR: unknown config parameter: %s%s%s = %s", l->Plugin() ? l->Plugin() :
"", l->Plugin() ?
"." :
"", l->Name(), l->Value());
569 strn0cpy(buffer, Value,
sizeof(buffer));
573 if ((Value = strchr(Value,
' ')) != NULL)
585 else if (!strcasecmp(Name,
"PrimaryDVB"))
PrimaryDVB = atoi(Value);
587 else if (!strcasecmp(Name,
"TimeoutRequChInfo"))
TimeoutRequChInfo = atoi(Value);
588 else if (!strcasecmp(Name,
"MenuScrollPage"))
MenuScrollPage = atoi(Value);
589 else if (!strcasecmp(Name,
"MenuScrollWrap"))
MenuScrollWrap = atoi(Value);
590 else if (!strcasecmp(Name,
"MenuKeyCloses"))
MenuKeyCloses = atoi(Value);
591 else if (!strcasecmp(Name,
"MarkInstantRecord"))
MarkInstantRecord = atoi(Value);
593 else if (!strcasecmp(Name,
"InstantRecordTime"))
InstantRecordTime = atoi(Value);
594 else if (!strcasecmp(Name,
"LnbSLOF"))
LnbSLOF = atoi(Value);
595 else if (!strcasecmp(Name,
"LnbFrequLo"))
LnbFrequLo = atoi(Value);
596 else if (!strcasecmp(Name,
"LnbFrequHi"))
LnbFrequHi = atoi(Value);
597 else if (!strcasecmp(Name,
"DiSEqC"))
DiSEqC = atoi(Value);
598 else if (!strcasecmp(Name,
"SetSystemTime"))
SetSystemTime = atoi(Value);
600 else if (!strcasecmp(Name,
"TimeTransponder"))
TimeTransponder = atoi(Value);
602 else if (!strcasecmp(Name,
"MarginStart"))
MarginStart = atoi(Value);
603 else if (!strcasecmp(Name,
"MarginStop"))
MarginStop = atoi(Value);
605 else if (!strcasecmp(Name,
"DisplaySubtitles"))
DisplaySubtitles = atoi(Value);
606 else if (!strcasecmp(Name,
"SupportTeletext"))
SupportTeletext = atoi(Value);
608 else if (!strcasecmp(Name,
"SubtitleOffset"))
SubtitleOffset = atoi(Value);
612 else if (!strcasecmp(Name,
"EPGScanTimeout"))
EPGScanTimeout = atoi(Value);
613 else if (!strcasecmp(Name,
"EPGBugfixLevel"))
EPGBugfixLevel = atoi(Value);
614 else if (!strcasecmp(Name,
"EPGLinger"))
EPGLinger = atoi(Value);
615 else if (!strcasecmp(Name,
"SVDRPTimeout"))
SVDRPTimeout = atoi(Value);
616 else if (!strcasecmp(Name,
"ZapTimeout"))
ZapTimeout = atoi(Value);
618 else if (!strcasecmp(Name,
"DefaultPriority"))
DefaultPriority = atoi(Value);
619 else if (!strcasecmp(Name,
"DefaultLifetime"))
DefaultLifetime = atoi(Value);
620 else if (!strcasecmp(Name,
"PauseKeyHandling"))
PauseKeyHandling = atoi(Value);
621 else if (!strcasecmp(Name,
"PausePriority"))
PausePriority = atoi(Value);
622 else if (!strcasecmp(Name,
"PauseLifetime"))
PauseLifetime = atoi(Value);
623 else if (!strcasecmp(Name,
"UseSubtitle"))
UseSubtitle = atoi(Value);
624 else if (!strcasecmp(Name,
"UseVps"))
UseVps = atoi(Value);
625 else if (!strcasecmp(Name,
"VpsMargin"))
VpsMargin = atoi(Value);
626 else if (!strcasecmp(Name,
"RecordingDirs"))
RecordingDirs = atoi(Value);
629 else if (!strcasecmp(Name,
"ColorKey0"))
ColorKey0 = atoi(Value);
630 else if (!strcasecmp(Name,
"ColorKey1"))
ColorKey1 = atoi(Value);
631 else if (!strcasecmp(Name,
"ColorKey2"))
ColorKey2 = atoi(Value);
632 else if (!strcasecmp(Name,
"ColorKey3"))
ColorKey3 = atoi(Value);
634 else if (!strcasecmp(Name,
"VideoFormat"))
VideoFormat = atoi(Value);
635 else if (!strcasecmp(Name,
"UpdateChannels"))
UpdateChannels = atoi(Value);
636 else if (!strcasecmp(Name,
"UseDolbyDigital"))
UseDolbyDigital = atoi(Value);
637 else if (!strcasecmp(Name,
"ChannelInfoPos"))
ChannelInfoPos = atoi(Value);
638 else if (!strcasecmp(Name,
"ChannelInfoTime"))
ChannelInfoTime = atoi(Value);
639 else if (!strcasecmp(Name,
"OSDLeftP"))
OSDLeftP = atof(Value);
640 else if (!strcasecmp(Name,
"OSDTopP"))
OSDTopP = atof(Value);
643 else if (!strcasecmp(Name,
"OSDLeft"))
OSDLeft = atoi(Value);
644 else if (!strcasecmp(Name,
"OSDTop"))
OSDTop = atoi(Value);
645 else if (!strcasecmp(Name,
"OSDWidth")) {
OSDWidth = atoi(Value);
OSDWidth &= ~0x07; }
646 else if (!strcasecmp(Name,
"OSDHeight"))
OSDHeight = atoi(Value);
647 else if (!strcasecmp(Name,
"OSDAspect"))
OSDAspect = atof(Value);
648 else if (!strcasecmp(Name,
"OSDMessageTime"))
OSDMessageTime = atoi(Value);
649 else if (!strcasecmp(Name,
"UseSmallFont"))
UseSmallFont = atoi(Value);
650 else if (!strcasecmp(Name,
"AntiAlias"))
AntiAlias = atoi(Value);
657 else if (!strcasecmp(Name,
"FontOsdSize"))
FontOsdSize = atoi(Value);
658 else if (!strcasecmp(Name,
"FontSmlSize"))
FontSmlSize = atoi(Value);
659 else if (!strcasecmp(Name,
"FontFixSize"))
FontFixSize = atoi(Value);
660 else if (!strcasecmp(Name,
"MaxVideoFileSize"))
MaxVideoFileSize = atoi(Value);
661 else if (!strcasecmp(Name,
"MaxRecordingSize"))
MaxRecordingSize = atoi(Value);
662 else if (!strcasecmp(Name,
"SplitEditedFiles"))
SplitEditedFiles = atoi(Value);
663 else if (!strcasecmp(Name,
"DelTimeshiftRec"))
DelTimeshiftRec = atoi(Value);
664 else if (!strcasecmp(Name,
"HardLinkCutter"))
HardLinkCutter = atoi(Value);
665 else if (!strcasecmp(Name,
"MinEventTimeout"))
MinEventTimeout = atoi(Value);
666 else if (!strcasecmp(Name,
"MinUserInactivity"))
MinUserInactivity = atoi(Value);
667 else if (!strcasecmp(Name,
"NextWakeupTime"))
NextWakeupTime = atoi(Value);
668 else if (!strcasecmp(Name,
"MultiSpeedMode"))
MultiSpeedMode = atoi(Value);
669 else if (!strcasecmp(Name,
"ShowReplayMode"))
ShowReplayMode = atoi(Value);
670 else if (!strcasecmp(Name,
"ShowRemainingTime"))
ShowRemainingTime = atoi(Value);
671 else if (!strcasecmp(Name,
"ResumeID"))
ResumeID = atoi(Value);
672 else if (!strcasecmp(Name,
"JumpPlay"))
JumpPlay = atoi(Value);
673 else if (!strcasecmp(Name,
"PlayJump"))
PlayJump = atoi(Value);
674 else if (!strcasecmp(Name,
"PauseLastMark"))
PauseLastMark = atoi(Value);
675 else if (!strcasecmp(Name,
"CurrentChannel"))
CurrentChannel = atoi(Value);
676 else if (!strcasecmp(Name,
"CurrentVolume"))
CurrentVolume = atoi(Value);
677 else if (!strcasecmp(Name,
"CurrentDolby"))
CurrentDolby = atoi(Value);
678 else if (!strcasecmp(Name,
"InitialChannel"))
InitialChannel = Value;
679 else if (!strcasecmp(Name,
"InitialVolume"))
InitialVolume = atoi(Value);
680 else if (!strcasecmp(Name,
"DeviceBondings"))
DeviceBondings = Value;
681 else if (!strcasecmp(Name,
"ChannelsWrap"))
ChannelsWrap = atoi(Value);
683 else if (!strcasecmp(Name,
"EmergencyExit"))
EmergencyExit = atoi(Value);