diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1999-12-28 15:58:00 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1999-12-28 15:58:00 +0000 |
commit | 29b9ba0641956d02f20ecf79f3c5012baf5bd8e8 (patch) | |
tree | c060b138de336bc24abca99acb5a4d7c2753dd31 /lib/libcurses/tinfo | |
parent | 031c7ae2dc97a1f984a63e6e5c37a962a15b01e2 (diff) |
Update to ncurses-19991218
o reorder tests during mouse initialization to allow for gpm to run in
xterm, or for xterm to be used under OS/2 EMX. Also drop test for
$DISPLAY in favor of kmous=\E[M or $TERM containing "xterm" (report
by Christian Weisgerber <naddy@mips.rhein-neckar.de>).
o modify raw() and noraw() to clear/restore IEXTEN flag which affects
stty lnext on systems such as FreeBSD (report by Bruce Evans
<bde@zeta.org.au>, via Jason Evans <jasone@canonware.com>).
o add manual-page for ncurses extensions, documented curses_version(),
use_extended_names().
Diffstat (limited to 'lib/libcurses/tinfo')
-rw-r--r-- | lib/libcurses/tinfo/lib_raw.c | 201 |
1 files changed, 103 insertions, 98 deletions
diff --git a/lib/libcurses/tinfo/lib_raw.c b/lib/libcurses/tinfo/lib_raw.c index fc414144c3a..c84fcde44de 100644 --- a/lib/libcurses/tinfo/lib_raw.c +++ b/lib/libcurses/tinfo/lib_raw.c @@ -1,7 +1,7 @@ -/* $OpenBSD: lib_raw.c,v 1.2 1999/03/11 21:03:57 millert Exp $ */ +/* $OpenBSD: lib_raw.c,v 1.3 1999/12/28 15:57:59 millert Exp $ */ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -33,7 +33,6 @@ * and: Eric S. Raymond <esr@snark.thyrsus.com> * ****************************************************************************/ - /* * raw.c * @@ -49,16 +48,16 @@ */ #include <curses.priv.h> -#include <term.h> /* cur_term */ +#include <term.h> /* cur_term */ -MODULE_ID("$From: lib_raw.c,v 1.3 1999/03/06 22:28:24 tom Exp $") +MODULE_ID("$From: lib_raw.c,v 1.5 1999/12/19 01:57:23 tom Exp $") #if defined(SVR4_TERMIO) && !defined(_POSIX_SOURCE) #define _POSIX_SOURCE #endif #if HAVE_SYS_TERMIO_H -#include <sys/termio.h> /* needed for ISC */ +#include <sys/termio.h> /* needed for ISC */ #endif #ifdef __EMX__ @@ -76,160 +75,166 @@ MODULE_ID("$From: lib_raw.c,v 1.3 1999/03/06 22:28:24 tom Exp $") #define AFTER(s) #endif /* TRACE */ -int raw(void) +int +raw(void) { - T((T_CALLED("raw()"))); - if (SP != 0 && cur_term != 0) { + T((T_CALLED("raw()"))); + if (SP != 0 && cur_term != 0) { - SP->_raw = TRUE; - SP->_cbreak = 1; + SP->_raw = TRUE; + SP->_cbreak = 1; #ifdef __EMX__ - setmode(SP->_ifd, O_BINARY); + setmode(SP->_ifd, O_BINARY); #endif #ifdef TERMIOS - BEFORE("raw"); - cur_term->Nttyb.c_lflag &= ~(ICANON|ISIG); - cur_term->Nttyb.c_iflag &= ~(COOKED_INPUT); - cur_term->Nttyb.c_cc[VMIN] = 1; - cur_term->Nttyb.c_cc[VTIME] = 0; - AFTER("raw"); + BEFORE("raw"); + cur_term->Nttyb.c_lflag &= ~(ICANON | ISIG | IEXTEN); + cur_term->Nttyb.c_iflag &= ~(COOKED_INPUT); + cur_term->Nttyb.c_cc[VMIN] = 1; + cur_term->Nttyb.c_cc[VTIME] = 0; + AFTER("raw"); #else - cur_term->Nttyb.sg_flags |= RAW; + cur_term->Nttyb.sg_flags |= RAW; #endif - returnCode(_nc_set_tty_mode(&cur_term->Nttyb)); - } - returnCode(ERR); + returnCode(_nc_set_tty_mode(&cur_term->Nttyb)); + } + returnCode(ERR); } -int cbreak(void) +int +cbreak(void) { - T((T_CALLED("cbreak()"))); + T((T_CALLED("cbreak()"))); - SP->_cbreak = 1; + SP->_cbreak = 1; #ifdef __EMX__ - setmode(SP->_ifd, O_BINARY); + setmode(SP->_ifd, O_BINARY); #endif #ifdef TERMIOS - BEFORE("cbreak"); - cur_term->Nttyb.c_lflag &= ~ICANON; - cur_term->Nttyb.c_iflag &= ~ICRNL; - cur_term->Nttyb.c_lflag |= ISIG; - cur_term->Nttyb.c_cc[VMIN] = 1; - cur_term->Nttyb.c_cc[VTIME] = 0; - AFTER("cbreak"); + BEFORE("cbreak"); + cur_term->Nttyb.c_lflag &= ~ICANON; + cur_term->Nttyb.c_iflag &= ~ICRNL; + cur_term->Nttyb.c_lflag |= ISIG; + cur_term->Nttyb.c_cc[VMIN] = 1; + cur_term->Nttyb.c_cc[VTIME] = 0; + AFTER("cbreak"); #else - cur_term->Nttyb.sg_flags |= CBREAK; + cur_term->Nttyb.sg_flags |= CBREAK; #endif - returnCode(_nc_set_tty_mode( &cur_term->Nttyb)); + returnCode(_nc_set_tty_mode(&cur_term->Nttyb)); } -void qiflush(void) +void +qiflush(void) { - T((T_CALLED("qiflush()"))); + T((T_CALLED("qiflush()"))); - /* - * Note: this implementation may be wrong. See the comment under - * intrflush(). - */ + /* + * Note: this implementation may be wrong. See the comment under + * intrflush(). + */ #ifdef TERMIOS - BEFORE("qiflush"); - cur_term->Nttyb.c_lflag &= ~(NOFLSH); - AFTER("qiflush"); - (void)_nc_set_tty_mode( &cur_term->Nttyb); - returnVoid; + BEFORE("qiflush"); + cur_term->Nttyb.c_lflag &= ~(NOFLSH); + AFTER("qiflush"); + (void) _nc_set_tty_mode(&cur_term->Nttyb); + returnVoid; #endif } - -int noraw(void) +int +noraw(void) { - T((T_CALLED("noraw()"))); + T((T_CALLED("noraw()"))); - SP->_raw = FALSE; - SP->_cbreak = 0; + SP->_raw = FALSE; + SP->_cbreak = 0; #ifdef __EMX__ - setmode(SP->_ifd, O_TEXT); + setmode(SP->_ifd, O_TEXT); #endif #ifdef TERMIOS - BEFORE("noraw"); - cur_term->Nttyb.c_lflag |= ISIG|ICANON; - cur_term->Nttyb.c_iflag |= COOKED_INPUT; - AFTER("noraw"); + BEFORE("noraw"); + cur_term->Nttyb.c_lflag |= ISIG | ICANON | + (cur_term->Ottyb.c_lflag & IEXTEN); + cur_term->Nttyb.c_iflag |= COOKED_INPUT; + AFTER("noraw"); #else - cur_term->Nttyb.sg_flags &= ~(RAW|CBREAK); + cur_term->Nttyb.sg_flags &= ~(RAW | CBREAK); #endif - returnCode(_nc_set_tty_mode( &cur_term->Nttyb)); + returnCode(_nc_set_tty_mode(&cur_term->Nttyb)); } - -int nocbreak(void) +int +nocbreak(void) { - T((T_CALLED("nocbreak()"))); + T((T_CALLED("nocbreak()"))); - SP->_cbreak = 0; + SP->_cbreak = 0; #ifdef __EMX__ - setmode(SP->_ifd, O_TEXT); + setmode(SP->_ifd, O_TEXT); #endif #ifdef TERMIOS - BEFORE("nocbreak"); - cur_term->Nttyb.c_lflag |= ICANON; - cur_term->Nttyb.c_iflag |= ICRNL; - AFTER("nocbreak"); + BEFORE("nocbreak"); + cur_term->Nttyb.c_lflag |= ICANON; + cur_term->Nttyb.c_iflag |= ICRNL; + AFTER("nocbreak"); #else - cur_term->Nttyb.sg_flags &= ~CBREAK; + cur_term->Nttyb.sg_flags &= ~CBREAK; #endif - returnCode(_nc_set_tty_mode( &cur_term->Nttyb)); + returnCode(_nc_set_tty_mode(&cur_term->Nttyb)); } -void noqiflush(void) +void +noqiflush(void) { - T((T_CALLED("noqiflush()"))); + T((T_CALLED("noqiflush()"))); - /* - * Note: this implementation may be wrong. See the comment under - * intrflush(). - */ + /* + * Note: this implementation may be wrong. See the comment under + * intrflush(). + */ #ifdef TERMIOS - BEFORE("noqiflush"); - cur_term->Nttyb.c_lflag |= NOFLSH; - AFTER("noqiflush"); - (void)_nc_set_tty_mode( &cur_term->Nttyb); - returnVoid; + BEFORE("noqiflush"); + cur_term->Nttyb.c_lflag |= NOFLSH; + AFTER("noqiflush"); + (void) _nc_set_tty_mode(&cur_term->Nttyb); + returnVoid; #endif } -int intrflush(WINDOW *win GCC_UNUSED, bool flag) +int +intrflush(WINDOW *win GCC_UNUSED, bool flag) { - T((T_CALLED("intrflush(%d)"), flag)); + T((T_CALLED("intrflush(%d)"), flag)); - /* - * This call does the same thing as the qiflush()/noqiflush() - * pair. We know for certain that SVr3 intrflush() tweaks the - * NOFLSH bit; on the other hand, the match (in the SVr4 man - * pages) between the language describing NOFLSH in termio(7) - * and the language describing qiflush()/noqiflush() in - * curs_inopts(3x) is too exact to be coincidence. - */ + /* + * This call does the same thing as the qiflush()/noqiflush() + * pair. We know for certain that SVr3 intrflush() tweaks the + * NOFLSH bit; on the other hand, the match (in the SVr4 man + * pages) between the language describing NOFLSH in termio(7) + * and the language describing qiflush()/noqiflush() in + * curs_inopts(3x) is too exact to be coincidence. + */ #ifdef TERMIOS - BEFORE("intrflush"); - if (flag) - cur_term->Nttyb.c_lflag &= ~(NOFLSH); - else - cur_term->Nttyb.c_lflag |= (NOFLSH); - AFTER("intrflush"); - returnCode(_nc_set_tty_mode( &cur_term->Nttyb)); + BEFORE("intrflush"); + if (flag) + cur_term->Nttyb.c_lflag &= ~(NOFLSH); + else + cur_term->Nttyb.c_lflag |= (NOFLSH); + AFTER("intrflush"); + returnCode(_nc_set_tty_mode(&cur_term->Nttyb)); #else - returnCode(ERR); + returnCode(ERR); #endif } |