add pvr_op2int() func

This commit is contained in:
Andreas Öman 2007-10-31 16:10:19 +00:00
parent efa39aa0ff
commit 45d09db30a
2 changed files with 19 additions and 0 deletions

17
pvr.c
View file

@ -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);
}

2
pvr.h
View file

@ -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 */