FreeBSD/usr.sbin/vidcontrol/vidcontrol.c
/*
 * Initialize revert data.
 *
 * NOTE: the following parameters are not yet saved/restored:
 *
 *   screen saver timeout
 *   cursor type
 *   mouse character and mouse show/hide state
 *   vty switching on/off state
 *   history buffer size
 *   history contents
 *   font maps
 */
Initialize revert data.
NOTE: the following parameters are not yet saved/restored.

screen saver timeout
cursor type
mouse character and mouse show/hide state
vty switching on/off state
history buffer size
history contents
font maps
Initialize revert data . NOTE : the following parameters are not yet saved / restored . screen saver timeout cursor type mouse character and mouse show / hide state vty switching on / off state history buffer size history contents font maps
static void
init(void)
{
	if (ioctl(0, VT_GETACTIVE, &cur_info.active_vty) == -1)
		errc(1, errno, "getting active vty");
	cur_info.console_info.size = sizeof(cur_info.console_info);
	if (ioctl(0, CONS_GETINFO, &cur_info.console_info) == -1)
		errc(1, errno, "getting console information");
	if (vt4_mode == 0 &&
	    ioctl(0, GIO_SCRNMAP, &cur_info.screen_map) == -1)
		errc(1, errno, "getting screen map");
	if (ioctl(0, CONS_GET, &cur_info.video_mode_number) == -1)
		errc(1, errno, "getting video mode number");
	cur_info.video_mode_info.vi_mode = cur_info.video_mode_number;
	if (ioctl(0, CONS_MODEINFO, &cur_info.video_mode_info) == -1)
		errc(1, errno, "getting video mode parameters");
	normal_fore_color = cur_info.console_info.mv_norm.fore;
	normal_back_color = cur_info.console_info.mv_norm.back;
	revers_fore_color = cur_info.console_info.mv_rev.fore;
	revers_back_color = cur_info.console_info.mv_rev.back;
}
static void init ( void ) { if ( ioctl ( 0 , VT_GETACTIVE , & cur_info . active_vty ) == -1 ) errc ( 1 , errno , " " ) ; cur_info . console_info . size = sizeof ( cur_info . console_info ) ; if ( ioctl ( 0 , CONS_GETINFO , & cur_info . console_info ) == -1 ) errc ( 1 , errno , " " ) ; if ( vt4_mode == 0 && ioctl ( 0 , GIO_SCRNMAP , & cur_info . screen_map ) == -1 ) errc ( 1 , errno , " " ) ; if ( ioctl ( 0 , CONS_GET , & cur_info . video_mode_number ) == -1 ) errc ( 1 , errno , " " ) ; cur_info . video_mode_info . vi_mode = cur_info . video_mode_number ; if ( ioctl ( 0 , CONS_MODEINFO , & cur_info . video_mode_info ) == -1 ) errc ( 1 , errno , " " ) ; normal_fore_color = cur_info . console_info . mv_norm . fore ; normal_back_color = cur_info . console_info . mv_norm . back ; revers_fore_color = cur_info . console_info . mv_rev . fore ; revers_back_color = cur_info . console_info . mv_rev . back ; }
Initialize revert data.
Initialize revert data .
/* vt(4) use unicode, so no screen mapping required. */