diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2000-07-24 16:43:04 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2000-07-24 16:43:04 +0200 |
commit | 07d92eaee7d1ff37a6abfe873275b2f82a979271 (patch) | |
tree | 2ec763200083bc07820f099fc76ec079a6c91069 /config.c | |
parent | 6602eb5c90210906273a5b9a15aa0d2d1d095a16 (diff) | |
download | vdr-07d92eaee7d1ff37a6abfe873275b2f82a979271.tar.gz vdr-07d92eaee7d1ff37a6abfe873275b2f82a979271.tar.bz2 |
Implemented 'summary' feature
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 22 |
1 files changed, 19 insertions, 3 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.13 2000/07/23 11:56:06 kls Exp $ + * $Id: config.c 1.14 2000/07/23 17:22:08 kls Exp $ */ #include "config.h" @@ -274,13 +274,27 @@ cTimer::cTimer(bool Instant) priority = 99; lifetime = 99; *file = 0; + summary = NULL; if (Instant) snprintf(file, sizeof(file), "@%s", cChannel::GetChannelName(CurrentChannel)); } +cTimer::~cTimer() +{ + delete summary; +} + +cTimer& cTimer::operator= (const cTimer &Timer) +{ + memcpy(this, &Timer, sizeof(*this)); + if (summary) + summary = strdup(summary); + return *this; +} + const char *cTimer::ToText(cTimer *Timer) { - asprintf(&buffer, "%d:%d:%s:%d:%d:%d:%d:%s\n", Timer->active, Timer->channel, PrintDay(Timer->day), Timer->start, Timer->stop, Timer->priority, Timer->lifetime, Timer->file); + asprintf(&buffer, "%d:%d:%s:%d:%d:%d:%d:%s:%s\n", Timer->active, Timer->channel, PrintDay(Timer->day), Timer->start, Timer->stop, Timer->priority, Timer->lifetime, Timer->file, Timer->summary ? Timer->summary : ""); return buffer; } @@ -344,7 +358,9 @@ bool cTimer::Parse(const char *s) { char *buffer1 = NULL; char *buffer2 = NULL; - if (8 == sscanf(s, "%d:%d:%a[^:]:%d:%d:%d:%d:%a[^:\n]", &active, &channel, &buffer1, &start, &stop, &priority, &lifetime, &buffer2)) { + delete summary; + summary = NULL; + if (8 <= sscanf(s, "%d:%d:%a[^:]:%d:%d:%d:%d:%a[^:\n]:%a[^\n]", &active, &channel, &buffer1, &start, &stop, &priority, &lifetime, &buffer2, &summary)) { //TODO add more plausibility checks day = ParseDay(buffer1); strncpy(file, buffer2, MaxFileName - 1); |