/*
* 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) 1995, by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
*
* XCurses Library
*
* Copyright 1990, 1995 by Mortice Kern Systems Inc. All rights reserved.
*
*/
#ifdef M_RCSID
#ifndef lint
static char rcsID[] = "$Header: /rd/src/libc/xcurses/rcs/vid_puts.c 1.5 1995/07/19 16:38:26 ant Exp $";
#endif
#endif
#include <private.h>
#include <limits.h>
/*
* Return true if attribute X a member of the attribute set A.
* no_color_video is the set of attributes that cannot be combined
* with colours.
*/
/*f
* Set the desired attribute state for a terminal screen.
*
* Using set_attributes is the prefered method but requires some care
* in writing the proper terminfo string. Using exit_attribute_mode and
* the assorted enter_ attribute mode capabilities is the next best method.
* Finally using the assorted exit_ and enter_ attribute mode capabilities
* is the last method available and is not necessarily efficent (or smart
* because of the needs of ceol_standout_glitch support).
*/
int
{
#ifdef M_CURSES_TRACE
#endif
/* Assume that <set_attributes> disables attributes
* then re-enables attributes that are to be on.
*/
(void) tputs(
),
1, putout
);
ATTR_STATE &= ~WA_SGR_MASK;
/* Only use <set_a_attributes> when <set_attributes>
* is defined. <set_a_attributes> should not disable
* attributes, as this will have been handled by
* <set_attributes>.
*/
(void) tputs(
0L, 0L, 0L
),
);
ATTR_STATE &= ~WA_SGR1_MASK;
}
} else if (ATTR_STATE != attr) {
/* Turn off only those attributes that are on. */
/* Turn on attributes regardless if they are already
* on, because terminals with ceol_standout_glitch, like
* HP terminals, will have to re-enforce the current
* attributes in order to change existing attribute
* cookies on the screen.
*/
}
/* A_NORMAL equals 0, which is all attributes off and
* COLOR_PAIR(0). This implies that colour pair 0 is
* the orig_pair.
*/
if (orig_pair != (char *) 0)
pair = 0;
if (set_color_pair != (char *) 0) {
(void) tputs(
set_color_pair, (long) pair,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L
),
1, putout
);
if (set_foreground != (char *) 0) {
(void) tputs(
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L
),
1, putout
);
} else if (set_a_foreground != (char *) 0) {
(void) tputs(
set_a_foreground, (long) fg,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L
),
1, putout
);
}
if (set_background != (char *) 0) {
(void) tputs(
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L
),
1, putout
);
} else if (set_a_background != (char *) 0) {
(void) tputs(
set_a_background, (long) bg,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L
),
1, putout
);
}
}
}
/* Remember the current attribute state for the terminal. */
ATTR_STATE = attr;
}
{
if (exit_attribute_mode != (char *) 0) {
} else {
&& exit_underline_mode != (char *) 0) {
new &= ~WA_UNDERLINE;
}
&& exit_standout_mode != (char *) 0) {
new &= ~WA_STANDOUT;
}
&& exit_alt_charset_mode != (char *) 0) {
new &= ~WA_ALTCHARSET;
}
}
return new;
}
{
&& enter_alt_charset_mode != (char *) 0) {
new |= WA_ALTCHARSET;
}
}
}
}
}
new |= WA_PROTECT;
}
new |= WA_REVERSE;
}
new |= WA_STANDOUT;
}
new |= WA_UNDERLINE;
}
&& enter_horizontal_hl_mode != (char *) 0) {
new |= WA_HORIZONTAL;
}
}
}
}
}
new |= WA_VERTICAL;
}
return new;
}