vcurrent.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 1986 AT&T
* All Rights Reserved
*/
#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.7 */
#include <curses.h>
#include "wish.h"
#include "vt.h"
#include "vtdefs.h"
#include "color_pair.h"
/* vt which is in "front" of others (and head of linked list) */
/* tail of linked list */
/* vt which is "current" (ie operations default to this one) */
/*
* makes the given vt current and in front of all others (also makes
* old vt noncurrent if there is a current one
*/
{
register vt_id n;
register struct vt *v;
/* debug stuff
fprintf( stderr, "\t\t\t\t\tInto vt_current( %d )\n", vid );
fprintf( stderr, "VT_front = %d\n", VT_front );
fprintf( stderr, "VT_back = %d\n", VT_back );
fprintf( stderr, "VT_curid = %d\n\n", VT_curid );
for ( n = VT_front; n != VT_UNDEFINED; n = v->next )
{
v = &VT_array[ n ];
fprintf( stderr, "prev = %d\n", v->prev );
fprintf( stderr, "VT_array index = %d\n", n );
fprintf( stderr, "next = %d\n\n", v->next );
}
*/
return VT_curid;
/*
* makes current vt noncurrent
*/
if (VT_curid >= 0) {
/*
* for color terminals, border should also be marked dirty
* on NON-currency.
*/
}
/*
* moves vt to front (without making it current)
*/
{
{
v = &VT_array[n];
{
else
{
}
break;
}
}
if ( VT_front != VT_UNDEFINED )
}
/*
* makes vt current without moving it to front
*/
/*
* for color terminals, border should also be marked dirty
* on NON-currency.
*/
if ((!(v->flags & VT_NOBORDER)) &&
/* debug stuff
fprintf( stderr, "\t\t\tAfter change\n" );
fprintf( stderr, "VT_front = %d\n", VT_front );
fprintf( stderr, "VT_back = %d\n", VT_back );
fprintf( stderr, "VT_curid = %d\n\n", VT_curid );
for ( n = VT_front; n != VT_UNDEFINED; n = v->next )
{
v = &VT_array[ n ];
fprintf( stderr, "prev = %d\n", v->prev );
fprintf( stderr, "VT_array index = %d\n", n );
fprintf( stderr, "next = %d\n\n", v->next );
}
*/
return oldvid;
}
/* used for debugging (LES)
pr_VT_array()
{
FILE *fp, *fopen();
struct vt *v;
int n;
fp = fopen( "VT_ARRAY", "a" );
fprintf( fp, "\nVT_front = %d\n", VT_front );
fprintf( fp, "VT_back = %d\n", VT_back );
fprintf( fp, "VT_curid = %d\n\n", VT_curid );
for ( n = VT_front; n != VT_UNDEFINED; n = v->next )
{
v = &VT_array[ n ];
fprintf( fp, "VT_array index = %d\n", n );
fprintf( fp, "next = %d\n", v->next );
fprintf( fp, "prev = %d\n\n", v->prev );
}
fclose( fp );
}
*/