/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1995-1999 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/* LINTLIBRARY */
/*
*
* XCurses Library
*
* Copyright 1990, 1995 by Mortice Kern Systems Inc. All rights reserved.
*
*/
#ifdef M_RCSID
#ifndef lint
static char const rcsID[] =
"$Header: /team/ps/sun_xcurses/archive/local_changes/xcurses/src/lib/"
"cbates Exp $";
#endif
#endif
#include <sys/isa_defs.h>
#include <private.h>
#include <m_wio.h>
#include <errno.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
/*
* Assume terminal has only one screen line by restricting those
* capabilities that assume more than one line. This function must
* be called before initscr() or newterm().
*
* This flag will reset after initscr() or newterm() so that subsequent
* calls to newterm(), without a preceding call to filter(), will load
* an unmodified terminal. THIS IS NOT HISTORICAL PRACTICE, BUT DEEMED
* USEFUL.
*/
void
filter(void)
{
}
/*
* SIGTSTP Handler.
*/
/* ARGSUSED */
void
{
#ifdef SIGTSTP
/*
* Only permit SIGTSTP if the curent process is the process
* group leader. If the process is not the current group
* leader, then suspending the current process will suspend
* other members of the process group, such as the parent
* process.
*/
(void) endwin();
#ifdef SIG_UNBLOCK
{
(void) sigemptyset(&unblock);
(sigset_t *) 0);
}
#endif /* SIG_UNBLOCK */
} else {
(void) beep();
}
#else /* no SIGTSTP */
(void) beep();
#endif /* SIGTSTP */
}
/*
* Do real soft label key initialisation once setupterm() have been called
* to load the current terminal. Determine whether the terminal supplies
* soft label keys, or whether we have to fake it by using the last line
* of a terminal screen.
*/
/* ARGSUSED */
int
{
int code;
/* Does the terminal have a method to program the soft label key? */
goto done;
}
/* We have to fake it. */
if (lines < 2)
goto done;
goto done;
/* Test suite seems to expect this */
(void) ripoffline(-1, 0);
done:
return (code);
}
/*
* The XCurses specification is unclear how ripoffline() would
* affect newterm(). We assume that it can't be used with newterm()
* and that it only affects initscr(), which is responsible for
* creating stdscr.
*/
/*
* If line is positive (1), one line is removed from the beginning of
* stdscr; else if line is negative (-1), one line is removed from the end.
*/
int
{
int i;
if (line != 0 && i < M_CURSES_MAX_RIPOFFLINE) {
if (line < 0)
else
}
return (OK);
}
/*
* Create a new terminal screen. Used if a program is going to be sending
* output to more than one terminal. It returns a SCREEN* for the terminal.
* The parameters are a terminal name, output FILE*, and input FILE*. If
* the terminal name is null then $TERM is used. The program must also
* call endwin() for each terminal being used before exiting from curses.
* If newterm() is called more than once for the same terminal, the first
* terminal referred to must be the last one for which endwin() is called.
*/
SCREEN *
{
WINDOW *w;
int i, n, y, errret;
/*
* Input stream should be unbuffered so that m_tfgetc() works
* correctly on BSD and SUN systems.
*/
#if 0
/*
* Not sure whether we really want to concern ourselves with the output
* buffer scheme. Might be best to leave it upto the application to
* deal with buffer schemes and when to perform flushes.
*
* MKS Vi uses MKS Curses and so must support the ability to switch in
* and out of Curses mode when switching from Vi to Ex and back.
* Problem is that in Vi mode you would prefer full buffered output to
* give updates a smoother appearance and Ex mode you require line
* buffered in order to see prompts and messages.
*/
#endif
errno = 0;
== ERR) {
switch (errret) {
case -1:
break;
case 2:
break;
case 0:
default:
break;
}
goto error1;
}
if (__m_doupdate_init())
goto error1;
goto error1;
/*
* Maximum length of a multbyte key sequence, including
* multibyte characters and terminal function keys.
*/
goto error2;
goto error2;
/* Setup wide input for XCurses. */
if (assume_one_line) {
/* Assume only one line. */
lines = 1;
/* Disable capabilities that assume more than one line. */
/* Re-evaluate the cursor motion costs. */
/* Reset flag for subsequent calls to newterm(). */
}
goto error2;
goto error2;
#if defined(_LP64)
#else
#endif
goto error2;
goto error2;
}
/*
* doupdate() will perform the final screen preparations like
* enter_ca_mode, reset_prog_mode() (to assert the termios
* changes), etc.
*/
#ifdef SIGTSTP
#endif
/* Assert that __m_screen is set to the new terminal. */
/* Disable echo in tty driver, Curses does software echo. */
/* Enable mappnig of cr -> nl on input and nl -> crlf on output. */
#ifdef ONLCR
#endif
#ifdef TAB0
/* Use real tabs. */
#endif
/*
* Default to 'cbreak' mode as per
* test /tset/CAPIxcurses/fcbreak/fcbreak1{4}
*/
/*
* Default to 'idcok' mode as per
* test /tset/CAPIxcurses/fidcok/fidcok1{3}
*/
(void) __m_tty_set_prog_mode();
(void) __m_set_echo(1);
(void) __m_slk_clear(1);
goto error3;
}
/*
* Create and initialise ripped off line windows.
* It is the application's responsiblity to free the
* windows when the application terminates.
*/
for (i = 0; i < n; ++i) {
continue;
if (y < 0)
y += lines;
w = newwin(1, 0, y, 0);
}
return (sp);
return (NULL);
}
/*
* Free storage associated with a screen structure.
* NOTE endwin() does not do this.
*/
void
{
}
}
/*
* Switch current terminal for Curses layer.
*/
SCREEN *
{
__m_screen = screen;
COLORS = max_colors;
}
return (osp);
}
int
{
if (fd != -1) {
} else {
}
}
return (OK);
}
int
{
int old;
if (bf)
return (old);
}