xref: /illumos-gate/usr/src/lib/libxcurses/src/libc/xcurses/wattr_on.c (revision 9164a50bf932130cbb5097a16f6986873ce0e6e5)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1995, by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 /*
28  * wattr_on.c
29  *
30  * Copyright 1990, 1995 by Mortice Kern Systems Inc.  All rights reserved.
31  *
32  */
33 
34 #ifdef M_RCSID
35 #ifndef lint
36 static char rcsID[] = "$Header: /rd/src/libc/xcurses/rcs/wattr_on.c 1.3 1995/06/05 18:55:16 ant Exp $";
37 #endif
38 #endif
39 
40 #include <private.h>
41 
42 #undef wattr_on
43 
44 int
45 wattr_on(WINDOW *w, attr_t at, void *opts)
46 {
47 #ifdef M_CURSES_TRACE
48         __m_trace("wattr_on(%p, %x, %p)", w, at, opts);
49 #endif
50 
51 	w->_fg._at |= at;
52 
53 	return __m_return_code("wattr_on", OK);
54 }
55 
56 #undef wattr_off
57 
58 int
59 wattr_off(WINDOW *w, attr_t at, void *opts)
60 {
61 #ifdef M_CURSES_TRACE
62         __m_trace("wattr_off(%p, %x, %p)", w, at, opts);
63 #endif
64 
65 	w->_fg._at &= ~at;
66 
67 	return __m_return_code("wattr_off", OK);
68 }
69 
70 #undef wattr_set
71 
72 int
73 wattr_set(WINDOW *w, attr_t at, short co, void *opts)
74 {
75 #ifdef M_CURSES_TRACE
76         __m_trace("wattr_set(%p, %x, %d, %p)", w, at, co, opts);
77 #endif
78 
79 	w->_fg._co = co;
80 	w->_fg._at = at;
81 
82 	return __m_return_code("wattr_set", OK);
83 }
84 
85 #undef wattr_get
86 
87 int
88 wattr_get(WINDOW *w, attr_t *at, short *co, void *opts)
89 {
90 #ifdef M_CURSES_TRACE
91         __m_trace("wattr_get(%p, %p, %p, %p)", w, at, co, opts);
92 #endif
93 
94 	if (at != (attr_t *) 0)
95 		*at = w->_fg._at;
96 
97 	if (co != (short *) 0)
98 		*co = w->_fg._co;
99 
100 	return __m_return_int("wattr_get", OK);
101 }
102 
103 #undef wcolor_set
104 
105 int
106 wcolor_set(WINDOW *w, short co, void *opts)
107 {
108 #ifdef M_CURSES_TRACE
109         __m_trace("wcolor_set(%p, %d, %p)", w, co, opts);
110 #endif
111 
112 	w->_fg._co = co;
113 
114 	return __m_return_code("wcolor_set", OK);
115 }
116 
117 #undef wstandout
118 
119 int
120 wstandout(WINDOW *w)
121 {
122 #ifdef M_CURSES_TRACE
123         __m_trace("wstandout(%p)", w);
124 #endif
125 
126 	w->_fg._at |= WA_STANDOUT;
127 
128 	return __m_return_int("wstandout", 1);
129 }
130 
131 #undef wstandend
132 
133 int
134 wstandend(WINDOW *w)
135 {
136 #ifdef M_CURSES_TRACE
137         __m_trace("wstandend(%p)", w);
138 #endif
139 
140 	w->_fg._at = WA_NORMAL;
141 
142 	return __m_return_int("wstandend", 1);
143 }
144 
145