summaryrefslogtreecommitdiffstats
path: root/lib/libcurses/lib_raw.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1999-01-18 19:06:44 +0000
committermillert <millert@openbsd.org>1999-01-18 19:06:44 +0000
commit92dd1ec0a89df25171bc5d61a3d95ea1a68cef0b (patch)
treeb9d1f7bc0ea12a6176e04e01a28222b0364a79ec /lib/libcurses/lib_raw.c
parentupdates from ncurses-4.2-990116 (diff)
downloadwireguard-openbsd-92dd1ec0a89df25171bc5d61a3d95ea1a68cef0b.tar.xz
wireguard-openbsd-92dd1ec0a89df25171bc5d61a3d95ea1a68cef0b.zip
ncurses-4.2-990116
Diffstat (limited to 'lib/libcurses/lib_raw.c')
-rw-r--r--lib/libcurses/lib_raw.c235
1 files changed, 0 insertions, 235 deletions
diff --git a/lib/libcurses/lib_raw.c b/lib/libcurses/lib_raw.c
deleted file mode 100644
index 249cb834495..00000000000
--- a/lib/libcurses/lib_raw.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/* $OpenBSD: lib_raw.c,v 1.6 1998/11/17 03:16:21 millert Exp $ */
-
-/****************************************************************************
- * Copyright (c) 1998 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 *
- * "Software"), to deal in the Software without restriction, including *
- * without limitation the rights to use, copy, modify, merge, publish, *
- * distribute, distribute with modifications, sublicense, and/or sell *
- * copies of the Software, and to permit persons to whom the Software is *
- * furnished to do so, subject to the following conditions: *
- * *
- * The above copyright notice and this permission notice shall be included *
- * in all copies or substantial portions of the Software. *
- * *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
- * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
- * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
- * *
- * Except as contained in this notice, the name(s) of the above copyright *
- * holders shall not be used in advertising or otherwise to promote the *
- * sale, use or other dealings in this Software without prior written *
- * authorization. *
- ****************************************************************************/
-
-/****************************************************************************
- * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
- * and: Eric S. Raymond <esr@snark.thyrsus.com> *
- ****************************************************************************/
-
-
-/*
- * raw.c
- *
- * Routines:
- * raw()
- * cbreak()
- * noraw()
- * nocbreak()
- * qiflush()
- * noqiflush()
- * intrflush()
- *
- */
-
-#include <curses.priv.h>
-#include <term.h> /* cur_term */
-
-MODULE_ID("$From: lib_raw.c,v 1.1 1998/11/08 00:26:05 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 */
-#endif
-
-#ifdef __EMX__
-#include <io.h>
-#include <fcntl.h>
-#endif
-
-#define COOKED_INPUT (IXON|BRKINT|PARMRK)
-
-#ifdef TRACE
-#define BEFORE(N) if (_nc_tracing&TRACE_BITS) _tracef("%s before bits: %s", N, _nc_tracebits())
-#define AFTER(N) if (_nc_tracing&TRACE_BITS) _tracef("%s after bits: %s", N, _nc_tracebits())
-#else
-#define BEFORE(s)
-#define AFTER(s)
-#endif /* TRACE */
-
-int raw(void)
-{
- T((T_CALLED("raw()")));
- if (SP != 0 && cur_term != 0) {
-
- SP->_raw = TRUE;
- SP->_cbreak = TRUE;
-
-#ifdef __EMX__
- 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");
-#else
- cur_term->Nttyb.sg_flags |= RAW;
-#endif
- returnCode(_nc_set_curterm(&cur_term->Nttyb));
- }
- returnCode(ERR);
-}
-
-int cbreak(void)
-{
- T((T_CALLED("cbreak()")));
-
- SP->_cbreak = TRUE;
-
-#ifdef __EMX__
- 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");
-#else
- cur_term->Nttyb.sg_flags |= CBREAK;
-#endif
- returnCode(_nc_set_curterm( &cur_term->Nttyb));
-}
-
-void qiflush(void)
-{
- T((T_CALLED("qiflush()")));
-
- /*
- * 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_curterm( &cur_term->Nttyb);
- returnVoid;
-#endif
-}
-
-
-int noraw(void)
-{
- T((T_CALLED("noraw()")));
-
- SP->_raw = FALSE;
- SP->_cbreak = FALSE;
-
-#ifdef __EMX__
- 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");
-#else
- cur_term->Nttyb.sg_flags &= ~(RAW|CBREAK);
-#endif
- returnCode(_nc_set_curterm( &cur_term->Nttyb));
-}
-
-
-int nocbreak(void)
-{
- T((T_CALLED("nocbreak()")));
-
- SP->_cbreak = FALSE;
-
-#ifdef __EMX__
- setmode(SP->_ifd, O_TEXT);
-#endif
-
-#ifdef TERMIOS
- BEFORE("nocbreak");
- cur_term->Nttyb.c_lflag |= ICANON;
- cur_term->Nttyb.c_iflag |= ICRNL;
- AFTER("nocbreak");
-#else
- cur_term->Nttyb.sg_flags &= ~CBREAK;
-#endif
- returnCode(_nc_set_curterm( &cur_term->Nttyb));
-}
-
-void noqiflush(void)
-{
- T((T_CALLED("noqiflush()")));
-
- /*
- * 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_curterm( &cur_term->Nttyb);
- returnVoid;
-#endif
-}
-
-int intrflush(WINDOW *win GCC_UNUSED, bool 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.
- */
-
-#ifdef TERMIOS
- BEFORE("intrflush");
- if (flag)
- cur_term->Nttyb.c_lflag &= ~(NOFLSH);
- else
- cur_term->Nttyb.c_lflag |= (NOFLSH);
- AFTER("intrflush");
- returnCode(_nc_set_curterm( &cur_term->Nttyb));
-#else
- returnCode(ERR);
-#endif
-}