|

楼主 |
发表于 2009-12-21 20:13:37
|
显示全部楼层
附上w3m-0.5.2版本源码w3mimg/fb/fb_w3mimg.c文件中w3ming_fbopen函数
w3mimg_op *
w3mimg_fbopen()
{
w3mimg_op *wop = NULL;
wop = (w3mimg_op *) malloc(sizeof(w3mimg_op));
if (wop == NULL)
return NULL;
memset(wop, 0, sizeof(w3mimg_op));
if (!check_tty_console(getenv("W3M_TTY")) && strcmp("jfbterm", getenv("TERM")) != 0) {
fprintf(stderr, "w3mimgdisplay/fb: tty is not console\n");
goto error;
}
if (fb_open())
goto error;
wop->width = fb_width();
wop->height = fb_height();
wop->init = w3mfb_init;
wop->finish = w3mfb_finish;
wop->active = w3mfb_active;
wop->set_background = w3mfb_set_background;
wop->sync = w3mfb_sync;
wop->close = w3mfb_close;
wop->clear = w3mfb_clear;
wop->load_image = w3mfb_load_image;
wop->show_image = w3mfb_show_image;
wop->free_image = w3mfb_free_image;
wop->get_image_size = w3mfb_get_image_size;
/* XXX */
fb_image_init();
return wop;
error:
free(wop);
return NULL;
}
-------------------------------------------------------------------------
从以上代码可见,如果w3m运行在没有设置TERM=jfbterm环境变量的framebuffer终端环境中就会拒绝打开framebuffer设备文件。 |
|