diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2000-09-17 09:36:50 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2000-09-17 09:36:50 +0200 |
commit | 27046cf8a9f1047e39724ddb1702957f4b395f36 (patch) | |
tree | 0a4b25e04063568883f74f218c689389e8b53854 /config.c | |
parent | 4716cfb5a1ebae09a8a277b8943d3a885dcf1365 (diff) | |
download | vdr-27046cf8a9f1047e39724ddb1702957f4b395f36.tar.gz vdr-27046cf8a9f1047e39724ddb1702957f4b395f36.tar.bz2 |
Implemented SVDRP command 'HITK'
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.c 1.22 2000/09/10 15:07:15 kls Exp $ + * $Id: config.c 1.23 2000/09/17 09:11:59 kls Exp $ */ #include "config.h" @@ -155,14 +155,22 @@ eKeys cKeys::Get(unsigned int Code) return kNone; } -unsigned int cKeys::Encode(const char *Command) +eKeys cKeys::Translate(const char *Command) { - if (Command != NULL) { + if (Command) { const tKey *k = keys; - while ((k->type != kNone) && strcmp(k->name, Command) != 0) + while ((k->type != kNone) && strcasecmp(k->name, Command) != 0) k++; - return k->code; + 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; } |