summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2002-09-29 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2002-09-29 18:00:00 +0200
commitd08073815d6d9132f7fb5cd9f82877967dc6b0e4 (patch)
treef93fbe9f18ed2893d88dc4ce6d01d80804d664da /config.c
parent346f4cd1420bb02bd9cec4059385c9922d64fc3f (diff)
downloadvdr-patch-lnbsharing-d08073815d6d9132f7fb5cd9f82877967dc6b0e4.tar.gz
vdr-patch-lnbsharing-d08073815d6d9132f7fb5cd9f82877967dc6b0e4.tar.bz2
Version 1.1.11vdr-1.1.11
- Fixed an incomplete initialization of the filter parameters in eit.c (thanks to Jeremy Hall). - Fixed the 'newplugin' script for use with the NEWSTRUCT driver (thanks to Andreas Schultz for reporting this one). If you have already created a plugin directory and Makefile with 'newplugin', please apply the following patch to it: ------------------------------------------------------- --- Makefile 2002/06/10 16:24:06 1.4 +++ Makefile 2002/09/17 15:36:36 1.5 @@ -15,7 +15,12 @@ ### The directory environment: +ifdef NEWSTRUCT +DVBDIR = ../../../../DVB/include +DEFINES += -DNEWSTRUCT +else DVBDIR = ../../../../DVB/ost/include +endif VDRDIR = ../../.. VDRINC = $(VDRDIR)/include LIBDIR = ../../lib @@ -34,7 +39,7 @@ INCLUDES = -I$(VDRINC) -I$(DVBDIR) -DEFINES = -DPLUGIN_NAME_I18N='"$(PLUGIN)"' +DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' ### The object files (add further files here): ------------------------------------------------------- This is the diff for the 'setup' example that comes with VDR, so your line numbers may be different. - Added a missing 'public' keyword in device.h (thanks to Martin Hammerschmid). - Fixed a race condition when starting 'Transfer Mode'. - Rearranged the remote control key handling to allow plugins to implement additional types of remote controls (see PLUGINS.html, section "Remote Control"). The previously used files 'keys.conf' and 'keys-pc.conf' have been replaced by the file 'remote.conf', which holds the key definitions of all remote controls. - The LIRC remote control keys are now handled just like the keyboard and RCU keys. This means that you can use the lircd.conf file as is for your remote control, without the need of editing it to make the key names the same as used in VDR. When first starting VDR it will go into the "Learning keys" mode and ask you to press the various keys. The resulting key assignment will be stored in the file 'remote.conf'. Since I have no way of testing the LIRC support, I hope I didn't break it in the process... - While learning the remote control keys it is now possible to press the 'Menu' key to skip the definition of keys that are not available on your particular RC unit. - Fixed handling DVD subtitles in the SPU decoder (thanks to Andreas Schultz). - Avoiding restarts due to 'panic level' when switching channels on the primary device during EPG scan.
Diffstat (limited to 'config.c')
-rw-r--r--config.c172
1 files changed, 2 insertions, 170 deletions
diff --git a/config.c b/config.c
index 15d645d..e5a5609 100644
--- a/config.c
+++ b/config.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: config.c 1.105 2002/09/04 13:45:56 kls Exp $
+ * $Id: config.c 1.106 2002/09/28 09:43:41 kls Exp $
*/
#include "config.h"
@@ -19,169 +19,6 @@
// format characters in order to allow any number of blanks after a numeric
// value!
-// -- cKeys ------------------------------------------------------------------
-
-tKey keyTable[] = { // "Up" and "Down" must be the first two keys!
- { kUp, "Up", 0 },
- { kDown, "Down", 0 },
- { kMenu, "Menu", 0 },
- { kOk, "Ok", 0 },
- { kBack, "Back", 0 },
- { kLeft, "Left", 0 },
- { kRight, "Right", 0 },
- { kRed, "Red", 0 },
- { kGreen, "Green", 0 },
- { kYellow, "Yellow", 0 },
- { kBlue, "Blue", 0 },
- { k0, "0", 0 },
- { k1, "1", 0 },
- { k2, "2", 0 },
- { k3, "3", 0 },
- { k4, "4", 0 },
- { k5, "5", 0 },
- { k6, "6", 0 },
- { k7, "7", 0 },
- { k8, "8", 0 },
- { k9, "9", 0 },
- { kPower, "Power", 0 },
- { kVolUp, "Volume+", 0 },
- { kVolDn, "Volume-", 0 },
- { kMute, "Mute", 0 },
- { kNone, "", 0 },
- };
-
-cKeys::cKeys(void)
-{
- fileName = NULL;
- code = 0;
- address = 0;
- keys = keyTable;
-}
-
-void cKeys::Clear(void)
-{
- for (tKey *k = keys; k->type != kNone; k++)
- k->code = 0;
-}
-
-void cKeys::SetDummyValues(void)
-{
- for (tKey *k = keys; k->type != kNone; k++)
- k->code = k->type + 1; // '+1' to avoid 0
-}
-
-bool cKeys::Load(const char *FileName)
-{
- isyslog("loading %s", FileName);
- bool result = false;
- if (FileName)
- fileName = strdup(FileName);
- if (fileName) {
- FILE *f = fopen(fileName, "r");
- if (f) {
- int line = 0;
- char buffer[MAXPARSEBUFFER];
- result = true;
- while (fgets(buffer, sizeof(buffer), f) > 0) {
- line++;
- if (!isempty(buffer)) {
- char *Name = buffer;
- char *p = strpbrk(Name, " \t");
- if (p) {
- *p = 0; // terminates 'Name'
- while (*++p && isspace(*p))
- ;
- if (*p) {
- if (strcasecmp(Name, "Code") == 0)
- code = *p;
- else if (strcasecmp(Name, "Address") == 0)
- address = strtol(p, NULL, 16);
- else {
- for (tKey *k = keys; k->type != kNone; k++) {
- if (strcasecmp(Name, k->name) == 0) {
- k->code = strtol(p, NULL, 16);
- Name = NULL; // to indicate that we found it
- break;
- }
- }
- if (Name) {
- esyslog("unknown key in %s, line %d\n", fileName, line);
- result = false;
- break;
- }
- }
- }
- continue;
- }
- esyslog("error in %s, line %d\n", fileName, line);
- result = false;
- break;
- }
- }
- fclose(f);
- }
- else
- esyslog("can't open '%s'\n", fileName);
- }
- else
- esyslog("no key configuration file name supplied!\n");
- return result;
-}
-
-bool cKeys::Save(void)
-{
- cSafeFile f(fileName);
- if (f.Open()) {
- fprintf(f, "Code\t%c\nAddress\t%04X\n", code, address);
- for (tKey *k = keys; k->type != kNone; k++)
- fprintf(f, "%s\t%08X\n", k->name, k->code);
- return f.Close();
- }
- return false;
-}
-
-eKeys cKeys::Get(unsigned int Code)
-{
- if (Code != 0) {
- tKey *k;
- for (k = keys; k->type != kNone; k++) {
- if (k->code == Code)
- break;
- }
- return k->type;
- }
- return kNone;
-}
-
-eKeys cKeys::Translate(const char *Command)
-{
- if (Command) {
- const tKey *k = keys;
- while ((k->type != kNone) && strcasecmp(k->name, Command) != 0)
- k++;
- return k->type;
- }
- return kNone;
-}
-
-unsigned int cKeys::Encode(const char *Command)
-{
- eKeys k = Translate(Command);
- if (k != kNone)
- return keys[k].code;
- return 0;
-}
-
-void cKeys::Set(eKeys Key, unsigned int Code)
-{
- for (tKey *k = keys; k->type != kNone; k++) {
- if (k->type == Key) {
- k->code = Code;
- break;
- }
- }
-}
-
// -- cChannel ---------------------------------------------------------------
char *cChannel::buffer = NULL;
@@ -247,7 +84,6 @@ bool cChannel::Parse(const char *s)
if (*s == ':') {
if (*++s) {
strn0cpy(name, s, MaxChannelName);
- name[strlen(name) - 1] = 0; // strip the '\n'
groupSep = true;
number = 0;
}
@@ -696,7 +532,7 @@ bool cSVDRPhost::Parse(const char *s)
if (p) {
char *error = NULL;
int m = strtoul(p + 1, &error, 10);
- if (error && !isspace(*error) || m > 32)
+ if (error && *error && !isspace(*error) || m > 32)
return false;
*(char *)p = 0; // yes, we know it's 'const' - will be restored!
if (m == 0)
@@ -733,10 +569,6 @@ bool cCaDefinition::Parse(const char *s)
return 2 == sscanf(s, "%d %a[^\n]", &number, &description) && description && *description;
}
-// -- cKeys ------------------------------------------------------------------
-
-cKeys Keys;
-
// -- cCommands --------------------------------------------------------------
cCommands Commands;