summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libcurses/Caps24
-rw-r--r--lib/libcurses/base/lib_getch.c55
-rw-r--r--lib/libcurses/base/lib_mouse.c144
-rw-r--r--lib/libcurses/curses.h8
-rw-r--r--lib/libcurses/term.h4
-rw-r--r--lib/libcurses/termcap.h4
-rw-r--r--lib/libcurses/terminfo.5tbl7
-rw-r--r--lib/libcurses/tinfo/comp_parse.c4
-rw-r--r--lib/libcurses/tinfo/lib_tparm.c7
-rw-r--r--lib/libcurses/tinfo/read_entry.c53
-rw-r--r--lib/libcurses/tinfo/read_termcap.c27
-rw-r--r--lib/libcurses/tty/lib_vidattr.c6
-rw-r--r--lib/libcurses/unctrl.h4
-rw-r--r--lib/libform/fty_enum.c6
-rw-r--r--usr.bin/tic/tic.c11
15 files changed, 176 insertions, 188 deletions
diff --git a/lib/libcurses/Caps b/lib/libcurses/Caps
index 94c16b996bc..4e415b489e8 100644
--- a/lib/libcurses/Caps
+++ b/lib/libcurses/Caps
@@ -29,8 +29,8 @@
# Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995
# and: Eric S. Raymond <esr@snark.thyrsus.com>
#
-# $OpenBSD: Caps,v 1.4 2000/10/08 22:46:53 millert Exp $
-# $From: Caps,v 1.28 2000/10/01 02:07:36 tom Exp $
+# $OpenBSD: Caps,v 1.5 2000/10/22 18:27:18 millert Exp $
+# $From: Caps,v 1.30 2000/10/14 17:36:14 tom Exp $
#
# This is the master termcap/terminfo capability table.
#
@@ -595,11 +595,11 @@ key_f62 kf62 str Fq ----E F62 function key
key_f63 kf63 str Fr ----E F63 function key
clr_bol el1 str cb ----- Clear to beginning of line
clear_margins mgc str MC ----- clear right and left soft margins
-set_left_margin smgl str ML ----- set left soft margin at current column
+set_left_margin smgl str ML ----- set left soft margin at current column. See smgl. (ML is not in BSD termcap).
set_right_margin smgr str MR ----- set right soft margin at current column
label_format fln str Lf ----- label format
set_clock sclk str SC ----- set clock, #1 hrs #2 mins #3 secs
-display_clock dclk str DK ----- display clock at (#1,#2)
+display_clock dclk str DK ----- display clock
remove_clock rmclk str RC ----- remove clock
create_window cwin str CW ----- define a window #1 from #2,#3 to #4,#5
goto_window wingo str WG ----- go to window #1
@@ -638,7 +638,7 @@ change_char_pitch cpi str ZA ----- Change number of characters per inch to #1
change_line_pitch lpi str ZB ----- Change number of lines per inch to #1
change_res_horz chr str ZC ----- Change horizontal resolution to #1
change_res_vert cvr str ZD ----- Change vertical resolution to #1
-define_char defc str ZE ----- Define a character
+define_char defc str ZE ----- Define a character #1, #2 dots wide, descender #3
enter_doublewide_mode swidm str ZF ----- Enter double-wide mode
enter_draft_quality sdrfq str ZG ----- Enter draft-quality mode
enter_italics_mode sitm str ZH ----- Enter italic mode
@@ -671,15 +671,15 @@ parm_right_micro mcuf str Zh ----- Like parm_right_cursor in micro mode
parm_up_micro mcuu str Zi ----- Like parm_up_cursor in micro mode
select_char_set scs str Zj ----- Select character set, #1
set_bottom_margin smgb str Zk ----- Set bottom margin at current line
-set_bottom_margin_parm smgbp str Zl ----- Set bottom margin at line #1 or #2 lines from bottom
-set_left_margin_parm smglp str Zm ----- Set left (right) margin at column #1 (#2)
+set_bottom_margin_parm smgbp str Zl ----- Set bottom margin at line #1 or (if smgtp is not given) #2 lines from bottom
+set_left_margin_parm smglp str Zm ----- Set left (right) margin at column #1
set_right_margin_parm smgrp str Zn ----- Set right margin at column #1
set_top_margin smgt str Zo ----- Set top margin at current line
-set_top_margin_parm smgtp str Zp ----- Set top (bottom) margin at row #1 (#2)
+set_top_margin_parm smgtp str Zp ----- Set top (bottom) margin at row #1
start_bit_image sbim str Zq ----- Start printing bit image graphics
-start_char_set_def scsd str Zr ----- Start character set definition
+start_char_set_def scsd str Zr ----- Start character set definition #1, with #2 characters in the set
stop_bit_image rbim str Zs ----- Stop printing bit image graphics
-stop_char_set_def rcsd str Zt ----- End definition of character set
+stop_char_set_def rcsd str Zt ----- End definition of character set #1
subscript_characters subcs str Zu ----- List of subscriptable characters
superscript_characters supcs str Zv ----- List of superscriptable characters
these_cause_cr docr str Zw ----- Printing any of these characters causes CR
@@ -698,7 +698,7 @@ zero_motion zerom str Zx ----- No motion for subsequent character
#%lw25 lw6 lw2 lw18.
#%\fBVariable Cap- TCap Description\fR
#%\fBString name Code\fR
-char_set_names csnm str Zy ----- List of character set names
+char_set_names csnm str Zy ----- Produce #1'th item from list of character set names
key_mouse kmous str Km ----- Mouse event has occurred
mouse_info minfo str Mi ----- Mouse status information
req_mouse_pos reqmp str RQ ----- Request mouse position
@@ -712,7 +712,7 @@ set0_des_seq s0ds str s0 ----- Shift to code set 0 (EUC set 0, ASCII)
set1_des_seq s1ds str s1 ----- Shift to code set 1
set2_des_seq s2ds str s2 ----- Shift to code set 2
set3_des_seq s3ds str s3 ----- Shift to code set 3
-set_lr_margin smglr str ML ----- Set both left and right margins to #1, #2
+set_lr_margin smglr str ML ----- Set both left and right margins to #1, #2. (ML is not in BSD termcap).
set_tb_margin smgtb str MT ----- Sets both top and bottom margins to #1, #2
bit_image_repeat birep str Xy ----- Repeat bit image cell #1 #2 times
bit_image_newline binel str Zz ----- Move to next row of the bit image
diff --git a/lib/libcurses/base/lib_getch.c b/lib/libcurses/base/lib_getch.c
index ca60de8dddc..97cf02ccc55 100644
--- a/lib/libcurses/base/lib_getch.c
+++ b/lib/libcurses/base/lib_getch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_getch.c,v 1.8 2000/10/10 15:10:31 millert Exp $ */
+/* $OpenBSD: lib_getch.c,v 1.9 2000/10/22 18:27:22 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
@@ -42,57 +42,12 @@
#include <curses.priv.h>
-MODULE_ID("$From: lib_getch.c,v 1.49 2000/07/29 15:45:24 tom Exp $")
+MODULE_ID("$From: lib_getch.c,v 1.50 2000/10/09 23:53:57 Ilya.Zakharevich Exp $")
#include <fifo_defs.h>
int ESCDELAY = 1000; /* max interval betw. chars in funkeys, in millisecs */
-#ifdef USE_EMX_MOUSE
-# include <sys/select.h>
-static int
-kbd_mouse_read(unsigned char *p)
-{
- fd_set *fdset;
- size_t fdsetsize;
- int nums = SP->_ifd + 1;
-
- if (SP->_checkfd >= 0 && SP->_checkfd >= nums)
- nums = SP->_checkfd + 1;
- if (SP->_mouse_fd >= 0 && SP->_mouse_fd >= nums)
- nums = SP->_mouse_fd + 1;
- fdsetsize = howmany(nums, NFDBITS) * sizeof(fd_mask);
- fdset = malloc(fdsetsize);
- if (fdset == NULL)
- return -1;
-
- for (;;) {
- memset(fdset, 0, fdsetsize);
- FD_SET(SP->_ifd, fdset);
- if (SP->_checkfd >= 0)
- FD_SET(SP->_checkfd, fdset);
- if (SP->_mouse_fd >= 0)
- FD_SET(SP->_mouse_fd, fdset);
- if (select(nums, fdset, NULL, NULL, NULL) >= 0) {
- int n;
-
- if (SP->_mouse_fd >= 0
- && FD_ISSET(SP->_mouse_fd, fdset)) { /* Prefer mouse */
- n = read(SP->_mouse_fd, p, 1);
- } else {
- n = read(SP->_ifd, p, 1);
- }
- free(fdset);
- return n;
- }
- if (errno != EINTR) {
- free(fdset);
- return -1;
- }
- }
-}
-#endif /* USE_EMX_MOUSE */
-
static inline int
fifo_peek(void)
{
@@ -137,7 +92,7 @@ fifo_push(void)
errno = 0;
#endif
-#if USE_GPM_SUPPORT
+#if USE_GPM_SUPPORT || defined(USE_EMX_MOUSE)
if ((SP->_mouse_fd >= 0)
&& (_nc_timed_wait(3, -1, (int *) 0) & 2)) {
SP->_mouse_event(SP);
@@ -147,11 +102,7 @@ fifo_push(void)
#endif
{
unsigned char c2 = 0;
-#ifdef USE_EMX_MOUSE
- n = kbd_mouse_read(&c2);
-#else
n = read(SP->_ifd, &c2, 1);
-#endif
ch = c2 & 0xff;
}
diff --git a/lib/libcurses/base/lib_mouse.c b/lib/libcurses/base/lib_mouse.c
index e915f4bf6b7..28546dc0853 100644
--- a/lib/libcurses/base/lib_mouse.c
+++ b/lib/libcurses/base/lib_mouse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_mouse.c,v 1.11 2000/10/08 22:46:59 millert Exp $ */
+/* $OpenBSD: lib_mouse.c,v 1.12 2000/10/22 18:27:22 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
@@ -86,7 +86,7 @@
#endif
#endif
-MODULE_ID("$From: lib_mouse.c,v 1.54 2000/10/03 08:26:34 tom Exp $")
+MODULE_ID("$From: lib_mouse.c,v 1.55 2000/10/10 00:07:28 Ilya.Zakharevich Exp $")
#define MY_TRACE TRACE_ICALLS|TRACE_IEVENT
@@ -132,8 +132,8 @@ _trace_slot(const char *tag)
for (ep = events; ep < events + EV_MAX; ep++)
_tracef("mouse event queue slot %ld = %s",
- (long) (ep - events),
- _tracemouse(ep));
+ (long) (ep - events),
+ _tracemouse(ep));
}
#endif
@@ -171,20 +171,28 @@ mouse_server(unsigned long ignored GCC_UNUSED)
MOUEVENTINFO mouev;
HMOU hmou;
unsigned short mask = MOUSE_BN1_DOWN | MOUSE_BN2_DOWN | MOUSE_BN3_DOWN;
+ int nbuttons = 3;
int oldstate = 0;
- char errmess[] = "Unexpected termination of mouse thread\r\n";
- unsigned long ignore;
+ char err[80];
+ unsigned long rc;
/* open the handle for the mouse */
if (MouOpen(NULL, &hmou) == 0) {
-
- if (MouSetEventMask(&mask, hmou) == 0
- && MouDrawPtr(hmou) == 0) {
-
+ rc = MouSetEventMask(&mask, hmou);
+ if (rc) { /* retry with 2 buttons */
+ mask = MOUSE_BN1_DOWN | MOUSE_BN2_DOWN;
+ rc = MouSetEventMask(&mask, hmou);
+ nbuttons = 2;
+ }
+ if (rc == 0 && MouDrawPtr(hmou) == 0) {
for (;;) {
/* sit and wait on the event queue */
- if (MouReadEventQue(&mouev, &fWait, hmou))
+ rc = MouReadEventQue(&mouev, &fWait, hmou);
+ if (rc) {
+ snprintf(err, sizeof(err),
+ "Error reading mouse queue, rc=%lu.\r\n", rc);
break;
+ }
if (!mouse_activated)
goto finish;
@@ -197,24 +205,28 @@ mouse_server(unsigned long ignored GCC_UNUSED)
*/
if ((mouev.fs ^ oldstate) & MOUSE_BN1_DOWN)
write_event(mouev.fs & MOUSE_BN1_DOWN,
- mouse_buttons[1], mouev.col, mouev.row);
+ mouse_buttons[1], mouev.col, mouev.row);
if ((mouev.fs ^ oldstate) & MOUSE_BN2_DOWN)
write_event(mouev.fs & MOUSE_BN2_DOWN,
- mouse_buttons[3], mouev.col, mouev.row);
+ mouse_buttons[3], mouev.col, mouev.row);
if ((mouev.fs ^ oldstate) & MOUSE_BN3_DOWN)
write_event(mouev.fs & MOUSE_BN3_DOWN,
- mouse_buttons[2], mouev.col, mouev.row);
+ mouse_buttons[2], mouev.col, mouev.row);
finish:
oldstate = mouev.fs;
}
- }
+ } else
+ snprintf(err, sizeof(err),
+ "Error setting event mask, buttons=%d, rc=%lu.\r\n",
+ nbuttons, rc);
- DosWrite(2, errmess, strlen(errmess), &ignore);
+ DosWrite(2, err, strlen(err), &rc);
MouClose(hmou);
}
DosExit(EXIT_THREAD, 0L);
}
+
static void
server_state(const int state)
{ /* It would be nice to implement pointer-off and stop looping... */
@@ -250,8 +262,10 @@ initialize_mousetype(void)
&& strstr(cur_term->type.term_names, "xterm") == 0
&& key_mouse) {
int handles[2];
+
if (pipe(handles) < 0) {
perror("mouse pipe error");
+ return;
} else {
int rc;
@@ -272,9 +286,10 @@ initialize_mousetype(void)
setmode(handles[1], O_BINARY);
/* Do not use CRT functions, we may single-threaded. */
rc = DosCreateThread((unsigned long *) &mouse_thread,
- mouse_server, 0, 0, 8192);
+ mouse_server, 0, 0, 8192);
if (rc) {
printf("mouse thread error %d=%#x", rc, rc);
+ return;
} else {
mousetype = M_XTERM;
return;
@@ -361,6 +376,23 @@ _nc_mouse_event(SCREEN * sp GCC_UNUSED)
}
#endif
+#ifdef USE_EMX_MOUSE
+ if (SP->_mouse_fd >= 0
+ && (_nc_timed_wait(3, 0, (int *) 0) & 2) != 0) {
+ char kbuf[3];
+
+ int i, res = read(M_FD(sp), &kbuf, 3); /* Eat the prefix */
+ if (res != 3)
+ printf("Got %d chars instead of 3 for prefix.\n", res);
+ for (i = 0; i < res; i++) {
+ if (kbuf[i] != key_mouse[i])
+ printf("Got char %d instead of %d for prefix.\n",
+ (int) kbuf[i], (int) key_mouse[i]);
+ }
+ return TRUE;
+ }
+#endif /* USE_EMX_MOUSE */
+
/* xterm: never have to query, mouse events are in the keyboard stream */
return (FALSE); /* no event waiting */
}
@@ -421,7 +453,7 @@ _nc_mouse_inline(SCREEN * sp)
kbuf[3] = '\0';
TR(TRACE_IEVENT,
- ("_nc_mouse_inline sees the following xterm data: '%s'", kbuf));
+ ("_nc_mouse_inline sees the following xterm data: '%s'", kbuf));
eventp->id = 0; /* there's only one mouse... */
@@ -459,8 +491,8 @@ _nc_mouse_inline(SCREEN * sp)
*/
eventp->bstate =
(BUTTON1_RELEASED |
- BUTTON2_RELEASED |
- BUTTON3_RELEASED);
+ BUTTON2_RELEASED |
+ BUTTON3_RELEASED);
/*
* ...however, because there are no kinds of mouse events under
* xterm that can intervene between press and release, we can
@@ -490,9 +522,9 @@ _nc_mouse_inline(SCREEN * sp)
eventp->x = (kbuf[1] - ' ') - 1;
eventp->y = (kbuf[2] - ' ') - 1;
TR(MY_TRACE,
- ("_nc_mouse_inline: primitive mouse-event %s has slot %ld",
- _tracemouse(eventp),
- (long) (eventp - events)));
+ ("_nc_mouse_inline: primitive mouse-event %s has slot %ld",
+ _tracemouse(eventp),
+ (long) (eventp - events)));
/* bump the next-free pointer into the circular list */
eventp = NEXT(eventp);
@@ -600,9 +632,9 @@ _nc_mouse_parse(int runcount)
*/
if (runcount == 1) {
TR(MY_TRACE,
- ("_nc_mouse_parse: returning simple mouse event %s at slot %ld",
- _tracemouse(prev),
- (long) (prev - events)));
+ ("_nc_mouse_parse: returning simple mouse event %s at slot %ld",
+ _tracemouse(prev),
+ (long) (prev - events)));
return (prev->id >= 0)
? ((prev->bstate & eventmask) ? TRUE : FALSE)
: FALSE;
@@ -618,9 +650,9 @@ _nc_mouse_parse(int runcount)
if (_nc_tracing & TRACE_IEVENT) {
_trace_slot("before mouse press/release merge:");
_tracef("_nc_mouse_parse: run starts at %ld, ends at %ld, count %d",
- (long) (runp - events),
- (long) ((eventp - events) + (EV_MAX - 1)) % EV_MAX,
- runcount);
+ (long) (runp - events),
+ (long) ((eventp - events) + (EV_MAX - 1)) % EV_MAX,
+ runcount);
}
#endif /* TRACE */
@@ -666,9 +698,9 @@ _nc_mouse_parse(int runcount)
if (_nc_tracing & TRACE_IEVENT) {
_trace_slot("before mouse click merge:");
_tracef("_nc_mouse_parse: run starts at %ld, ends at %ld, count %d",
- (long) (runp - events),
- (long) ((eventp - events) + (EV_MAX - 1)) % EV_MAX,
- runcount);
+ (long) (runp - events),
+ (long) ((eventp - events) + (EV_MAX - 1)) % EV_MAX,
+ runcount);
}
#endif /* TRACE */
@@ -702,7 +734,7 @@ _nc_mouse_parse(int runcount)
/* merge click events forward */
if ((ep->bstate &
- (BUTTON1_CLICKED | BUTTON2_CLICKED | BUTTON3_CLICKED))
+ (BUTTON1_CLICKED | BUTTON2_CLICKED | BUTTON3_CLICKED))
&& (follower->bstate &
(BUTTON1_CLICKED | BUTTON2_CLICKED | BUTTON3_CLICKED))) {
if ((eventmask & BUTTON1_DOUBLE_CLICKED)
@@ -729,9 +761,9 @@ _nc_mouse_parse(int runcount)
/* merge double-click events forward */
if ((ep->bstate &
- (BUTTON1_DOUBLE_CLICKED
- | BUTTON2_DOUBLE_CLICKED
- | BUTTON3_DOUBLE_CLICKED))
+ (BUTTON1_DOUBLE_CLICKED
+ | BUTTON2_DOUBLE_CLICKED
+ | BUTTON3_DOUBLE_CLICKED))
&& (follower->bstate &
(BUTTON1_CLICKED | BUTTON2_CLICKED | BUTTON3_CLICKED))) {
if ((eventmask & BUTTON1_TRIPLE_CLICKED)
@@ -763,9 +795,9 @@ _nc_mouse_parse(int runcount)
if (_nc_tracing & TRACE_IEVENT) {
_trace_slot("before mouse event queue compaction:");
_tracef("_nc_mouse_parse: run starts at %ld, ends at %ld, count %d",
- (long) (runp - events),
- (long) ((eventp - events) + (EV_MAX - 1)) % EV_MAX,
- runcount);
+ (long) (runp - events),
+ (long) ((eventp - events) + (EV_MAX - 1)) % EV_MAX,
+ runcount);
}
#endif /* TRACE */
@@ -781,16 +813,16 @@ _nc_mouse_parse(int runcount)
if (_nc_tracing & TRACE_IEVENT) {
_trace_slot("after mouse event queue compaction:");
_tracef("_nc_mouse_parse: run starts at %ld, ends at %ld, count %d",
- (long) (runp - events),
- (long) ((eventp - events) + (EV_MAX - 1)) % EV_MAX,
- runcount);
+ (long) (runp - events),
+ (long) ((eventp - events) + (EV_MAX - 1)) % EV_MAX,
+ runcount);
}
for (ep = runp; ep != eventp; ep = NEXT(ep))
if (ep->id != INVALID_EVENT)
TR(MY_TRACE,
- ("_nc_mouse_parse: returning composite mouse event %s at slot %ld",
- _tracemouse(ep),
- (long) (ep - events)));
+ ("_nc_mouse_parse: returning composite mouse event %s at slot %ld",
+ _tracemouse(ep),
+ (long) (ep - events)));
#endif /* TRACE */
/* after all this, do we have a valid event? */
@@ -849,8 +881,8 @@ getmouse(MEVENT * aevent)
*aevent = *prev;
TR(TRACE_IEVENT, ("getmouse: returning event %s from slot %ld",
- _tracemouse(prev),
- (long) (prev - events)));
+ _tracemouse(prev),
+ (long) (prev - events)));
prev->id = INVALID_EVENT; /* so the queue slot becomes free */
returnCode(OK);
@@ -890,12 +922,12 @@ mousemask(mmask_t newmask, mmask_t * oldmask)
if (mousetype != M_NONE) {
eventmask = newmask &
(BUTTON_ALT | BUTTON_CTRL | BUTTON_SHIFT
- | BUTTON1_PRESSED | BUTTON1_RELEASED | BUTTON1_CLICKED
- | BUTTON1_DOUBLE_CLICKED | BUTTON1_TRIPLE_CLICKED
- | BUTTON2_PRESSED | BUTTON2_RELEASED | BUTTON2_CLICKED
- | BUTTON2_DOUBLE_CLICKED | BUTTON2_TRIPLE_CLICKED
- | BUTTON3_PRESSED | BUTTON3_RELEASED | BUTTON3_CLICKED
- | BUTTON3_DOUBLE_CLICKED | BUTTON3_TRIPLE_CLICKED);
+ | BUTTON1_PRESSED | BUTTON1_RELEASED | BUTTON1_CLICKED
+ | BUTTON1_DOUBLE_CLICKED | BUTTON1_TRIPLE_CLICKED
+ | BUTTON2_PRESSED | BUTTON2_RELEASED | BUTTON2_CLICKED
+ | BUTTON2_DOUBLE_CLICKED | BUTTON2_TRIPLE_CLICKED
+ | BUTTON3_PRESSED | BUTTON3_RELEASED | BUTTON3_CLICKED
+ | BUTTON3_DOUBLE_CLICKED | BUTTON3_TRIPLE_CLICKED);
mouse_activate(eventmask != 0);
@@ -912,9 +944,9 @@ wenclose(const WINDOW *win, int y, int x)
if (win) {
y -= win->_yoffset;
return ((win->_begy <= y &&
- win->_begx <= x &&
- (win->_begx + win->_maxx) >= x &&
- (win->_begy + win->_maxy) >= y) ? TRUE : FALSE);
+ win->_begx <= x &&
+ (win->_begx + win->_maxx) >= x &&
+ (win->_begy + win->_maxy) >= y) ? TRUE : FALSE);
}
return FALSE;
}
diff --git a/lib/libcurses/curses.h b/lib/libcurses/curses.h
index 0080d97cf88..68d3224c0e3 100644
--- a/lib/libcurses/curses.h
+++ b/lib/libcurses/curses.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: curses.h,v 1.54 2000/10/08 22:46:54 millert Exp $ */
+/* $OpenBSD: curses.h,v 1.55 2000/10/22 18:27:19 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
@@ -49,12 +49,12 @@
/* These are defined only in curses.h, and are used for conditional compiles */
#define NCURSES_VERSION_MAJOR 5
-#define NCURSES_VERSION_MINOR 1
-#define NCURSES_VERSION_PATCH 20001004
+#define NCURSES_VERSION_MINOR 2
+#define NCURSES_VERSION_PATCH 20001021
/* This is defined in more than one ncurses header, for identification */
#undef NCURSES_VERSION
-#define NCURSES_VERSION "5.1"
+#define NCURSES_VERSION "5.2"
#ifdef NCURSES_NOMACROS
#define NCURSES_ATTR_T attr_t
diff --git a/lib/libcurses/term.h b/lib/libcurses/term.h
index 5422a62c288..5791e6eeb7d 100644
--- a/lib/libcurses/term.h
+++ b/lib/libcurses/term.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: term.h,v 1.10 2000/07/10 03:06:11 millert Exp $ */
+/* $OpenBSD: term.h,v 1.11 2000/10/22 18:27:19 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
@@ -47,7 +47,7 @@
#endif
#undef NCURSES_VERSION
-#define NCURSES_VERSION "5.1"
+#define NCURSES_VERSION "5.2"
#ifdef __cplusplus
extern "C" {
diff --git a/lib/libcurses/termcap.h b/lib/libcurses/termcap.h
index 5109159cb97..91fbfbcd676 100644
--- a/lib/libcurses/termcap.h
+++ b/lib/libcurses/termcap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: termcap.h,v 1.6 2000/10/08 22:46:56 millert Exp $ */
+/* $OpenBSD: termcap.h,v 1.7 2000/10/22 18:27:19 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -39,7 +39,7 @@
#define _NCU_TERMCAP_H 1
#undef NCURSES_VERSION
-#define NCURSES_VERSION "5.1"
+#define NCURSES_VERSION "5.2"
#ifdef __cplusplus
extern "C"
diff --git a/lib/libcurses/terminfo.5tbl b/lib/libcurses/terminfo.5tbl
index 5eedf5564c5..16e61f413bf 100644
--- a/lib/libcurses/terminfo.5tbl
+++ b/lib/libcurses/terminfo.5tbl
@@ -33,7 +33,7 @@
.\"***************************************************************************
.\"
.\" $From: terminfo.head,v 1.9 2000/08/13 01:56:40 tom Exp $
-.\" $OpenBSD: terminfo.5tbl,v 1.10 2000/10/08 22:46:56 millert Exp $
+.\" $OpenBSD: terminfo.5tbl,v 1.11 2000/10/22 18:27:19 millert Exp $
.TH TERMINFO 5 "" "" "File Formats"
.ds n 5
.ds d /usr/share/terminfo
@@ -1623,7 +1623,7 @@ YI Set page length to #1 hundredth of an inch
T}
.TE
.ad
-.\" $From: terminfo.tail,v 1.32 2000/04/15 20:04:58 tom Exp $
+.\" $From: terminfo.tail,v 1.33 2000/10/14 14:06:50 tom Exp $
.\" Beginning of terminfo.tail file
.ps +1
.PP
@@ -2537,7 +2537,8 @@ output
.BR is2 ;
set the margins using
.BR mgc ,
-.BR smgl and
+.BR smgl
+and
.BR smgr ;
set tabs using
.B tbc
diff --git a/lib/libcurses/tinfo/comp_parse.c b/lib/libcurses/tinfo/comp_parse.c
index d9d1f2eb151..161b6d977c3 100644
--- a/lib/libcurses/tinfo/comp_parse.c
+++ b/lib/libcurses/tinfo/comp_parse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: comp_parse.c,v 1.8 2000/10/08 22:47:00 millert Exp $ */
+/* $OpenBSD: comp_parse.c,v 1.9 2000/10/22 18:27:23 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
@@ -54,7 +54,7 @@
#include <tic.h>
#include <term_entry.h>
-MODULE_ID("$From: comp_parse.c,v 1.41 2000/10/03 09:53:49 tom Exp $")
+MODULE_ID("$From: comp_parse.c,v 1.42 2000/10/14 17:50:45 Bernhard.Rosenkraenzer Exp $")
static void sanity_check(TERMTYPE *);
void (*_nc_check_termtype) (TERMTYPE *) = sanity_check;
diff --git a/lib/libcurses/tinfo/lib_tparm.c b/lib/libcurses/tinfo/lib_tparm.c
index a548dcb35de..536301ca9c4 100644
--- a/lib/libcurses/tinfo/lib_tparm.c
+++ b/lib/libcurses/tinfo/lib_tparm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_tparm.c,v 1.5 2000/10/08 22:47:02 millert Exp $ */
+/* $OpenBSD: lib_tparm.c,v 1.6 2000/10/22 18:27:23 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
@@ -44,7 +44,7 @@
#include <term.h>
#include <tic.h>
-MODULE_ID("$From: lib_tparm.c,v 1.47 2000/10/04 00:57:13 tom Exp $")
+MODULE_ID("$From: lib_tparm.c,v 1.48 2000/10/14 17:45:00 Sergei.Ivanov Exp $")
/*
* char *
@@ -719,8 +719,7 @@ tparam_internal(const char *string, va_list ap)
string++;
} /* endwhile (*string) */
- if (out_buff == 0 && (out_buff = typeCalloc(char, 1)) == NULL)
- return (NULL);
+ get_space(1);
out_buff[out_used] = '\0';
T((T_RETURN("%s"), _nc_visbuf(out_buff)));
diff --git a/lib/libcurses/tinfo/read_entry.c b/lib/libcurses/tinfo/read_entry.c
index f662136e9a1..7ebc4785572 100644
--- a/lib/libcurses/tinfo/read_entry.c
+++ b/lib/libcurses/tinfo/read_entry.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: read_entry.c,v 1.10 2000/10/08 22:47:03 millert Exp $ */
+/* $OpenBSD: read_entry.c,v 1.11 2000/10/22 18:27:23 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
@@ -43,7 +43,7 @@
#include <tic.h>
#include <term_entry.h>
-MODULE_ID("$From: read_entry.c,v 1.68 2000/10/04 02:32:04 tom Exp $")
+MODULE_ID("$From: read_entry.c,v 1.69 2000/10/10 00:57:40 Todd.Miller Exp $")
#if !HAVE_TELL
#define tell(fd) 0 /* lseek() is POSIX, but not tell() - odd... */
@@ -178,9 +178,9 @@ read_termtype(int fd, TERMTYPE * ptr)
str_size = LOW_MSB(buf + 10);
TR(TRACE_DATABASE,
- ("TERMTYPE name_size=%d, bool=%d/%d, num=%d/%d str=%d/%d(%d)",
- name_size, bool_count, BOOLCOUNT, num_count, NUMCOUNT,
- str_count, STRCOUNT, str_size));
+ ("TERMTYPE name_size=%d, bool=%d/%d, num=%d/%d str=%d/%d(%d)",
+ name_size, bool_count, BOOLCOUNT, num_count, NUMCOUNT,
+ str_count, STRCOUNT, str_size));
if (name_size < 0
|| bool_count < 0
|| num_count < 0
@@ -283,19 +283,20 @@ read_termtype(int fd, TERMTYPE * ptr)
ptr->Strings = typeRealloc(char *, ptr->num_Strings, ptr->Strings);
TR(TRACE_DATABASE, ("extended header is %d/%d/%d(%d:%d)",
- ext_bool_count, ext_num_count, ext_str_count, ext_str_size, ext_str_limit));
+ ext_bool_count, ext_num_count, ext_str_count,
+ ext_str_size, ext_str_limit));
TR(TRACE_DATABASE, ("READ %d extended-booleans @%d",
- ext_bool_count, tell(fd)));
+ ext_bool_count, tell(fd)));
if ((ptr->ext_Booleans = ext_bool_count) != 0) {
if (read(fd, ptr->Booleans + BOOLCOUNT, (unsigned)
- ext_bool_count) != ext_bool_count)
+ ext_bool_count) != ext_bool_count)
return (0);
}
even_boundary(ext_bool_count);
TR(TRACE_DATABASE, ("READ %d extended-numbers @%d",
- ext_num_count, tell(fd)));
+ ext_num_count, tell(fd)));
if ((ptr->ext_Numbers = ext_num_count) != 0) {
if (!read_shorts(fd, buf, ext_num_count))
return (0);
@@ -309,7 +310,7 @@ read_termtype(int fd, TERMTYPE * ptr)
return (0);
TR(TRACE_DATABASE, ("READ %d bytes of extended-strings @%d",
- ext_str_limit, tell(fd)));
+ ext_str_limit, tell(fd)));
if (ext_str_limit) {
if ((ptr->ext_str_table = typeMalloc(char, ext_str_limit)) == 0)
@@ -321,20 +322,20 @@ read_termtype(int fd, TERMTYPE * ptr)
if ((ptr->ext_Strings = ext_str_count) != 0) {
TR(TRACE_DATABASE,
- ("Before computing extended-string capabilities str_count=%d, ext_str_count=%d",
- str_count, ext_str_count));
+ ("Before computing extended-string capabilities str_count=%d, ext_str_count=%d",
+ str_count, ext_str_count));
convert_strings(buf, ptr->Strings + str_count, ext_str_count,
- ext_str_limit, ptr->ext_str_table);
+ ext_str_limit, ptr->ext_str_table);
for (i = ext_str_count - 1; i >= 0; i--) {
TR(TRACE_DATABASE, ("MOVE from [%d:%d] %s",
- i, i + str_count,
- _nc_visbuf(ptr->Strings[i + str_count])));
+ i, i + str_count,
+ _nc_visbuf(ptr->Strings[i + str_count])));
ptr->Strings[i + STRCOUNT] = ptr->Strings[i + str_count];
if (VALID_STRING(ptr->Strings[i + STRCOUNT]))
base += (strlen(ptr->Strings[i + STRCOUNT]) + 1);
TR(TRACE_DATABASE, ("... to [%d] %s",
- i + STRCOUNT,
- _nc_visbuf(ptr->Strings[i + STRCOUNT])));
+ i + STRCOUNT,
+ _nc_visbuf(ptr->Strings[i + STRCOUNT])));
}
}
@@ -342,23 +343,23 @@ read_termtype(int fd, TERMTYPE * ptr)
if ((ptr->ext_Names = typeCalloc(char *, need)) == 0)
return (0);
TR(TRACE_DATABASE,
- ("ext_NAMES starting @%d in extended_strings, first = %s",
- base, _nc_visbuf(ptr->ext_str_table + base)));
+ ("ext_NAMES starting @%d in extended_strings, first = %s",
+ base, _nc_visbuf(ptr->ext_str_table + base)));
convert_strings(buf + (2 * ext_str_count), ptr->ext_Names, need,
- ext_str_limit, ptr->ext_str_table + base);
+ ext_str_limit, ptr->ext_str_table + base);
}
T(("...done reading terminfo bool %d(%d) num %d(%d) str %d(%d)",
- ptr->num_Booleans, ptr->ext_Booleans,
- ptr->num_Numbers, ptr->ext_Numbers,
- ptr->num_Strings, ptr->ext_Strings));
+ ptr->num_Booleans, ptr->ext_Booleans,
+ ptr->num_Numbers, ptr->ext_Numbers,
+ ptr->num_Strings, ptr->ext_Strings));
TR(TRACE_DATABASE, ("extend: num_Booleans:%d", ptr->num_Booleans));
} else
#endif /* NCURSES_XNAMES */
{
T(("...done reading terminfo bool %d num %d str %d",
- bool_count, num_count, str_count));
+ bool_count, num_count, str_count));
#if NCURSES_XNAMES
TR(TRACE_DATABASE, ("normal: num_Booleans:%d", ptr->num_Booleans));
#endif
@@ -405,7 +406,7 @@ _nc_read_file_entry(const char *const filename, TERMTYPE * ptr)
*/
static int
_nc_read_tic_entry(char *const filename,
- const char *const dir, const char *ttn, TERMTYPE * const tp)
+ const char *const dir, const char *ttn, TERMTYPE * const tp)
{
/* maximum safe length of terminfo root directory name */
#define MAX_TPATH (PATH_MAX - MAX_ALIAS - 6)
@@ -422,7 +423,7 @@ _nc_read_tic_entry(char *const filename,
*/
static int
_nc_read_terminfo_dirs(const char *dirs, char *const filename, const char *const
- ttn, TERMTYPE * const tp)
+ ttn, TERMTYPE * const tp)
{
char *list, *a;
const char *b;
diff --git a/lib/libcurses/tinfo/read_termcap.c b/lib/libcurses/tinfo/read_termcap.c
index b8a227db947..fe7aa25c5ad 100644
--- a/lib/libcurses/tinfo/read_termcap.c
+++ b/lib/libcurses/tinfo/read_termcap.c
@@ -55,7 +55,7 @@
#include <tic.h>
#include <term_entry.h>
-MODULE_ID("$From: read_termcap.c,v 1.49 2000/10/05 00:37:19 tom Exp $")
+MODULE_ID("$From: read_termcap.c,v 1.51 2000/10/21 00:34:11 Philip.Guenther Exp $")
#if !PURE_TERMINFO
@@ -81,7 +81,8 @@ MODULE_ID("$From: read_termcap.c,v 1.49 2000/10/05 00:37:19 tom Exp $")
#define _nc_cgetset cgetset
#else
static int _nc_cgetmatch(char *, const char *);
-static int _nc_getent(char **, unsigned *, int *, int, char **, int, const char *, int, char *);
+static int _nc_getent(char **, unsigned *, int *, int, char **, int, const char
+ *, int, char *);
static int _nc_nfcmp(const char *, char *);
/*-
@@ -257,15 +258,15 @@ _nc_cgetent(char **buf, int *oline, char **db_array, const char *name)
#define DOALLOC(size) typeRealloc(char, size, record)
static int
_nc_getent(
- char **cap, /* termcap-content */
- unsigned *len, /* length, needed for recursion */
- int *beginning, /* line-number at match */
- int in_array, /* index in 'db_array[] */
- char **db_array, /* list of files to search */
- int fd,
- const char *name,
- int depth,
- char *nfield)
+ char **cap, /* termcap-content */
+ unsigned *len, /* length, needed for recursion */
+ int *beginning, /* line-number at match */
+ int in_array, /* index in 'db_array[] */
+ char **db_array, /* list of files to search */
+ int fd,
+ const char *name,
+ int depth,
+ char *nfield)
{
register char *r_end, *rp;
int myfd = FALSE;
@@ -318,7 +319,7 @@ _nc_getent(
if (fd >= 0) {
(void) lseek(fd, (off_t) 0, SEEK_SET);
} else if ((_nc_access(db_array[current], R_OK) < 0)
- || (fd = open(db_array[current], O_RDONLY, 0)) < 0) {
+ || (fd = open(db_array[current], O_RDONLY, 0)) < 0) {
/* No error on unfound file. */
if (errno == ENOENT)
continue;
@@ -481,7 +482,7 @@ _nc_getent(
tcend = s;
iret = _nc_getent(&icap, &ilen, &oline, current, db_array, fd,
- tc, depth + 1, 0);
+ tc, depth + 1, 0);
newicap = icap; /* Put into a register. */
newilen = ilen;
if (iret != TC_SUCCESS) {
diff --git a/lib/libcurses/tty/lib_vidattr.c b/lib/libcurses/tty/lib_vidattr.c
index 9f8476c760c..e9639a730c6 100644
--- a/lib/libcurses/tty/lib_vidattr.c
+++ b/lib/libcurses/tty/lib_vidattr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_vidattr.c,v 1.6 2000/10/08 22:47:05 millert Exp $ */
+/* $OpenBSD: lib_vidattr.c,v 1.7 2000/10/22 18:27:24 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
@@ -66,7 +66,7 @@
#include <curses.priv.h>
#include <term.h>
-MODULE_ID("$From: lib_vidattr.c,v 1.32 2000/09/17 00:15:23 tom Exp $")
+MODULE_ID("$From: lib_vidattr.c,v 1.33 2000/10/09 22:45:29 tom Exp $")
#define doPut(mode) TPUTS_TRACE(#mode); tputs(mode, 1, outc)
@@ -140,7 +140,7 @@ vidputs(attr_t newmode, int (*outc) (int))
| ((no_color_video & 192) << 1)
| ((no_color_video & 256) >> 2), 8);
- if (mask & A_REVERSE) {
+ if (mask & A_REVERSE && newmode & A_REVERSE) {
reverse = TRUE;
mask &= ~A_REVERSE;
}
diff --git a/lib/libcurses/unctrl.h b/lib/libcurses/unctrl.h
index 74e2231ec78..92d94a49a65 100644
--- a/lib/libcurses/unctrl.h
+++ b/lib/libcurses/unctrl.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: unctrl.h,v 1.6 2000/07/10 03:06:12 millert Exp $ */
+/* $OpenBSD: unctrl.h,v 1.7 2000/10/22 18:27:21 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -47,7 +47,7 @@
#define _UNCTRL_H 1
#undef NCURSES_VERSION
-#define NCURSES_VERSION "5.1"
+#define NCURSES_VERSION "5.2"
#ifdef __cplusplus
extern "C" {
diff --git a/lib/libform/fty_enum.c b/lib/libform/fty_enum.c
index a27a9ca8751..42aebc38098 100644
--- a/lib/libform/fty_enum.c
+++ b/lib/libform/fty_enum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fty_enum.c,v 1.7 2000/10/08 22:47:09 millert Exp $ */
+/* $OpenBSD: fty_enum.c,v 1.8 2000/10/22 18:27:24 millert Exp $ */
/*
@@ -15,7 +15,7 @@
#include "form.priv.h"
-MODULE_ID("$From: fty_enum.c,v 1.13 2000/09/10 00:55:26 juergen Exp $")
+MODULE_ID("$From: fty_enum.c,v 1.14 2000/10/18 09:28:19 juergen Exp $")
typedef struct {
char **kwds;
@@ -49,7 +49,7 @@ static void *Make_Enum_Type(va_list * ap)
argp->checkunique = cunique ? TRUE : FALSE;
kp = argp->kwds;
- while( (kp && *kp++) ) cnt++;
+ while( kp && (*kp++) ) cnt++;
argp->count = cnt;
}
return (void *)argp;
diff --git a/usr.bin/tic/tic.c b/usr.bin/tic/tic.c
index 6130a0c8324..f6efc744611 100644
--- a/usr.bin/tic/tic.c
+++ b/usr.bin/tic/tic.c
@@ -44,7 +44,7 @@
#include <term_entry.h>
#include <transform.h>
-MODULE_ID("$From: tic.c,v 1.82 2000/10/01 02:11:39 tom Exp $")
+MODULE_ID("$From: tic.c,v 1.83 2000/10/14 17:30:26 tom Exp $")
const char *_nc_progname = "tic";
@@ -772,16 +772,17 @@ expected_params(char *name)
{ "chr", 1 },
{ "colornm", 1 },
{ "cpi", 1 },
+ { "csnm", 1 },
{ "csr", 2 },
{ "cub", 1 },
{ "cud", 1 },
{ "cuf", 1 },
{ "cup", 2 },
- { "cvr", 1 },
{ "cuu", 1 },
+ { "cvr", 1 },
{ "cwin", 5 },
{ "dch", 1 },
- { "dclk", 2 },
+ { "defc", 3 },
{ "dial", 1 },
{ "dispc", 1 },
{ "dl", 1 },
@@ -803,11 +804,13 @@ expected_params(char *name)
{ "pfxl", 3 },
{ "pln", 2 },
{ "qdial", 1 },
+ { "rcsd", 1 },
{ "rep", 2 },
{ "rin", 1 },
{ "sclk", 3 },
{ "scp", 1 },
{ "scs", 1 },
+ { "scsd", 2 },
{ "setab", 1 },
{ "setaf", 1 },
{ "setb", 1 },
@@ -822,7 +825,7 @@ expected_params(char *name)
{ "smglr", 2 },
{ "smgrp", 1 },
{ "smgtb", 2 },
- { "smgtp", 2 },
+ { "smgtp", 1 },
{ "tsl", 1 },
{ "u6", -1 },
{ "vpa", 1 },