snapshot of project "ncurses", label v1_9_9e_e309_960727

This commit is contained in:
Thomas E. Dickey 1996-07-28 01:13:48 -04:00
parent 3f514f98a1
commit fb68bc05a2
8 changed files with 918 additions and 355 deletions

12
NEWS
View File

@ -3,6 +3,14 @@ started working with Pavel Curtis' original work, pcurses, in 1992:
### ncurses-1.9.9e -> 1.9.9?
960727 - snapshot
+ call cbreak() in initscr(), as per XSI & SVr4.
+ turn off hardware echo in initscr() as per XSI & SVr4
> patch 309 by eric:
+ terminfo changes (9.3.10), from BRL
+ add more checks to terminfo parser.
+ add more symbols to infocmp.
960720 - snapshot
+ save previous-attribute in lib_vidattr.c if SP is null (reported by
Ju"rgen Fluk <louis@dachau.marco.de>)
@ -16,7 +24,7 @@ started working with Pavel Curtis' original work, pcurses, in 1992:
include therein).
+ move the ifdefs for errno into curses.priv.h
> patch 308 by eric:
+ terminfo changes (9.3.18)
+ terminfo changes (9.3.8)
+ modified logic of error-reporting in terminfo parser
960713 - snapshot
@ -83,7 +91,7 @@ started working with Pavel Curtis' original work, pcurses, in 1992:
960622 - snapshot
+ modified logic that wraps cursor in addch to follow the XSI spec,
(implemented in svr4) which states that the cursor position is
(implemented in SVr4) which states that the cursor position is
updated when wrapping. Renamed _NEED_WRAP to _WRAPPED to reflect the
actual semantics.
+ added -s option to tic, to provide better diagnostics in run_tic.sh

File diff suppressed because it is too large Load Diff

View File

@ -44,6 +44,8 @@
#include "term.h"
#include "term_entry.h"
MODULE_ID("$Id: comp_parse.c,v 1.12 1996/07/28 00:11:46 tom Exp $")
static void sanity_check(TERMTYPE *);
/****************************************************************************
@ -435,39 +437,55 @@ int _nc_resolve_uses(void)
static void sanity_check(TERMTYPE *tp)
{
#ifdef __UNUSED__ /* this casts too wide a net */
bool terminal_entry = !strchr(tp->term_names, '+');
#endif
if (!PRESENT(exit_attribute_mode))
{
#ifdef __UNUSED__ /* this casts too wide a net */
if (terminal_entry &&
(PRESENT(set_attributes)
|| PRESENT(enter_standout_mode)
|| PRESENT(enter_underline_mode)
|| PRESENT(enter_blink_mode)
|| PRESENT(enter_bold_mode)
|| PRESENT(enter_dim_mode)
|| PRESENT(enter_secure_mode)
|| PRESENT(enter_protected_mode)
|| PRESENT(enter_standout_mode)
|| PRESENT(enter_underline_mode)
|| PRESENT(enter_blink_mode)
|| PRESENT(enter_bold_mode)
|| PRESENT(enter_dim_mode)
|| PRESENT(enter_secure_mode)
|| PRESENT(enter_protected_mode)
|| PRESENT(enter_reverse_mode)))
_nc_warning("no exit_attribute_mode");
#endif /* __UNUSED__ */
PAIRED(enter_alt_charset_mode, exit_alt_charset_mode)
PAIRED(enter_standout_mode, exit_standout_mode)
PAIRED(enter_underline_mode, exit_underline_mode)
}
/* allow entries like guru+s to hack rmcup but not smcup */
if (terminal_entry)
ANDMISSING(exit_ca_mode, enter_ca_mode)
/* listed in structure-member order of first argument */
#ifdef __UNUSED__
ANDMISSING(cursor_invisible, cursor_normal)
ANDMISSING(cursor_visible, cursor_normal)
#endif /* __UNUSED__ */
PAIRED(enter_alt_charset_mode, exit_alt_charset_mode)
ANDMISSING(enter_alt_charset_mode, acs_chars)
ANDMISSING(exit_alt_charset_mode, acs_chars)
ANDMISSING(enter_blink_mode, exit_attribute_mode)
ANDMISSING(enter_bold_mode, exit_attribute_mode)
PAIRED(exit_ca_mode, enter_ca_mode)
PAIRED(enter_delete_mode, exit_delete_mode)
ANDMISSING(enter_dim_mode, exit_attribute_mode)
PAIRED(enter_insert_mode, exit_insert_mode)
ANDMISSING(enter_secure_mode, exit_attribute_mode)
ANDMISSING(enter_protected_mode, exit_attribute_mode)
ANDMISSING(enter_reverse_mode, exit_attribute_mode)
PAIRED(from_status_line, to_status_line)
PAIRED(meta_off, meta_on)
PAIRED(from_status_line, to_status_line)
PAIRED(prtr_on, prtr_off)
PAIRED(enter_xon_mode, exit_xon_mode)
ANDMISSING(label_off, label_on)
PAIRED(display_clock, remove_clock)
ANDMISSING(enter_alt_charset_mode, acs_chars)
ANDMISSING(exit_alt_charset_mode, acs_chars)
PAIRED(prtr_on, prtr_off)
PAIRED(save_cursor, restore_cursor)
PAIRED(enter_xon_mode, exit_xon_mode)
PAIRED(enter_am_mode, exit_am_mode)
ANDMISSING(label_off, label_on)
PAIRED(display_clock, remove_clock)
#undef PAIRED
#undef ANDMISSING
}

