inch.c revision 1.2
11.2Sblymn/* $NetBSD: inch.c,v 1.2 2000/04/11 13:57:09 blymn Exp $ */ 21.2Sblymn 31.2Sblymn/*- 41.2Sblymn * Copyright (c) 1999 The NetBSD Foundation, Inc. 51.2Sblymn * All rights reserved. 61.2Sblymn * 71.2Sblymn * This code is derived from software contributed to The NetBSD Foundation 81.2Sblymn * by Julian Coleman. 91.2Sblymn * 101.2Sblymn * Redistribution and use in source and binary forms, with or without 111.2Sblymn * modification, are permitted provided that the following conditions 121.2Sblymn * are met: 131.2Sblymn * 1. Redistributions of source code must retain the above copyright 141.2Sblymn * notice, this list of conditions and the following disclaimer. 151.2Sblymn * 2. Redistributions in binary form must reproduce the above copyright 161.2Sblymn * notice, this list of conditions and the following disclaimer in the 171.2Sblymn * documentation and/or other materials provided with the distribution. 181.2Sblymn * 3. All advertising materials mentioning features or use of this software 191.2Sblymn * must display the following acknowledgement: 201.2Sblymn * This product includes software developed by the NetBSD 211.2Sblymn * Foundation, Inc. and its contributors. 221.2Sblymn * 4. Neither the name of The NetBSD Foundation nor the names of its 231.2Sblymn * contributors may be used to endorse or promote products derived 241.2Sblymn * from this software without specific prior written permission. 251.2Sblymn * 261.2Sblymn * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 271.2Sblymn * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 281.2Sblymn * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 291.2Sblymn * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 301.2Sblymn * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 311.2Sblymn * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 321.2Sblymn * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 331.2Sblymn * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 341.2Sblymn * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 351.2Sblymn * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 361.2Sblymn * POSSIBILITY OF SUCH DAMAGE. 371.2Sblymn */ 381.2Sblymn 391.2Sblymn#include "curses.h" 401.2Sblymn#include "curses_private.h" 411.2Sblymn 421.2Sblymn/* 431.2Sblymn * winch -- 441.2Sblymn * Return character at cursor position. 451.2Sblymn */ 461.2Sblymnchtype 471.2Sblymnwinch(win) 481.2Sblymn WINDOW *win; 491.2Sblymn{ 501.2Sblymn 511.2Sblymn chtype ch; 521.2Sblymn 531.2Sblymn ch = (chtype) (((win)->lines[(win)->cury]->line[(win)->curx].ch & __CHARTEXT) | 541.2Sblymn (chtype) ((win)->lines[(win)->cury]->line[(win)->curx].attr & __ATTRIBUTES)); 551.2Sblymn return (ch); 561.2Sblymn} 57