www.pudn.com > tvctrl.rar > epg.h
/*
* filename: epg.h
*/
#ifndef _EPG_H
#define _EPG_H
#define INIT_ITEMS_NUM 32
#define EMPTY_NAME_REFERENCE -1
enum tag_epg_program_info_flag
{
DELETED = 0x0 ,
NORMAL = 0X01 ,
} ;
typedef struct tag_epg_program_info
{
UINT8 flag ; /* 标识符,0x0标识为删除,大于0x0为正常,还用来在计算多条件的索引时用到 */
UINT8 content ; /* 节目分类,定义为8位,放弃"用户自定义信息"*/
UINT16 program_id ;
UINT8 parental_rating ;
UINT32 start_time ;
UINT32 program_name_reference ; /* 定义为32位长 */
} epg_program_info_t ;
typedef struct tag_epg_progarms
{
UINT32 leftout ; /* 剩余数组大小 */
UINT32 number ; /* 节目个数 */
UINT32 number_deleted ; /* 删除的节目的个数 */
EPGRECORD * epg_records ;
PROGRAMRECORD * program_records ;
epg_program_info_t * entries ;
} epg_programs_t ;
/*
*说明:关于节目名在program_name_field中的存放
* 在programs.p_array[index].name_reference中保存的偏移量指向name_field
* 的地方,直接存放program_name字符,并在字符串结束的地方插入一个'\0'作为结束标志
* 只是在字符串计数的时候有点麻烦
*/
typedef struct tag_epg_progarm_name_filed
{
UINT32 leftout ; /* 剩余内存总数 */
UINT32 offset ; /* 偏移地址,指向最后一个item的下一字节*/
UINT8 * field_head ; /* 始终指向内存区的头部,不要移动该指针 */
} epg_program_name_field_t ;
typedef struct tag_epg_index
{
UINT32 * program_id_table ;
UINT32 * start_time_table ;
/*
UINT32 * PID_and_ST_table ; /* 以上两者的联合索引表 */
} epg_index_t ;
typedef struct tag_working_table_info
{
UINT32 * entries ;
UINT32 number ;
} working_table_info_t ;
typedef struct tag_epg_info
{
epg_programs_t program_table ;
epg_program_name_field_t name_field_table ;
epg_index_t index_table ; /* 索引表的大小与节目表保持一致 */
working_table_info_t working_table ;
} epg_info_t, * p_epg_info_t ;
/***** epg信息的结构定义 -- end
/************************************************************************************/
enum tag_select_comparison
{
large_than = 0x01 ,
small_than = 0x02 ,
equal = 0x03 ,
} ;
typedef struct tag_epg_select_condition
{
UINT8 index_col ; /* 索引列号 */
UINT8 comparison ; /* 操作符 */
char * p_parameter ; /* 参数 */
} epg_select_condition_t ;
/***** 用于epg索引的结构 的结构定义 -- end
/************************************************************************************/
/* these function are used to "Program Table" */
#ifdef __cplusplus
extern "C" {
#endif
#ifdef ___EITTEST___
void test_GetNameAndText(event_information_section_t * p_eit,int event_num,char **ppname, char **pptext) ;
void test_GetStartAndContTime(event_information_section_t * p_eit,int event_num,int *pstart, int *pcont) ;
void test_DisplayPrograms(UINT8 display_order) ;
#endif
#ifdef __cplusplus
}
#endif
#endif