View File

@ -30,7 +30,7 @@
#include <ctype.h>
#include <unctrl.h>
MODULE_ID("$Id: lib_addch.c,v 1.17 1996/07/21 00:16:27 tom Exp $")
MODULE_ID("$Id: lib_addch.c,v 1.18 1996/07/27 23:46:41 tom Exp $")
int wattr_on(WINDOW *win, const attr_t at)
{
@ -146,7 +146,7 @@ register int x, y;
* whenever we move the cursor. If we try to wrap at the
* lower-right corner of a window, we cannot move the cursor
* (since that wouldn't be legal). So we return an error
* (which is what svr4 does). Unlike svr4, we can successfully
* (which is what SVr4 does). Unlike svr4, we can successfully
* add a character to the lower-right corner.
*/
win->_flags |= _WRAPPED;

View File

@ -27,9 +27,40 @@
*/
#include <curses.priv.h>
#include <term.h> /* cur_term */
#include <string.h>
#if HAVE_SYS_TERMIO_H
#include <sys/termio.h> /* needed for ISC */
#endif
MODULE_ID("$Id: lib_initscr.c,v 1.9 1996/07/28 00:06:55 tom Exp $")
/*
* SVr4/XSI Curses specify that hardware echo is turned off in initscr, and not
* restored during the curses session. The library simulates echo in software.
* (The behavior is unspecified if the application enables hardware echo).
*/
static int _nc_initscr(void)
{
/* for extended XPG4 conformance requires cbreak() at this point */
/* (SVr4 curses does this anyway) */
cbreak();
#ifdef TERMIOS
cur_term->Nttyb.c_lflag &= ~(ECHO|ECHONL);
if((tcsetattr(cur_term->Filedes, TCSANOW, &cur_term->Nttyb)) == -1)
return ERR;
else
return OK;
#else
cur_term->Nttyb.sg_flags &= ~ECHO;
stty(cur_term->Filedes, &cur_term->Nttyb);
return OK;
#endif
}
WINDOW *initscr(void)
{
char *name = getenv("TERM");
@ -46,13 +77,9 @@ char *name = getenv("TERM");
ESCDELAY = atoi(getenv("ESCDELAY"));
def_shell_mode();
#ifdef _XOPEN_SOURCE_EXTENDED
/* for extended XPG4 conformance requires cbreak() at this point */
cbreak();
#endif /* _XOPEN_SOURCE_EXTENDED */
_nc_initscr();
def_prog_mode();
return(stdscr);
}

View File

@ -38,10 +38,13 @@
*
*/
#include "curses.priv.h"
#include "term.h" /* cur_term */
#include <curses.priv.h>
#include <term.h> /* cur_term */
#include <string.h>
MODULE_ID("$Id: lib_raw.c,v 1.9 1996/07/28 00:36:48 tom Exp $")
#ifdef __QNX__ /* Allows compilation under the QNX 4.2 OS */
#define ONLCR 0
#endif
@ -166,7 +169,7 @@ lflags[] =
for (sp = iflags; sp->val; sp++)
if ((cur_term->Nttyb.c_iflag & sp->val) == sp->val)
{
(void) strcat(buf, sp->name);
(void) strcat(buf, sp->name);
(void) strcat(buf, ", ");
}
if (buf[strlen(buf) - 2] == ',')
@ -312,6 +315,7 @@ int cbreak(void)
BEFORE("cbreak");
cur_term->Nttyb.c_lflag &= ~ICANON;
cur_term->Nttyb.c_lflag |= ISIG;
cur_term->Nttyb.c_iflag &= ~ICRNL;
cur_term->Nttyb.c_cc[VMIN] = 1;
cur_term->Nttyb.c_cc[VTIME] = 0;
AFTER("cbreak");
@ -332,19 +336,7 @@ int echo(void)
SP->_echo = TRUE;
#ifdef TERMIOS
BEFORE("echo");
cur_term->Nttyb.c_lflag |= ECHO;
AFTER("echo");
if((tcsetattr(cur_term->Filedes, TCSANOW, &cur_term->Nttyb)) == -1)
return ERR;
else
return OK;
#else
cur_term->Nttyb.sg_flags |= ECHO;
stty(cur_term->Filedes, &cur_term->Nttyb);
return OK;
#endif
}
@ -430,6 +422,7 @@ int nocbreak(void)
#ifdef TERMIOS
BEFORE("nocbreak");
cur_term->Nttyb.c_lflag |= ICANON;
cur_term->Nttyb.c_iflag |= ICRNL;
AFTER("nocbreak");
if((tcsetattr(cur_term->Filedes, TCSANOW, &cur_term->Nttyb)) == -1)
return ERR;
@ -445,26 +438,8 @@ int nocbreak(void)
int noecho(void)
{
T(("noecho() called"));
SP->_echo = FALSE;
#ifdef TERMIOS
/*
* Turn off ECHONL to avoid having \n still be echoed when
* cooked mode is in effect (that is, ICANON is on).
*/
BEFORE("noecho");
cur_term->Nttyb.c_lflag &= ~(ECHO|ECHONL);
AFTER("noecho");
if((tcsetattr(cur_term->Filedes, TCSANOW, &cur_term->Nttyb)) == -1)
return ERR;
else
return OK;
#else
cur_term->Nttyb.sg_flags &= ~ECHO;
stty(cur_term->Filedes, &cur_term->Nttyb);
return OK;
#endif
}

View File

@ -315,6 +315,7 @@ static const assoc std_caps[] =
{"\0338", "RC"}, /* restore cursor */
{"\033[r", "RSR"}, /* not an X.364 mnemonic */
{"\033[m", "SGR0"}, /* not an X.364 mnemonic */
{"\033[2J", "ED2"}, /* clear page */
/* this group is specified by ISO 2022 */
{"\033(0", "ISO DEC G0"}, /* enable DEC graphics for G0 */
@ -351,13 +352,34 @@ static const assoc ecma_highlights[] =
{
{"0", "NORMAL"}, /* normal */
{"1", "+BOLD"}, /* bold on */
{"21", "-BOLD"}, /* bold on */
{"2", "+DIM"}, /* dim on */
{"3", "+ITALIC"}, /* italic on */
{"4", "+UNDERLINE"}, /* underline on */
{"24", "-UNDERLINE"}, /* underline on */
{"5", "+BLINK"}, /* blink on */
{"25", "-BLINK"}, /* blink on */
{"6", "+FASTBLINK"}, /* fastblink on */
{"7", "+REVERSE"}, /* reverse on */
{"27", "-REVERSE"}, /* reverse on */
{"8", "+INVISIBLE"}, /* invisible on */
{"9", "+DELETED"}, /* deleted on */
{"10", "MAIN-FONT"}, /* select primary font */
{"11", "ALT-FONT-1"}, /* select alternate font 1 */
{"12", "ALT-FONT-2"}, /* select alternate font 2 */
{"13", "ALT-FONT-3"}, /* select alternate font 3 */
{"14", "ALT-FONT-4"}, /* select alternate font 4 */
{"15", "ALT-FONT-5"}, /* select alternate font 5 */
{"16", "ALT-FONT-6"}, /* select alternate font 6 */
{"17", "ALT-FONT-7"}, /* select alternate font 7 */
{"18", "ALT-FONT-1"}, /* select alternate font 1 */
{"19", "ALT-FONT-1"}, /* select alternate font 1 */
{"20", "FRAKTUR"}, /* Fraktur font */
{"21", "DOUBLEUNDER"}, /* double underline */
{"22", "-DIM"}, /* dim off */
{"23", "-ITALIC"}, /* italic off */
{"24", "-UNDERLINE"}, /* underline off */
{"25", "-BLINK"}, /* blink off */
{"26", "-FASTBLINK"}, /* fastblink off */
{"27", "-REVERSE"}, /* reverse off */
{"28", "-INVISIBLE"}, /* invisible off */
{"29", "-DELETED"}, /* deleted off */
{(char *)0, (char *)0}
};
@ -1035,6 +1057,8 @@ int main(int argc, char *argv[])
analyze_string("rs1", reset_1string, &term[0]);
analyze_string("rs2", reset_2string, &term[0]);
analyze_string("rs3", reset_3string, &term[0]);
analyze_string("smcup", enter_ca_mode, &term[0]);
analyze_string("rmcup", exit_ca_mode, &term[0]);
#undef CUR
return EXIT_SUCCESS;
}

View File

@ -14,7 +14,7 @@ AUTHOR
It is issued with ncurses under the same terms and conditions as the ncurses
library source.
$Id: ncurses.c,v 1.42 1996/07/21 00:24:15 tom Exp $
$Id: ncurses.c,v 1.44 1996/07/28 01:13:48 tom Exp $
***************************************************************************/
/*LINTLIBRARY */
@ -1886,11 +1886,12 @@ static void input_test(WINDOW *win)
*/
mvwaddstr(win, 6, 2, "Enter a number then a string separated by space");
echo();
mvwscanw(win, 7, 6, "%d %s", &num,buffer);
mvwprintw(win, 8, 6, "String: %s Number: %d", buffer,num);
if (mvwscanw(win, 7, 6, "%d %s", &num,buffer) == OK)
mvwprintw(win, 8, 6, "String: %s Number: %d", buffer,num);
#endif /* HAVE_VSSCANF */
Continue(win);
cbreak();
}
/****************************************************************************