]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
add pvr_op2int() func
authorAndreas Öman <andreas@lonelycoder.com>
Wed, 31 Oct 2007 16:10:19 +0000 (16:10 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Wed, 31 Oct 2007 16:10:19 +0000 (16:10 +0000)
pvr.c
pvr.h

diff --git a/pvr.c b/pvr.c
index 5df430b4efb53aa9ab0b575e29201b0f5de68580..4b1360853afce4a6ef42f0a8d51292a9d40b79a7 100644 (file)
--- 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 3d6905b4d14f614f6a783fdc2c082c43cbbecfed..2cf5e27b26986ec6755be87a7d1897bbeeb9f522 100644 (file)
--- 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 */