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 * attr_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/attr_on.c 1.5 1995/07/10 16:09:09 ant Exp $"; 37 #endif 38 #endif 39 40 #include <private.h> 41 42 int 43 (attr_on)(attr_t at, void *opts) 44 { 45 #ifdef M_CURSES_TRACE 46 __m_trace("attr_on(%x, %p)", at, opts); 47 #endif 48 49 stdscr->_fg._at |= at; 50 51 return __m_return_code("attr_on", OK); 52 } 53 54 int 55 (attr_off)(attr_t at, void *opts) 56 { 57 #ifdef M_CURSES_TRACE 58 __m_trace("attr_off(%x, %p)", at, opts); 59 #endif 60 61 stdscr->_fg._at &= ~at; 62 63 return __m_return_code("attr_off", OK); 64 } 65 66 int 67 (attr_set)(attr_t at, short co, void *opts) 68 { 69 #ifdef M_CURSES_TRACE 70 __m_trace("attr_set(%x, %d, %p)", at, co, opts); 71 #endif 72 73 stdscr->_fg._co = co; 74 stdscr->_fg._at = at; 75 76 return __m_return_code("attr_set", OK); 77 } 78 79 int 80 (color_set)(short co, void *opts) 81 { 82 #ifdef M_CURSES_TRACE 83 __m_trace("color_set(%d, %p)", co, opts); 84 #endif 85 86 stdscr->_fg._co = co; 87 88 return __m_return_code("color_set", OK); 89 } 90 91 int 92 (attr_get)(attr_t *at, short *co, void *opts) 93 { 94 #ifdef M_CURSES_TRACE 95 __m_trace("attr_get(%p, %p, %p)", at, co, opts); 96 #endif 97 98 if (at != (attr_t *) 0) 99 *at = stdscr->_fg._at; 100 101 if (co != (short *) 0) 102 *co = stdscr->_fg._co; 103 104 return __m_return_int("attr_get", OK); 105 } 106 107 int 108 (standout)() 109 { 110 #ifdef M_CURSES_TRACE 111 __m_trace("standout(void)"); 112 #endif 113 114 stdscr->_fg._at |= WA_STANDOUT; 115 116 return __m_return_int("standout", 1); 117 } 118 119 int 120 (standend)() 121 { 122 #ifdef M_CURSES_TRACE 123 __m_trace("standend(void)"); 124 #endif 125 126 stdscr->_fg._at = WA_NORMAL; 127 128 return __m_return_int("standend", 1); 129 } 130 131