00001 #ifndef VBI_H
00002 #define VBI_H
00003
00004 #include "vt.h"
00005 #include "dllist.h"
00006 #include "cache.h"
00007 #include "lang.h"
00008
00009 #define PLL_ADJUST 4
00010
00011 struct raw_page
00012 {
00013 struct vt_page page[1];
00014 struct enhance enh[1];
00015 };
00016
00017 struct vbi
00018 {
00019 int fd;
00020 struct cache *cache;
00021 struct dl_head clients[1];
00022
00023 int bufsize;
00024 int bpl;
00025 u32 seq;
00026
00027 struct raw_page rpage[8];
00028 struct raw_page *ppage;
00029
00030 int pll_fixed;
00031 int pll_adj;
00032 int pll_dir;
00033 int pll_cnt;
00034 int pll_err, pll_lerr;
00035
00036 int bpb;
00037 int bp8bl, bp8bh;
00038 int soc, eoc;
00039 };
00040
00041 struct vbi_client
00042 {
00043 struct dl_node node[1];
00044 void (*handler)(void *data, struct vt_event *ev);
00045 void *data;
00046 };
00047
00048 struct vbi *vbi_open(char *vbi_dev_name, struct cache *ca, int fine_tune,
00049 int big_buf);
00050 void vbi_close(struct vbi *vbi);
00051 void vbi_reset(struct vbi *vbi);
00052 int vbi_add_handler(struct vbi *vbi, void *handler, void *data);
00053 void vbi_del_handler(struct vbi *vbi, void *handler, void *data);
00054 struct vt_page *vbi_query_page(struct vbi *vbi, int pgno, int subno);
00055 void vbi_pll_reset(struct vbi *vbi, int fine_tune);
00056
00057 #endif