From 45d09db30a4819bbfa4006d72e11aad6ee05b329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Wed, 31 Oct 2007 16:10:19 +0000 Subject: [PATCH] add pvr_op2int() func --- pvr.c | 17 +++++++++++++++++ pvr.h | 2 ++ 2 files changed, 19 insertions(+) diff --git a/pvr.c b/pvr.c index 5df430b4..4b136085 100644 --- a/pvr.c +++ b/pvr.c @@ -43,6 +43,7 @@ #include "epg.h" #include "dispatch.h" #include "buffer.h" +#include "strtab.h" struct pvr_rec_list pvrr_global_list; @@ -1115,3 +1116,19 @@ pvrr_record_packet(pvr_rec_t *pvrr, th_pkt_t *pkt) } } + + + +static struct strtab recoptab[] = { + { "once", RECOP_ONCE }, + { "daily", RECOP_DAILY }, + { "weekly", RECOP_WEEKLY }, + { "cancel", RECOP_CANCEL }, + { "toggle", RECOP_TOGGLE } +}; + +int +pvr_op2int(const char *op) +{ + return str2val(op, recoptab); +} diff --git a/pvr.h b/pvr.h index 3d6905b4..2cf5e27b 100644 --- a/pvr.h +++ b/pvr.h @@ -115,4 +115,6 @@ void pvrr_set_rec_state(pvr_rec_t *pvrr, pvrr_rec_status_t status); void pvr_channel_record_op(th_channel_t *ch, int duration); +int pvr_op2int(const char *op); + #endif /* PVR_H */