From: Andreas Ă–man Date: Wed, 31 Oct 2007 16:10:19 +0000 (+0000) Subject: add pvr_op2int() func X-Git-Tag: 2.12~1415 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=45d09db30a4819bbfa4006d72e11aad6ee05b329;p=thirdparty%2Ftvheadend.git add pvr_op2int() func --- diff --git a/pvr.c b/pvr.c index 5df430b4e..4b1360853 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 3d6905b4d..2cf5e27b2 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 */