lib_wattron.c revision 50276
1104445Smdodd/****************************************************************************
2104445Smdodd * Copyright (c) 1998 Free Software Foundation, Inc.                        *
3104445Smdodd *                                                                          *
4119418Sobrien * Permission is hereby granted, free of charge, to any person obtaining a  *
5119418Sobrien * copy of this software and associated documentation files (the            *
6119418Sobrien * "Software"), to deal in the Software without restriction, including      *
7104445Smdodd * without limitation the rights to use, copy, modify, merge, publish,      *
8104445Smdodd * distribute, distribute with modifications, sublicense, and/or sell       *
9104445Smdodd * copies of the Software, and to permit persons to whom the Software is    *
10104445Smdodd * furnished to do so, subject to the following conditions:                 *
11104445Smdodd *                                                                          *
12104445Smdodd * The above copyright notice and this permission notice shall be included  *
13104445Smdodd * in all copies or substantial portions of the Software.                   *
14104445Smdodd *                                                                          *
15104445Smdodd * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16104445Smdodd * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17104547Sbde * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18104445Smdodd * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19104445Smdodd * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20104445Smdodd * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21104445Smdodd * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22104445Smdodd *                                                                          *
23104445Smdodd * Except as contained in this notice, the name(s) of the above copyright   *
24104445Smdodd * holders shall not be used in advertising or otherwise to promote the     *
25104445Smdodd * sale, use or other dealings in this Software without prior written       *
26104445Smdodd * authorization.                                                           *
27104445Smdodd ****************************************************************************/
28104445Smdodd
29104445Smdodd/****************************************************************************
30104445Smdodd *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
31104445Smdodd *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
32104445Smdodd ****************************************************************************/
33104445Smdodd
34104445Smdodd/*
35104445Smdodd**	lib_wattron.c
36104445Smdodd**
37104445Smdodd**	The routines wattr_on().
38104445Smdodd**
39104445Smdodd*/
40104445Smdodd
41104445Smdodd#include <curses.priv.h>
42104445Smdodd#include <ctype.h>
43104445Smdodd
44104445SmdoddMODULE_ID("$Id: lib_wattron.c,v 1.4 1998/05/10 12:02:28 tom Exp $")
45104445Smdodd
46104445Smdoddint wattr_on(WINDOW *win, NCURSES_CONST attr_t at, void *opts GCC_UNUSED)
47104445Smdodd{
48104445Smdodd	T((T_CALLED("wattr_on(%p,%s)"), win, _traceattr(at)));
49104445Smdodd	if (win) {
50104445Smdodd		T(("... current %s", _traceattr(win->_attrs)));
51104445Smdodd		toggle_attr_on(win->_attrs,at);
52104445Smdodd		returnCode(OK);
53104445Smdodd	} else
54104445Smdodd		returnCode(ERR);
55104445Smdodd}
56104445Smdodd